libertas: sort variables in struct lbs_private

Having the variables in logical groups allows us to easier
#ifdef stuff out.

No functional change.

Signed-off-by: John W. Linville <linville@tuxdriver.com>
This commit is contained in:
Holger Schurig 2009-10-22 15:30:49 +02:00 committed by John W. Linville
parent 2d46502dce
commit 5e04769224

View File

@ -35,113 +35,96 @@ struct lbs_mesh_stats {
/** Private structure for the MV device */ /** Private structure for the MV device */
struct lbs_private { struct lbs_private {
/* Basic networking */
struct net_device *dev;
u32 connect_status;
int infra_open;
struct work_struct mcast_work;
u32 nr_of_multicastmacaddr;
u8 multicastlist[MRVDRV_MAX_MULTICAST_LIST_SIZE][ETH_ALEN];
/* CFG80211 */
struct wireless_dev *wdev; struct wireless_dev *wdev;
/* Mesh */
struct net_device *mesh_dev; /* Virtual device */
u32 mesh_connect_status;
struct lbs_mesh_stats mstats;
int mesh_open; int mesh_open;
int mesh_fw_ver; int mesh_fw_ver;
int infra_open;
int mesh_autostart_enabled; int mesh_autostart_enabled;
uint16_t mesh_tlv;
u8 mesh_ssid[IEEE80211_MAX_SSID_LEN + 1];
u8 mesh_ssid_len;
struct work_struct sync_channel;
char name[DEV_NAME_LEN]; /* Monitor mode */
void *card;
struct net_device *dev;
struct net_device *mesh_dev; /* Virtual device */
struct net_device *rtap_net_dev; struct net_device *rtap_net_dev;
u32 monitormode;
struct iw_statistics wstats; /* Debugfs */
struct lbs_mesh_stats mstats;
struct dentry *debugfs_dir; struct dentry *debugfs_dir;
struct dentry *debugfs_debug; struct dentry *debugfs_debug;
struct dentry *debugfs_files[6]; struct dentry *debugfs_files[6];
struct dentry *events_dir; struct dentry *events_dir;
struct dentry *debugfs_events_files[6]; struct dentry *debugfs_events_files[6];
struct dentry *regs_dir; struct dentry *regs_dir;
struct dentry *debugfs_regs_files[6]; struct dentry *debugfs_regs_files[6];
/* Hardware debugging */
u32 mac_offset; u32 mac_offset;
u32 bbp_offset; u32 bbp_offset;
u32 rf_offset; u32 rf_offset;
struct lbs_offset_value offsetvalue;
/** Deep sleep flag */ /* Power management */
u16 psmode;
u32 psstate;
u8 needtowakeup;
/* Deep sleep */
int is_deep_sleep; int is_deep_sleep;
/** Auto deep sleep enabled flag */
int is_auto_deep_sleep_enabled; int is_auto_deep_sleep_enabled;
/** Device wakeup required flag */
int wakeup_dev_required; int wakeup_dev_required;
/** Auto deep sleep flag*/
int is_activity_detected; int is_activity_detected;
/** Auto deep sleep timeout (in miliseconds) */ int auto_deep_sleep_timeout; /* in ms */
int auto_deep_sleep_timeout;
/** Deep sleep wait queue */
wait_queue_head_t ds_awake_q; wait_queue_head_t ds_awake_q;
struct timer_list auto_deepsleep_timer;
/* Download sent: /* Hardware access */
bit0 1/0=data_sent/data_tx_done, void *card;
bit1 1/0=cmd_sent/cmd_tx_done, u8 fw_ready;
all other bits reserved 0 */ u8 surpriseremoved;
u8 dnld_sent;
/** thread to service interrupts */
struct task_struct *main_thread;
wait_queue_head_t waitq;
struct workqueue_struct *work_thread;
struct work_struct mcast_work;
/** Scanning */
struct delayed_work scan_work;
struct delayed_work assoc_work;
struct work_struct sync_channel;
/* remember which channel was scanned last, != 0 if currently scanning */
int scan_channel;
u8 scan_ssid[IEEE80211_MAX_SSID_LEN + 1];
u8 scan_ssid_len;
/** Hardware access */
int (*hw_host_to_card) (struct lbs_private *priv, u8 type, u8 *payload, u16 nb); int (*hw_host_to_card) (struct lbs_private *priv, u8 type, u8 *payload, u16 nb);
void (*reset_card) (struct lbs_private *priv); void (*reset_card) (struct lbs_private *priv);
int (*enter_deep_sleep) (struct lbs_private *priv); int (*enter_deep_sleep) (struct lbs_private *priv);
int (*exit_deep_sleep) (struct lbs_private *priv); int (*exit_deep_sleep) (struct lbs_private *priv);
int (*reset_deep_sleep_wakeup) (struct lbs_private *priv); int (*reset_deep_sleep_wakeup) (struct lbs_private *priv);
/* Wake On LAN */ /* Adapter info (from EEPROM) */
uint32_t wol_criteria;
uint8_t wol_gpio;
uint8_t wol_gap;
/** Wlan adapter data structure*/
/** STATUS variables */
u32 fwrelease; u32 fwrelease;
u32 fwcapinfo; u32 fwcapinfo;
u16 regioncode;
u8 current_addr[ETH_ALEN];
struct mutex lock; /* Command download */
u8 dnld_sent;
/* TX packet ready to be sent... */ /* bit0 1/0=data_sent/data_tx_done,
int tx_pending_len; /* -1 while building packet */ bit1 1/0=cmd_sent/cmd_tx_done,
all other bits reserved 0 */
u8 tx_pending_buf[LBS_UPLD_SIZE];
/* protected by hard_start_xmit serialization */
/** command-related variables */
u16 seqnum; u16 seqnum;
struct cmd_ctrl_node *cmd_array; struct cmd_ctrl_node *cmd_array;
/** Current command */
struct cmd_ctrl_node *cur_cmd; struct cmd_ctrl_node *cur_cmd;
int cur_cmd_retcode; struct list_head cmdfreeq; /* free command buffers */
/** command Queues */ struct list_head cmdpendingq; /* pending command buffers */
/** Free command buffers */
struct list_head cmdfreeq;
/** Pending command buffers */
struct list_head cmdpendingq;
wait_queue_head_t cmd_pending; wait_queue_head_t cmd_pending;
struct timer_list command_timer;
int nr_retries;
int cmd_timed_out;
/* Command responses sent from the hardware to the driver */ /* Command responses sent from the hardware to the driver */
int cur_cmd_retcode;
u8 resp_idx; u8 resp_idx;
u8 resp_buf[2][LBS_UPLD_SIZE]; u8 resp_buf[2][LBS_UPLD_SIZE];
u32 resp_len[2]; u32 resp_len[2];
@ -149,90 +132,75 @@ struct lbs_private {
/* Events sent from hardware to driver */ /* Events sent from hardware to driver */
struct kfifo *event_fifo; struct kfifo *event_fifo;
/* nickname */ /** thread to service interrupts */
u8 nodename[16]; struct task_struct *main_thread;
wait_queue_head_t waitq;
struct workqueue_struct *work_thread;
/** spin locks */ /** Encryption stuff */
spinlock_t driver_lock; struct lbs_802_11_security secinfo;
struct enc_key wpa_mcast_key;
struct enc_key wpa_unicast_key;
u8 wpa_ie[MAX_WPA_IE_LEN];
u8 wpa_ie_len;
u16 wep_tx_keyidx;
struct enc_key wep_keys[4];
/** Timers */ /* Wake On LAN */
struct timer_list command_timer; uint32_t wol_criteria;
struct timer_list auto_deepsleep_timer; uint8_t wol_gpio;
int nr_retries; uint8_t wol_gap;
int cmd_timed_out;
/** current ssid/bssid related parameters*/
struct current_bss_params curbssparams;
uint16_t mesh_tlv;
u8 mesh_ssid[IEEE80211_MAX_SSID_LEN + 1];
u8 mesh_ssid_len;
/* IW_MODE_* */
u8 mode;
/* Scan results list */
struct list_head network_list;
struct list_head network_free_list;
struct bss_descriptor *networks;
u16 beacon_period;
u8 beacon_enable;
u8 adhoccreate;
/** capability Info used in Association, start, join */
u16 capability;
/** MAC address information */
u8 current_addr[ETH_ALEN];
u8 multicastlist[MRVDRV_MAX_MULTICAST_LIST_SIZE][ETH_ALEN];
u32 nr_of_multicastmacaddr;
/** 802.11 statistics */
// struct cmd_DS_802_11_GET_STAT wlan802_11Stat;
uint16_t enablehwauto;
uint16_t ratebitmap;
/* Transmitting */
int tx_pending_len; /* -1 while building packet */
u8 tx_pending_buf[LBS_UPLD_SIZE];
/* protected by hard_start_xmit serialization */
u8 txretrycount; u8 txretrycount;
/** Tx-related variables (for single packet tx) */
struct sk_buff *currenttxskb; struct sk_buff *currenttxskb;
/** NIC Operation characteristics */ /* Locks */
struct mutex lock;
spinlock_t driver_lock;
/* NIC/link operation characteristics */
u16 mac_control; u16 mac_control;
u32 connect_status; u8 radio_on;
u32 mesh_connect_status;
u16 regioncode;
s16 txpower_cur; s16 txpower_cur;
s16 txpower_min; s16 txpower_min;
s16 txpower_max; s16 txpower_max;
/** POWER MANAGEMENT AND PnP SUPPORT */ /** Scanning */
u8 surpriseremoved; struct delayed_work scan_work;
int scan_channel;
u16 psmode; /* Wlan802_11PowermodeCAM=disable /* remember which channel was scanned last, != 0 if currently scanning */
Wlan802_11PowermodeMAX_PSP=enable */ u8 scan_ssid[IEEE80211_MAX_SSID_LEN + 1];
u32 psstate; u8 scan_ssid_len;
u8 needtowakeup;
/* Associating */
struct delayed_work assoc_work;
struct current_bss_params curbssparams;
u8 mode;
struct list_head network_list;
struct list_head network_free_list;
struct bss_descriptor *networks;
struct assoc_request * pending_assoc_req; struct assoc_request * pending_assoc_req;
struct assoc_request * in_progress_assoc_req; struct assoc_request * in_progress_assoc_req;
u16 capability;
uint16_t enablehwauto;
uint16_t ratebitmap;
/** Encryption parameter */ /* ADHOC */
struct lbs_802_11_security secinfo; u16 beacon_period;
u8 beacon_enable;
u8 adhoccreate;
/** WEP keys */ /* WEXT */
struct enc_key wep_keys[4]; char name[DEV_NAME_LEN];
u16 wep_tx_keyidx; u8 nodename[16];
struct iw_statistics wstats;
/** WPA keys */ u8 cur_rate;
struct enc_key wpa_mcast_key; #define MAX_REGION_CHANNEL_NUM 2
struct enc_key wpa_unicast_key; struct region_channel region_channel[MAX_REGION_CHANNEL_NUM];
/** WPA Information Elements*/
u8 wpa_ie[MAX_WPA_IE_LEN];
u8 wpa_ie_len;
/** Requested Signal Strength*/ /** Requested Signal Strength*/
u16 SNR[MAX_TYPE_B][MAX_TYPE_AVG]; u16 SNR[MAX_TYPE_B][MAX_TYPE_AVG];
@ -242,23 +210,6 @@ struct lbs_private {
u8 rawNF[DEFAULT_DATA_AVG_FACTOR]; u8 rawNF[DEFAULT_DATA_AVG_FACTOR];
u16 nextSNRNF; u16 nextSNRNF;
u16 numSNRNF; u16 numSNRNF;
u8 radio_on;
/** data rate stuff */
u8 cur_rate;
/** RF calibration data */
#define MAX_REGION_CHANNEL_NUM 2
/** region channel data */
struct region_channel region_channel[MAX_REGION_CHANNEL_NUM];
/** MISCELLANEOUS */
struct lbs_offset_value offsetvalue;
u32 monitormode;
u8 fw_ready;
}; };
extern struct cmd_confirm_sleep confirm_sleep; extern struct cmd_confirm_sleep confirm_sleep;