/* * Copyright (c) Company 2019-2020. All rights reserved. * Description: for gmac power manager * Author: Huanglong * Create: 2019-11-22 */ #ifndef __SOCT_GMAC_PM_H #define __SOCT_GMAC_PM_H #include "gmac.h" #define N 31 #define FILTERS 4 #define PM_FILTER_OFFSET_MIN 12 struct pm_config { unsigned char index; /* bit0--eth0 bit1--eth1 */ unsigned char uc_pkts_enable; unsigned char magic_pkts_enable; unsigned char wakeup_pkts_enable; struct { unsigned int mask_bytes : N; unsigned int reserved : 1; /* userspace ignore this bit */ unsigned char offset; /* >= 12 */ unsigned char value[N]; /* byte string */ unsigned char valid; /* valid filter */ } filter[FILTERS]; }; int pmt_config(const struct net_device *ndev, struct pm_config *config); int pmt_get_config(const struct net_device *ndev, struct pm_config *config); bool pmt_enter(struct gmac_netdev_local *ld); void pmt_exit(struct gmac_netdev_local *ld); #endif /* __SOCT_GMAC_PM_H */