// Xianjun jiao. putaoshu@msn.com; xianjun.jiao@imec.be #ifndef OPENWIFI_SDR #define OPENWIFI_SDR // -------------------for leds-------------------------------- struct gpio_led_data { //pleas always align with the leds-gpio.c in linux kernel struct led_classdev cdev; struct gpio_desc *gpiod; u8 can_sleep; u8 blinking; gpio_blink_set_t platform_gpio_blink_set; }; struct gpio_leds_priv { //pleas always align with the leds-gpio.c in linux kernel int num_leds; struct gpio_led_data leds[]; }; struct openwifi_rf_ops { char *name; // void (*init)(struct ieee80211_hw *); // void (*stop)(struct ieee80211_hw *); void (*set_chan)(struct ieee80211_hw *, struct ieee80211_conf *); // u8 (*calc_rssi)(u8 agc, u8 sq); }; struct openwifi_buffer_descriptor { u32 num_dma_byte; u32 sn; u32 hw_queue_idx; u32 retry_limit; u32 need_ack; struct sk_buff *skb_linked; dma_addr_t dma_mapping_addr; u32 reserved; } __packed; struct openwifi_ring { struct openwifi_buffer_descriptor *bds; u32 bd_wr_idx; u32 bd_rd_idx; u32 reserved; } __packed; struct openwifi_vif { struct ieee80211_hw *dev; int idx; // this vif's idx on the dev /* beaconing */ struct delayed_work beacon_work; bool enable_beacon; }; union u32_byte4 { u32 a; u8 c[4]; }; union u16_byte2 { u16 a; u8 c[2]; }; #define MAX_NUM_DRV_REG 32 #define MAX_NUM_LED 4 #define OPENWIFI_LED_MAX_NAME_LEN 32 #define MAX_NUM_VIF 4 #define LEN_PHY_HEADER 16 #define LEN_PHY_CRC 4 #define NUM_TX_BD 32 #define NUM_RX_BD 16 #define TX_BD_BUF_SIZE (8192) #define RX_BD_BUF_SIZE (8192) #define NUM_BIT_MAX_NUM_HW_QUEUE 2 #define MAX_NUM_HW_QUEUE 2 #define NUM_BIT_MAX_PHY_TX_SN 12 #define MAX_PHY_TX_SN ((1<