o wl3501: cleanup types

parent 1cdf8ca1
...@@ -206,238 +206,238 @@ enum wl3501_status { ...@@ -206,238 +206,238 @@ enum wl3501_status {
#define WL3501_ESSID_MAX_LEN (IW_ESSID_MAX_SIZE + 2) #define WL3501_ESSID_MAX_LEN (IW_ESSID_MAX_SIZE + 2)
struct wl3501_tx_hdr { struct wl3501_tx_hdr {
u16 tx_cnt; u16 tx_cnt;
unsigned char sync[16]; u8 sync[16];
u16 sfd; u16 sfd;
unsigned char signal; u8 signal;
unsigned char service; u8 service;
u16 len; u16 len;
u16 crc16; u16 crc16;
u16 frame_ctrl; u16 frame_ctrl;
u16 duration_id; u16 duration_id;
unsigned char addr1[ETH_ALEN]; u8 addr1[ETH_ALEN];
unsigned char addr2[ETH_ALEN]; u8 addr2[ETH_ALEN];
unsigned char addr3[ETH_ALEN]; u8 addr3[ETH_ALEN];
u16 seq_ctrl; u16 seq_ctrl;
unsigned char addr4[ETH_ALEN]; u8 addr4[ETH_ALEN];
}; };
struct wl3501_rx_hdr { struct wl3501_rx_hdr {
u16 rx_next_blk; u16 rx_next_blk;
u16 rc_next_frame_blk; u16 rc_next_frame_blk;
unsigned char rx_blk_ctrl; u8 rx_blk_ctrl;
unsigned char rx_next_frame; u8 rx_next_frame;
unsigned char rx_next_frame1; u8 rx_next_frame1;
unsigned char rssi; u8 rssi;
unsigned char time[8]; char time[8];
unsigned char signal; u8 signal;
unsigned char service; u8 service;
u16 len; u16 len;
u16 crc16; u16 crc16;
u16 frame_ctrl; u16 frame_ctrl;
u16 duration; u16 duration;
unsigned char addr1[ETH_ALEN]; u8 addr1[ETH_ALEN];
unsigned char addr2[ETH_ALEN]; u8 addr2[ETH_ALEN];
unsigned char addr3[ETH_ALEN]; u8 addr3[ETH_ALEN];
u16 seq; u16 seq;
unsigned char addr4[ETH_ALEN]; u8 addr4[ETH_ALEN];
}; };
struct wl3501_start_req { struct wl3501_start_req {
u16 next_blk; u16 next_blk;
unsigned char sig_id; u8 sig_id;
unsigned char bss_type; u8 bss_type;
u16 beacon_period; u16 beacon_period;
u16 dtim_period; u16 dtim_period;
u16 probe_delay; u16 probe_delay;
u16 cap_info; u16 cap_info;
unsigned char ssid[WL3501_ESSID_MAX_LEN]; char ssid[WL3501_ESSID_MAX_LEN];
unsigned char bss_basic_rate_set[10]; u8 bss_basic_rate_set[10];
unsigned char operational_rate_set[10]; u8 operational_rate_set[10];
unsigned char cf_pset[8]; u8 cf_pset[8];
unsigned char phy_pset[3]; u8 phy_pset[3];
unsigned char ibss_pset[4]; u8 ibss_pset[4];
}; };
struct wl3501_assoc_req { struct wl3501_assoc_req {
u16 next_blk; u16 next_blk;
unsigned char sig_id; u8 sig_id;
unsigned char reserved; u8 reserved;
u16 timeout; u16 timeout;
u16 cap_info; u16 cap_info;
u16 listen_interval; u16 listen_interval;
unsigned char mac_addr[ETH_ALEN]; u8 mac_addr[ETH_ALEN];
}; };
struct wl3501_assoc_confirm { struct wl3501_assoc_confirm {
u16 next_blk; u16 next_blk;
unsigned char sig_id; u8 sig_id;
unsigned char reserved; u8 reserved;
u16 status; u16 status;
}; };
struct wl3501_assoc_ind { struct wl3501_assoc_ind {
u16 next_blk; u16 next_blk;
unsigned char sig_id; u8 sig_id;
unsigned char mac_addr[ETH_ALEN]; u8 mac_addr[ETH_ALEN];
}; };
struct wl3501_auth_req { struct wl3501_auth_req {
u16 next_blk; u16 next_blk;
unsigned char sig_id; u8 sig_id;
unsigned char reserved; u8 reserved;
u16 type; u16 type;
u16 timeout; u16 timeout;
unsigned char mac_addr[ETH_ALEN]; u8 mac_addr[ETH_ALEN];
}; };
struct wl3501_auth_confirm { struct wl3501_auth_confirm {
u16 next_blk; u16 next_blk;
unsigned char sig_id; u8 sig_id;
unsigned char reserved; u8 reserved;
u16 type; u16 type;
u16 status; u16 status;
unsigned char mac_addr[ETH_ALEN]; u8 mac_addr[ETH_ALEN];
}; };
struct wl3501_get_req { struct wl3501_get_req {
u16 next_blk; u16 next_blk;
unsigned char sig_id; u8 sig_id;
unsigned char reserved; u8 reserved;
u16 mib_attrib; u16 mib_attrib;
}; };
struct wl3501_get_confirm { struct wl3501_get_confirm {
u16 next_blk; u16 next_blk;
unsigned char sig_id; u8 sig_id;
unsigned char reserved; u8 reserved;
u16 mib_status; u16 mib_status;
u16 mib_attrib; u16 mib_attrib;
unsigned char mib_value[100]; u8 mib_value[100];
}; };
struct wl3501_join_req { struct wl3501_join_req {
u16 next_blk; u16 next_blk;
unsigned char sig_id; u8 sig_id;
unsigned char reserved; u8 reserved;
unsigned char operational_rate_set[10]; u8 operational_rate_set[10];
u16 reserved2; u16 reserved2;
u16 timeout; u16 timeout;
u16 probe_delay; u16 probe_delay;
unsigned char timestamp[8]; u8 timestamp[8];
unsigned char local_time[8]; u8 local_time[8];
u16 beacon_period; u16 beacon_period;
u16 dtim_period; u16 dtim_period;
u16 cap_info; u16 cap_info;
unsigned char bss_type; u8 bss_type;
unsigned char bssid[ETH_ALEN]; u8 bssid[ETH_ALEN];
unsigned char ssid[WL3501_ESSID_MAX_LEN]; char ssid[WL3501_ESSID_MAX_LEN];
unsigned char phy_pset[3]; u8 phy_pset[3];
unsigned char cf_pset[8]; u8 cf_pset[8];
unsigned char ibss_pset[4]; u8 ibss_pset[4];
unsigned char bss_basic_rate_set[10]; u8 bss_basic_rate_set[10];
}; };
struct wl3501_join_confirm { struct wl3501_join_confirm {
u16 next_blk; u16 next_blk;
unsigned char sig_id; u8 sig_id;
unsigned char reserved; u8 reserved;
u16 status; u16 status;
}; };
struct wl3501_pwr_mgmt_req { struct wl3501_pwr_mgmt_req {
u16 next_blk; u16 next_blk;
unsigned char sig_id; u8 sig_id;
u8 pwr_save; u8 pwr_save;
u8 wake_up; u8 wake_up;
u8 receive_dtims; u8 receive_dtims;
}; };
struct wl3501_pwr_mgmt_confirm { struct wl3501_pwr_mgmt_confirm {
u16 next_blk; u16 next_blk;
unsigned char sig_id; u8 sig_id;
unsigned char reserved; u8 reserved;
u16 status; u16 status;
}; };
struct wl3501_scan_req { struct wl3501_scan_req {
u16 next_blk; u16 next_blk;
unsigned char sig_id; u8 sig_id;
unsigned char bss_type; u8 bss_type;
u16 probe_delay; u16 probe_delay;
u16 min_chan_time; u16 min_chan_time;
u16 max_chan_time; u16 max_chan_time;
unsigned char chan_list[14]; u8 chan_list[14];
unsigned char bssid[ETH_ALEN]; u8 bssid[ETH_ALEN];
unsigned char ssid[WL3501_ESSID_MAX_LEN]; char ssid[WL3501_ESSID_MAX_LEN];
enum wl3501_scan_type scan_type; enum wl3501_scan_type scan_type;
}; };
struct wl3501_scan_confirm { struct wl3501_scan_confirm {
u16 next_blk; u16 next_blk;
unsigned char sig_id; u8 sig_id;
unsigned char reserved; u8 reserved;
u16 status; u16 status;
unsigned char timestamp[8]; char timestamp[8];
unsigned char localtime[8]; char localtime[8];
u16 beacon_period; u16 beacon_period;
u16 dtim_period; u16 dtim_period;
u16 cap_info; u16 cap_info;
unsigned char bss_type; u8 bss_type;
unsigned char bssid[ETH_ALEN]; u8 bssid[ETH_ALEN];
unsigned char ssid[WL3501_ESSID_MAX_LEN]; char ssid[WL3501_ESSID_MAX_LEN];
unsigned char phy_pset[3]; u8 phy_pset[3];
unsigned char cf_pset[8]; u8 cf_pset[8];
unsigned char ibss_pset[4]; u8 ibss_pset[4];
unsigned char bss_basic_rate_set[10]; u8 bss_basic_rate_set[10];
unsigned char rssi; u8 rssi;
}; };
struct wl3501_start_confirm { struct wl3501_start_confirm {
u16 next_blk; u16 next_blk;
unsigned char sig_id; u8 sig_id;
unsigned char reserved; u8 reserved;
u16 status; u16 status;
}; };
struct wl3501_md_req { struct wl3501_md_req {
u16 next_blk; u16 next_blk;
unsigned char sig_id; u8 sig_id;
unsigned char routing; u8 routing;
u16 data; u16 data;
u16 size; u16 size;
unsigned char pri; u8 pri;
unsigned char service_class; u8 service_class;
unsigned char daddr[ETH_ALEN]; u8 daddr[ETH_ALEN];
unsigned char saddr[ETH_ALEN]; u8 saddr[ETH_ALEN];
}; };
struct wl3501_md_ind { struct wl3501_md_ind {
u16 next_blk; u16 next_blk;
unsigned char sig_id; u8 sig_id;
unsigned char routing; u8 routing;
u16 data; u16 data;
u16 size; u16 size;
unsigned char reception; u8 reception;
unsigned char pri; u8 pri;
unsigned char service_class; u8 service_class;
unsigned char daddr[ETH_ALEN]; u8 daddr[ETH_ALEN];
unsigned char saddr[ETH_ALEN]; u8 saddr[ETH_ALEN];
}; };
struct wl3501_md_confirm { struct wl3501_md_confirm {
u16 next_blk; u16 next_blk;
unsigned char sig_id; u8 sig_id;
unsigned char reserved; u8 reserved;
u16 data; u16 data;
unsigned char status; u8 status;
unsigned char pri; u8 pri;
unsigned char service_class; u8 service_class;
}; };
struct wl3501_resync_req { struct wl3501_resync_req {
u16 next_blk; u16 next_blk;
unsigned char sig_id; u8 sig_id;
}; };
/* Definitions for supporting clone adapters. */ /* Definitions for supporting clone adapters. */
...@@ -511,7 +511,7 @@ struct wl3501_80211_tx_hdr { ...@@ -511,7 +511,7 @@ struct wl3501_80211_tx_hdr {
struct wl3501_card { struct wl3501_card {
int base_addr; int base_addr;
unsigned char mac_addr[ETH_ALEN]; u8 mac_addr[ETH_ALEN];
spinlock_t lock; spinlock_t lock;
wait_queue_head_t wait; wait_queue_head_t wait;
struct wl3501_get_confirm sig_get_confirm; struct wl3501_get_confirm sig_get_confirm;
...@@ -528,18 +528,18 @@ struct wl3501_card { ...@@ -528,18 +528,18 @@ struct wl3501_card {
u16 esbq_confirm_end; u16 esbq_confirm_end;
u16 esbq_confirm; u16 esbq_confirm;
u8 essid[WL3501_ESSID_MAX_LEN]; u8 essid[WL3501_ESSID_MAX_LEN];
unsigned char bssid[ETH_ALEN]; u8 bssid[ETH_ALEN];
int net_type; int net_type;
u8 keep_essid[WL3501_ESSID_MAX_LEN]; u8 keep_essid[WL3501_ESSID_MAX_LEN];
unsigned char nick[32]; char nick[32];
unsigned char card_name[32]; char card_name[32];
unsigned char firmware_date[32]; char firmware_date[32];
u8 chan; u8 chan;
u8 cap_info; u8 cap_info;
u16 start_seg; u16 start_seg;
u16 bss_cnt; u16 bss_cnt;
u16 join_sta_bss; u16 join_sta_bss;
unsigned char rssi; u8 rssi;
u8 adhoc_times; u8 adhoc_times;
u8 reg_domain; u8 reg_domain;
u8 version[2]; u8 version[2];
......
...@@ -523,7 +523,7 @@ static int wl3501_send_pkt(struct wl3501_card *this, u8 *data, u16 len) ...@@ -523,7 +523,7 @@ static int wl3501_send_pkt(struct wl3501_card *this, u8 *data, u16 len)
pdata += 12; pdata += 12;
sig.data = bf; sig.data = bf;
if (((*pdata) * 256 + (*(pdata + 1))) > 1500) { if (((*pdata) * 256 + (*(pdata + 1))) > 1500) {
unsigned char addr4[ETH_ALEN] = { u8 addr4[ETH_ALEN] = {
[0] = 0xAA, [1] = 0xAA, [2] = 0x03, [4] = 0x00, [0] = 0xAA, [1] = 0xAA, [2] = 0x03, [4] = 0x00,
}; };
...@@ -956,7 +956,7 @@ static inline void wl3501_md_ind_interrupt(struct net_device *dev, ...@@ -956,7 +956,7 @@ static inline void wl3501_md_ind_interrupt(struct net_device *dev,
{ {
struct wl3501_md_ind sig; struct wl3501_md_ind sig;
struct sk_buff *skb; struct sk_buff *skb;
unsigned char rssi, addr4[ETH_ALEN]; u8 rssi, addr4[ETH_ALEN];
u16 pkt_len; u16 pkt_len;
wl3501_get_from_wla(this, addr, &sig, sizeof(sig)); wl3501_get_from_wla(this, addr, &sig, sizeof(sig));
...@@ -1662,8 +1662,7 @@ static int wl3501_set_wap(struct net_device *dev, struct iw_request_info *info, ...@@ -1662,8 +1662,7 @@ static int wl3501_set_wap(struct net_device *dev, struct iw_request_info *info,
union iwreq_data *wrqu, char *extra) union iwreq_data *wrqu, char *extra)
{ {
struct wl3501_card *this = dev->priv; struct wl3501_card *this = dev->priv;
static const unsigned char bcast[ETH_ALEN] = static const u8 bcast[ETH_ALEN] = { 255, 255, 255, 255, 255, 255 };
{ 255, 255, 255, 255, 255, 255 };
int rc = -EINVAL; int rc = -EINVAL;
/* FIXME: we support other ARPHRDs...*/ /* FIXME: we support other ARPHRDs...*/
...@@ -1946,29 +1945,29 @@ static dev_link_t *wl3501_attach(void) ...@@ -1946,29 +1945,29 @@ static dev_link_t *wl3501_attach(void)
goto out; goto out;
memset(link, 0, sizeof(struct dev_link_t)); memset(link, 0, sizeof(struct dev_link_t));
init_timer(&link->release); init_timer(&link->release);
link->release.function = wl3501_release; link->release.function = wl3501_release;
link->release.data = (unsigned long)link; link->release.data = (unsigned long)link;
/* The io structure describes IO port mapping */ /* The io structure describes IO port mapping */
link->io.NumPorts1 = 16; link->io.NumPorts1 = 16;
link->io.Attributes1 = IO_DATA_PATH_WIDTH_8; link->io.Attributes1 = IO_DATA_PATH_WIDTH_8;
link->io.IOAddrLines = 5; link->io.IOAddrLines = 5;
/* Interrupt setup */ /* Interrupt setup */
link->irq.Attributes = IRQ_TYPE_EXCLUSIVE | IRQ_HANDLE_PRESENT; link->irq.Attributes = IRQ_TYPE_EXCLUSIVE | IRQ_HANDLE_PRESENT;
link->irq.IRQInfo1 = IRQ_INFO2_VALID | IRQ_LEVEL_ID; link->irq.IRQInfo1 = IRQ_INFO2_VALID | IRQ_LEVEL_ID;
link->irq.IRQInfo2 = wl3501_irq_mask; link->irq.IRQInfo2 = wl3501_irq_mask;
if (wl3501_irq_list[0] != -1) if (wl3501_irq_list[0] != -1)
for (i = 0; i < 4; i++) for (i = 0; i < 4; i++)
link->irq.IRQInfo2 |= 1 << wl3501_irq_list[i]; link->irq.IRQInfo2 |= 1 << wl3501_irq_list[i];
link->irq.Handler = wl3501_interrupt; link->irq.Handler = wl3501_interrupt;
/* General socket configuration */ /* General socket configuration */
link->conf.Attributes = CONF_ENABLE_IRQ; link->conf.Attributes = CONF_ENABLE_IRQ;
link->conf.Vcc = 50; link->conf.Vcc = 50;
link->conf.IntType = INT_MEMORY_AND_IO; link->conf.IntType = INT_MEMORY_AND_IO;
link->conf.ConfigIndex = 1; link->conf.ConfigIndex = 1;
link->conf.Present = PRESENT_OPTION; link->conf.Present = PRESENT_OPTION;
dev = alloc_etherdev(sizeof(struct wl3501_card)); dev = alloc_etherdev(sizeof(struct wl3501_card));
if (!dev) if (!dev)
...@@ -1987,16 +1986,18 @@ static dev_link_t *wl3501_attach(void) ...@@ -1987,16 +1986,18 @@ static dev_link_t *wl3501_attach(void)
link->priv = link->irq.Instance = dev; link->priv = link->irq.Instance = dev;
/* Register with Card Services */ /* Register with Card Services */
link->next = wl3501_dev_list; link->next = wl3501_dev_list;
wl3501_dev_list = link; wl3501_dev_list = link;
client_reg.dev_info = &wl3501_dev_info; client_reg.dev_info = &wl3501_dev_info;
client_reg.Attributes = INFO_IO_CLIENT | INFO_CARD_SHARE; client_reg.Attributes = INFO_IO_CLIENT | INFO_CARD_SHARE;
client_reg.EventMask = CS_EVENT_CARD_INSERTION | client_reg.EventMask = CS_EVENT_CARD_INSERTION |
CS_EVENT_RESET_PHYSICAL | CS_EVENT_RESET_PHYSICAL |
CS_EVENT_CARD_RESET | CS_EVENT_CARD_REMOVAL | CS_EVENT_CARD_RESET |
CS_EVENT_PM_SUSPEND | CS_EVENT_PM_RESUME; CS_EVENT_CARD_REMOVAL |
CS_EVENT_PM_SUSPEND |
CS_EVENT_PM_RESUME;
client_reg.event_handler = wl3501_event; client_reg.event_handler = wl3501_event;
client_reg.Version = 0x0210; client_reg.Version = 0x0210;
client_reg.event_callback_args.client_data = link; client_reg.event_callback_args.client_data = link;
ret = CardServices(RegisterClient, &link->handle, &client_reg); ret = CardServices(RegisterClient, &link->handle, &client_reg);
if (ret) { if (ret) {
...@@ -2030,20 +2031,20 @@ static void wl3501_config(dev_link_t *link) ...@@ -2030,20 +2031,20 @@ static void wl3501_config(dev_link_t *link)
client_handle_t handle = link->handle; client_handle_t handle = link->handle;
struct net_device *dev = link->priv; struct net_device *dev = link->priv;
int i = 0, j, last_fn, last_ret; int i = 0, j, last_fn, last_ret;
unsigned char buf[64]; unsigned char bf[64];
struct wl3501_card *this; struct wl3501_card *this;
/* This reads the card's CONFIG tuple to find its config registers. */ /* This reads the card's CONFIG tuple to find its config registers. */
tuple.Attributes = 0; tuple.Attributes = 0;
tuple.DesiredTuple = CISTPL_CONFIG; tuple.DesiredTuple = CISTPL_CONFIG;
CS_CHECK(GetFirstTuple, handle, &tuple); CS_CHECK(GetFirstTuple, handle, &tuple);
tuple.TupleData = buf; tuple.TupleData = bf;
tuple.TupleDataMax = 64; tuple.TupleDataMax = sizeof(bf);
tuple.TupleOffset = 0; tuple.TupleOffset = 0;
CS_CHECK(GetTupleData, handle, &tuple); CS_CHECK(GetTupleData, handle, &tuple);
CS_CHECK(ParseTuple, handle, &tuple, &parse); CS_CHECK(ParseTuple, handle, &tuple, &parse);
link->conf.ConfigBase = parse.config.base; link->conf.ConfigBase = parse.config.base;
link->conf.Present = parse.config.rmask[0]; link->conf.Present = parse.config.rmask[0];
/* Configure card */ /* Configure card */
link->state |= DEV_CONFIG; link->state |= DEV_CONFIG;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment