123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226 |
- #ifndef __HIF_NAPI_H__
- #define __HIF_NAPI_H__
- #include <hif.h> /* struct hif_opaque_softc; */
- enum qca_napi_event {
- NAPI_EVT_INVALID,
- NAPI_EVT_INI_FILE,
- NAPI_EVT_CMD_STATE,
- NAPI_EVT_CPU_STATE,
- NAPI_EVT_TPUT_STATE,
- NAPI_EVT_USR_SERIAL,
- NAPI_EVT_USR_NORMAL
- };
- #define NAPI_ID2PIPE(i) ((i)-1)
- #define NAPI_PIPE2ID(p) ((p)+1)
- #ifdef FEATURE_NAPI
- int hif_napi_create(struct hif_opaque_softc *hif,
- int (*poll)(struct napi_struct *, int),
- int budget,
- int scale);
- int hif_napi_destroy(struct hif_opaque_softc *hif,
- uint8_t id,
- int force);
- struct qca_napi_data *hif_napi_get_all(struct hif_opaque_softc *hif);
- int hif_napi_event(struct hif_opaque_softc *hif,
- enum qca_napi_event event,
- void *data);
- int hif_napi_enabled(struct hif_opaque_softc *hif, int ce);
- void hif_napi_enable_irq(struct hif_opaque_softc *hif, int id);
- int hif_napi_schedule(struct hif_opaque_softc *scn, int ce_id);
- int hif_napi_poll(struct hif_opaque_softc *hif_ctx,
- struct napi_struct *napi, int budget);
- #ifdef FEATURE_NAPI_DEBUG
- #define NAPI_DEBUG(fmt, ...) \
- qdf_print("wlan: NAPI: %s:%d "fmt, __func__, __LINE__, ##__VA_ARGS__);
- #else
- #define NAPI_DEBUG(fmt, ...)
- #endif
- #define HNC_ANY_CPU (-1)
- #define HNC_ACT_RELOCATE (0)
- #define HNC_ACT_COLLAPSE (1)
- #define HNC_ACT_DISPERSE (-1)
- #ifndef HELIUMPLUS
- struct qca_napi_data;
- static inline int hif_napi_cpu_init(void *ctx) { return 0; }
- static inline int hif_napi_cpu_deinit(void *ctx) { return 0; }
- static inline int hif_napi_serialize(struct hif_opaque_softc *hif, int is_on)
- {
- return -EPERM;
- }
- #else
- int hif_napi_cpu_init(void *);
- int hif_napi_cpu_deinit(void *);
- int hif_napi_cpu_migrate(struct qca_napi_data *napid, int cpu, int action);
- int hif_napi_cpu_blacklist(bool is_on);
- int hif_napi_serialize(struct hif_opaque_softc *hif, int is_on);
- #endif
- #else
- #define NAPI_DEBUG(fmt, ...)
- static inline int hif_napi_create(struct hif_opaque_softc *hif,
- uint8_t pipe_id,
- int (*poll)(struct napi_struct *, int),
- int budget,
- int scale)
- { return -EPERM; }
- static inline int hif_napi_destroy(struct hif_opaque_softc *hif,
- uint8_t id,
- int force)
- { return -EPERM; }
- static inline struct qca_napi_data *hif_napi_get_all(
- struct hif_opaque_softc *hif)
- { return NULL; }
- static inline int hif_napi_event(struct hif_opaque_softc *hif,
- enum qca_napi_event event,
- void *data)
- { return -EPERM; }
- static inline int hif_napi_enabled(struct hif_opaque_softc *hif, int ce)
- { return 0; }
- static inline int hif_ext_napi_enabled(struct hif_opaque_softc *hif, int ce)
- { return 0; }
- static inline void hif_napi_enable_irq(struct hif_opaque_softc *hif, int id)
- { return; }
- static inline int hif_napi_schedule(struct hif_opaque_softc *hif, int ce_id)
- { return 0; }
- static inline int hif_napi_schedule_grp(struct hif_opaque_softc *hif,
- uint32_t grp_id)
- { return 0; }
- static inline int hif_napi_poll(struct napi_struct *napi, int budget)
- { return -EPERM; }
- #endif
- #endif
|