o wl3501: implement some more wireless extensions

Also reorganize wl3501_card struct a bit to avoid wasting some
bytes.

This time get_sense and set_wap wireless extensions were added,
work in progress, ya know 8)
parent 45ed1c5a
...@@ -421,24 +421,25 @@ struct wl3501_card { ...@@ -421,24 +421,25 @@ struct wl3501_card {
u16 esbq_confirm_start; u16 esbq_confirm_start;
u16 esbq_confirm_end; u16 esbq_confirm_end;
u16 esbq_confirm; u16 esbq_confirm;
struct wl3501_mac_addr bssid;
u8 llc_type; u8 llc_type;
int net_type;
u8 essid[34]; u8 essid[34];
u8 keep_essid[34]; struct wl3501_mac_addr bssid;
int ether_type; int ether_type;
int net_type;
u8 keep_essid[34];
u8 chan; u8 chan;
u8 def_chan; u8 def_chan;
u8 cap_info;
u16 start_seg; u16 start_seg;
u16 bss_cnt; u16 bss_cnt;
u16 join_sta_bss; u16 join_sta_bss;
u8 cap_info; unsigned char rssi;
u8 adhoc_times;
int card_start; int card_start;
struct wl3501_scan_confirm bss_set[20]; u8 adhoc_times;
u8 driver_state; u8 driver_state;
u8 freq_domain; u8 freq_domain;
u8 version[2]; u8 version[2];
struct wl3501_scan_confirm bss_set[20];
struct net_device_stats stats; struct net_device_stats stats;
struct iw_statistics wstats; struct iw_statistics wstats;
struct iw_spy_data spy_data; struct iw_spy_data spy_data;
......
...@@ -804,6 +804,7 @@ static void wl3501_mgmt_scan_confirm(struct wl3501_card *this, u16 addr) ...@@ -804,6 +804,7 @@ static void wl3501_mgmt_scan_confirm(struct wl3501_card *this, u16 addr)
&(this->bss_set[i].beacon_period), &(this->bss_set[i].beacon_period),
(char *)&(signal.beacon_period), 73); (char *)&(signal.beacon_period), 73);
this->bss_cnt++; this->bss_cnt++;
this->rssi = signal.rssi;
} }
} }
} else if (signal.status == WL3501_STATUS_TIMEOUT && } else if (signal.status == WL3501_STATUS_TIMEOUT &&
...@@ -1890,6 +1891,17 @@ static int wl3501_get_mode(struct net_device *dev, struct iw_request_info *info, ...@@ -1890,6 +1891,17 @@ static int wl3501_get_mode(struct net_device *dev, struct iw_request_info *info,
return 0; return 0;
} }
static int wl3501_get_sens(struct net_device *dev, struct iw_request_info *info,
union iwreq_data *wrqu, char *extra)
{
struct wl3501_card *this = (struct wl3501_card *)dev->priv;
wrqu->sens.value = this->rssi;
wrqu->sens.disabled = !wrqu->sens.value;
wrqu->sens.fixed = 1;
return 0;
}
static int wl3501_get_range(struct net_device *dev, static int wl3501_get_range(struct net_device *dev,
struct iw_request_info *info, struct iw_request_info *info,
union iwreq_data *wrqu, char *extra) union iwreq_data *wrqu, char *extra)
...@@ -1910,6 +1922,28 @@ static int wl3501_get_range(struct net_device *dev, ...@@ -1910,6 +1922,28 @@ static int wl3501_get_range(struct net_device *dev,
return 0; return 0;
} }
static int wl3501_set_wap(struct net_device *dev, struct iw_request_info *info,
union iwreq_data *wrqu, char *extra)
{
struct wl3501_card *this = (struct wl3501_card *)dev->priv;
static const unsigned char bcast[ETH_ALEN] =
{ 255, 255, 255, 255, 255, 255 };
int rc = -EINVAL;
/* FIXME: we support other ARPHRDs...*/
if (wrqu->ap_addr.sa_family != ARPHRD_ETHER)
goto out;
if (!memcmp(bcast, wrqu->ap_addr.sa_data, ETH_ALEN)) {
/* FIXME: rescan? */
} else {
memcpy(&this->bssid, wrqu->ap_addr.sa_data, ETH_ALEN);
/* FIXME: rescan? deassoc & scan? */
}
rc = 0;
out:
return rc;
}
static int wl3501_get_wap(struct net_device *dev, struct iw_request_info *info, static int wl3501_get_wap(struct net_device *dev, struct iw_request_info *info,
union iwreq_data *wrqu, char *extra) union iwreq_data *wrqu, char *extra)
{ {
...@@ -1952,20 +1986,17 @@ static int wl3501_get_essid(struct net_device *dev, ...@@ -1952,20 +1986,17 @@ static int wl3501_get_essid(struct net_device *dev,
static const iw_handler wl3501_handler[] = { static const iw_handler wl3501_handler[] = {
[SIOCGIWNAME - SIOCSIWCOMMIT] = wl3501_get_name, [SIOCGIWNAME - SIOCSIWCOMMIT] = wl3501_get_name,
//[SIOCSIWNWID - SIOCSIWCOMMIT] = wl3501_set_nwid,
//[SIOCGIWNWID - SIOCSIWCOMMIT] = wl3501_get_nwid,
//[SIOCSIWFREQ - SIOCSIWCOMMIT] = wl3501_set_freq, //[SIOCSIWFREQ - SIOCSIWCOMMIT] = wl3501_set_freq,
//[SIOCGIWFREQ - SIOCSIWCOMMIT] = wl3501_get_freq, //[SIOCGIWFREQ - SIOCSIWCOMMIT] = wl3501_get_freq,
[SIOCSIWMODE - SIOCSIWCOMMIT] = wl3501_set_mode, [SIOCSIWMODE - SIOCSIWCOMMIT] = wl3501_set_mode,
[SIOCGIWMODE - SIOCSIWCOMMIT] = wl3501_get_mode, [SIOCGIWMODE - SIOCSIWCOMMIT] = wl3501_get_mode,
//[SIOCSIWSENS - SIOCSIWCOMMIT] = wl3501_set_sens, [SIOCGIWSENS - SIOCSIWCOMMIT] = wl3501_get_sens,
//[SIOCGIWSENS - SIOCSIWCOMMIT] = wl3501_get_sens,
[SIOCGIWRANGE - SIOCSIWCOMMIT] = wl3501_get_range, [SIOCGIWRANGE - SIOCSIWCOMMIT] = wl3501_get_range,
//[SIOCSIWSPY - SIOCSIWCOMMIT] = iw_handler_set_spy, [SIOCSIWSPY - SIOCSIWCOMMIT] = iw_handler_set_spy,
//[SIOCGIWSPY - SIOCSIWCOMMIT] = iw_handler_get_spy, [SIOCGIWSPY - SIOCSIWCOMMIT] = iw_handler_get_spy,
[SIOCSIWTHRSPY - SIOCSIWCOMMIT] = iw_handler_set_thrspy, [SIOCSIWTHRSPY - SIOCSIWCOMMIT] = iw_handler_set_thrspy,
[SIOCGIWTHRSPY - SIOCSIWCOMMIT] = iw_handler_get_thrspy, [SIOCGIWTHRSPY - SIOCSIWCOMMIT] = iw_handler_get_thrspy,
//[SIOCSIWAP - SIOCSIWCOMMIT] = wl3501_set_wap, [SIOCSIWAP - SIOCSIWCOMMIT] = wl3501_set_wap,
[SIOCGIWAP - SIOCSIWCOMMIT] = wl3501_get_wap, [SIOCGIWAP - SIOCSIWCOMMIT] = wl3501_get_wap,
[SIOCSIWESSID - SIOCSIWCOMMIT] = wl3501_set_essid, [SIOCSIWESSID - SIOCSIWCOMMIT] = wl3501_set_essid,
[SIOCGIWESSID - SIOCSIWCOMMIT] = wl3501_get_essid, [SIOCGIWESSID - SIOCSIWCOMMIT] = wl3501_get_essid,
...@@ -2291,9 +2322,8 @@ static int wl3501_event(event_t event, int pri, event_callback_args_t *args) ...@@ -2291,9 +2322,8 @@ static int wl3501_event(event_t event, int pri, event_callback_args_t *args)
/* Fall through... */ /* Fall through... */
case CS_EVENT_RESET_PHYSICAL: case CS_EVENT_RESET_PHYSICAL:
if (link->state & DEV_CONFIG) { if (link->state & DEV_CONFIG) {
if (link->open) { if (link->open)
netif_stop_queue(dev); netif_stop_queue(dev);
}
CardServices(ReleaseConfiguration, link->handle); CardServices(ReleaseConfiguration, link->handle);
} }
break; break;
......
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