diff options
author | Jeff Garzik <jeff@garzik.org> | 2007-06-12 22:27:30 -0400 |
---|---|---|
committer | Jeff Garzik <jeff@garzik.org> | 2007-06-12 22:27:30 -0400 |
commit | 12b90de64f38226e1e095c55b533f0f4d4f0f572 (patch) | |
tree | 9955197d842511064a1eff6db815fe56cd8f0eb3 | |
parent | 6f8a7c66e2dc8080950d28edc0259f37739aead9 (diff) | |
parent | 717c9339202a42ae7bec7d3c4b84deecdcae9f81 (diff) |
Merge branch 'libertas' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-2.6 into upstream-fixes
34 files changed, 3679 insertions, 3647 deletions
diff --git a/drivers/net/wireless/Kconfig b/drivers/net/wireless/Kconfig index e3f5bb0fe60..fa2399cbd5c 100644 --- a/drivers/net/wireless/Kconfig +++ b/drivers/net/wireless/Kconfig @@ -266,16 +266,23 @@ config IPW2200_DEBUG If you are not sure, say N here. -config LIBERTAS_USB - tristate "Marvell Libertas 8388 802.11a/b/g cards" - depends on USB && WLAN_80211 +config LIBERTAS + tristate "Marvell 8xxx Libertas WLAN driver support" + depends on WLAN_80211 + select IEEE80211 select FW_LOADER ---help--- + A library for Marvell Libertas 8xxx devices. + +config LIBERTAS_USB + tristate "Marvell Libertas 8388 USB 802.11b/g cards" + depends on LIBERTAS && USB + ---help--- A driver for Marvell Libertas 8388 USB devices. -config LIBERTAS_USB_DEBUG - bool "Enable full debugging output in the Libertas USB module." - depends on LIBERTAS_USB +config LIBERTAS_DEBUG + bool "Enable full debugging output in the Libertas module." + depends on LIBERTAS ---help--- Debugging support. diff --git a/drivers/net/wireless/libertas/11d.c b/drivers/net/wireless/libertas/11d.c index e0ecc4d483b..4cf0ff7b833 100644 --- a/drivers/net/wireless/libertas/11d.c +++ b/drivers/net/wireless/libertas/11d.c @@ -95,7 +95,7 @@ static u8 wlan_get_chan_11d(u8 band, u8 firstchan, u8 nrchan, u8 * chan) for (i = 0; i < cfp_no; i++) { if ((cfp + i)->channel == firstchan) { - lbs_pr_debug(1, "firstchan found\n"); + lbs_deb_11d("firstchan found\n"); break; } } @@ -129,12 +129,12 @@ static u8 wlan_channel_known_11d(u8 chan, for (i = 0; i < nr_chan; i++) { if (chan == chanpwr[i].chan) { - lbs_pr_debug(1, "11D: Found Chan:%d\n", chan); + lbs_deb_11d("11D: Found Chan:%d\n", chan); return 1; } } - lbs_pr_debug(1, "11D: Not Find Chan:%d\n", chan); + lbs_deb_11d("11D: Not Find Chan:%d\n", chan); return 0; } @@ -174,7 +174,7 @@ static int generate_domain_info_11d(struct parsed_region_chan_11d memcpy(domaininfo->countrycode, parsed_region_chan->countrycode, COUNTRY_CODE_LEN); - lbs_pr_debug(1, "11D:nrchan=%d\n", nr_chan); + lbs_deb_11d("11D:nrchan=%d\n", nr_chan); lbs_dbg_hex("11D:parsed_region_chan:", (char *)parsed_region_chan, sizeof(struct parsed_region_chan_11d)); @@ -212,7 +212,7 @@ static int generate_domain_info_11d(struct parsed_region_chan_11d } domaininfo->nr_subband = nr_subband; - lbs_pr_debug(1, "nr_subband=%x\n", domaininfo->nr_subband); + lbs_deb_11d("nr_subband=%x\n", domaininfo->nr_subband); lbs_dbg_hex("11D:domaininfo:", (char *)domaininfo, COUNTRY_CODE_LEN + 1 + sizeof(struct ieeetypes_subbandset) * nr_subband); @@ -233,13 +233,13 @@ static void wlan_generate_parsed_region_chan_11d(struct region_channel * region_ struct chan_freq_power *cfp; if (region_chan == NULL) { - lbs_pr_debug(1, "11D: region_chan is NULL\n"); + lbs_deb_11d("11D: region_chan is NULL\n"); return; } cfp = region_chan->CFP; if (cfp == NULL) { - lbs_pr_debug(1, "11D: cfp equal NULL \n"); + lbs_deb_11d("11D: cfp equal NULL \n"); return; } @@ -248,19 +248,19 @@ static void wlan_generate_parsed_region_chan_11d(struct region_channel * region_ memcpy(parsed_region_chan->countrycode, wlan_code_2_region(region_chan->region), COUNTRY_CODE_LEN); - lbs_pr_debug(1, "11D: region[0x%x] band[%d]\n", parsed_region_chan->region, + lbs_deb_11d("11D: region[0x%x] band[%d]\n", parsed_region_chan->region, parsed_region_chan->band); for (i = 0; i < region_chan->nrcfp; i++, cfp++) { parsed_region_chan->chanpwr[i].chan = cfp->channel; parsed_region_chan->chanpwr[i].pwr = cfp->maxtxpower; - lbs_pr_debug(1, "11D: Chan[%d] Pwr[%d]\n", + lbs_deb_11d("11D: Chan[%d] Pwr[%d]\n", parsed_region_chan->chanpwr[i].chan, parsed_region_chan->chanpwr[i].pwr); } parsed_region_chan->nr_chan = region_chan->nrcfp; - lbs_pr_debug(1, "11D: nrchan[%d]\n", parsed_region_chan->nr_chan); + lbs_deb_11d("11D: nrchan[%d]\n", parsed_region_chan->nr_chan); return; } @@ -277,8 +277,9 @@ static u8 wlan_region_chan_supported_11d(u8 region, u8 band, u8 chan) struct chan_freq_power *cfp; int cfp_no; u8 idx; + int ret = 0; - ENTER(); + lbs_deb_enter(LBS_DEB_11D); cfp = libertas_get_region_cfp_table(region, band, &cfp_no); if (cfp == NULL) @@ -288,16 +289,19 @@ static u8 wlan_region_chan_supported_11d(u8 region, u8 band, u8 chan) if (chan == (cfp + idx)->channel) { /* If Mrvl Chip Supported? */ if ((cfp + idx)->unsupported) { - return 0; + ret = 0; } else { - return 1; + ret = 1; } + goto done; } } /*chan is not in the region table */ - LEAVE(); - return 0; + +done: + lbs_deb_leave_args(LBS_DEB_11D, "ret %d", ret); + return ret; } /** @@ -321,7 +325,7 @@ static int parse_domain_info_11d(struct ieeetypes_countryinfofullset* u8 j, i; - ENTER(); + lbs_deb_enter(LBS_DEB_11D); /*validation Rules: 1. valid region Code @@ -337,15 +341,14 @@ static int parse_domain_info_11d(struct ieeetypes_countryinfofullset* if ((*(countryinfo->countrycode)) == 0 || (countryinfo->len <= COUNTRY_CODE_LEN)) { /* No region Info or Wrong region info: treat as No 11D info */ - LEAVE(); - return 0; + goto done; } /*Step1: check region_code */ parsed_region_chan->region = region = wlan_region_2_code(countryinfo->countrycode); - lbs_pr_debug(1, "regioncode=%x\n", (u8) parsed_region_chan->region); + lbs_deb_11d("regioncode=%x\n", (u8) parsed_region_chan->region); lbs_dbg_hex("CountryCode:", (char *)countryinfo->countrycode, COUNTRY_CODE_LEN); @@ -361,7 +364,7 @@ static int parse_domain_info_11d(struct ieeetypes_countryinfofullset* if (countryinfo->subband[j].firstchan <= lastchan) { /*Step2&3. Check First Chan Num increment and no overlap */ - lbs_pr_debug(1, "11D: Chan[%d>%d] Overlap\n", + lbs_deb_11d("11D: Chan[%d>%d] Overlap\n", countryinfo->subband[j].firstchan, lastchan); continue; } @@ -374,7 +377,7 @@ static int parse_domain_info_11d(struct ieeetypes_countryinfofullset* if (!wlan_get_chan_11d(band, firstchan, i, &curchan)) { /* Chan is not found in UN table */ - lbs_pr_debug(1, "chan is not supported: %d \n", i); + lbs_deb_11d("chan is not supported: %d \n", i); break; } @@ -389,7 +392,7 @@ static int parse_domain_info_11d(struct ieeetypes_countryinfofullset* idx++; } else { /*not supported and ignore the chan */ - lbs_pr_debug(1, + lbs_deb_11d( "11D:i[%d] chan[%d] unsupported in region[%x] band[%d]\n", i, curchan, region, band); } @@ -401,11 +404,12 @@ static int parse_domain_info_11d(struct ieeetypes_countryinfofullset* parsed_region_chan->nr_chan = idx; - lbs_pr_debug(1, "nrchan=%x\n", parsed_region_chan->nr_chan); + lbs_deb_11d("nrchan=%x\n", parsed_region_chan->nr_chan); lbs_dbg_hex("11D:parsed_region_chan:", (u8 *) parsed_region_chan, 2 + COUNTRY_CODE_LEN + sizeof(struct parsed_region_chan_11d) * idx); - LEAVE(); +done: + lbs_deb_enter(LBS_DEB_11D); return 0; } @@ -420,16 +424,16 @@ u8 libertas_get_scan_type_11d(u8 chan, { u8 scan_type = cmd_scan_type_passive; - ENTER(); + lbs_deb_enter(LBS_DEB_11D); if (wlan_channel_known_11d(chan, parsed_region_chan)) { - lbs_pr_debug(1, "11D: Found and do Active Scan\n"); + lbs_deb_11d("11D: Found and do Active Scan\n"); scan_type = cmd_scan_type_active; } else { - lbs_pr_debug(1, "11D: Not Find and do Passive Scan\n"); + lbs_deb_11d("11D: Not Find and do Passive Scan\n"); } - LEAVE(); + lbs_deb_leave_args(LBS_DEB_11D, "ret scan_type %d", scan_type); return scan_type; } @@ -456,7 +460,7 @@ static int wlan_enable_11d(wlan_private * priv, u8 flag) OID_802_11D_ENABLE, &priv->adapter->enable11d); if (ret) - lbs_pr_debug(1, "11D: Fail to enable 11D \n"); + lbs_deb_11d("11D: Fail to enable 11D \n"); return 0; } @@ -471,7 +475,7 @@ static int set_domain_info_11d(wlan_private * priv) int ret; if (!priv->adapter->enable11d) { - lbs_pr_debug(1, "11D: dnld domain Info with 11d disabled\n"); + lbs_deb_11d("11D: dnld domain Info with 11d disabled\n"); return 0; } @@ -479,7 +483,7 @@ static int set_domain_info_11d(wlan_private * priv) cmd_act_set, cmd_option_waitforrsp, 0, NULL); if (ret) - lbs_pr_debug(1, "11D: Fail to dnld domain Info\n"); + lbs_deb_11d("11D: Fail to dnld domain Info\n"); return ret; } @@ -501,7 +505,7 @@ int libertas_set_universaltable(wlan_private * priv, u8 band) adapter->universal_channel[i].nrcfp = sizeof(channel_freq_power_UN_BG) / size; - lbs_pr_debug(1, "11D: BG-band nrcfp=%d\n", + lbs_deb_11d("11D: BG-band nrcfp=%d\n", adapter->universal_channel[i].nrcfp); adapter->universal_channel[i].CFP = channel_freq_power_UN_BG; @@ -531,9 +535,9 @@ int libertas_cmd_802_11d_domain_info(wlan_private * priv, wlan_adapter *adapter = priv->adapter; u8 nr_subband = adapter->domainreg.nr_subband; - ENTER(); + lbs_deb_enter(LBS_DEB_11D); - lbs_pr_debug(1, "nr_subband=%x\n", nr_subband); + lbs_deb_11d("nr_subband=%x\n", nr_subband); cmd->command = cpu_to_le16(cmdno); pdomaininfo->action = cpu_to_le16(cmdoption); @@ -542,8 +546,7 @@ int libertas_cmd_802_11d_domain_info(wlan_private * priv, cpu_to_le16(sizeof(pdomaininfo->action) + S_DS_GEN); lbs_dbg_hex("11D: 802_11D_DOMAIN_INFO:", (u8 *) cmd, (int)(cmd->size)); - LEAVE(); - return 0; + goto done; } domain->header.type = cpu_to_le16(TLV_TYPE_DOMAIN); @@ -567,10 +570,10 @@ int libertas_cmd_802_11d_domain_info(wlan_private * priv, cpu_to_le16(sizeof(pdomaininfo->action) + S_DS_GEN); } - lbs_dbg_hex("11D:802_11D_DOMAIN_INFO:", (u8 *) cmd, (int)(cmd->size)); - - LEAVE(); + lbs_dbg_hex("11D:802_11D_DOMAIN_INFO:", (u8 *) cmd, le16_to_cpu(cmd->size)); +done: + lbs_deb_enter(LBS_DEB_11D); return 0; } @@ -585,17 +588,17 @@ int libertas_cmd_enable_11d(wlan_private * priv, struct iwreq *wrq) int data = 0; int *val; - ENTER(); + lbs_deb_enter(LBS_DEB_11D); data = SUBCMD_DATA(wrq); - lbs_pr_debug(1, "enable 11D: %s\n", + lbs_deb_11d("enable 11D: %s\n", (data == 1) ? "enable" : "Disable"); wlan_enable_11d(priv, data); val = (int *)wrq->u.name; *val = priv->adapter->enable11d; - LEAVE(); + lbs_deb_enter(LBS_DEB_11D); return 0; } @@ -608,25 +611,24 @@ int libertas_cmd_enable_11d(wlan_private * priv, struct iwreq *wrq) int libertas_ret_802_11d_domain_info(wlan_private * priv, struct cmd_ds_command *resp) { - struct cmd_ds_802_11d_domain_info - *domaininfo = &resp->params.domaininforesp; + struct cmd_ds_802_11d_domain_info *domaininfo = &resp->params.domaininforesp; struct mrvlietypes_domainparamset *domain = &domaininfo->domain; u16 action = le16_to_cpu(domaininfo->action); s16 ret = 0; u8 nr_subband = 0; - ENTER(); + lbs_deb_enter(LBS_DEB_11D); lbs_dbg_hex("11D DOMAIN Info Rsp Data:", (u8 *) resp, (int)le16_to_cpu(resp->size)); - nr_subband = (domain->header.len - 3) / sizeof(struct ieeetypes_subbandset); - /* countrycode 3 bytes */ + nr_subband = (le16_to_cpu(domain->header.len) - COUNTRY_CODE_LEN) / + sizeof(struct ieeetypes_subbandset); - lbs_pr_debug(1, "11D Domain Info Resp: nr_subband=%d\n", nr_subband); + lbs_deb_11d("11D Domain Info Resp: nr_subband=%d\n", nr_subband); if (nr_subband > MRVDRV_MAX_SUBBAND_802_11D) { - lbs_pr_debug(1, "Invalid Numrer of Subband returned!!\n"); + lbs_deb_11d("Invalid Numrer of Subband returned!!\n"); return -1; } @@ -637,12 +639,12 @@ int libertas_ret_802_11d_domain_info(wlan_private * priv, case cmd_act_get: break; default: - lbs_pr_debug(1, "Invalid action:%d\n", domaininfo->action); + lbs_deb_11d("Invalid action:%d\n", domaininfo->action); ret = -1; break; } - LEAVE(); + lbs_deb_leave_args(LBS_DEB_11D, "ret %d", ret); return ret; } @@ -651,23 +653,22 @@ int libertas_ret_802_11d_domain_info(wlan_private * priv, * @param priv pointer to wlan_private * @return 0; -1 */ -int libertas_parse_dnld_countryinfo_11d(wlan_private * priv) +int libertas_parse_dnld_countryinfo_11d(wlan_private * priv, + struct bss_descriptor * bss) { int ret; wlan_adapter *adapter = priv->adapter; - ENTER(); + lbs_deb_enter(LBS_DEB_11D); if (priv->adapter->enable11d) { memset(&adapter->parsed_region_chan, 0, sizeof(struct parsed_region_chan_11d)); - ret = parse_domain_info_11d(&adapter->pattemptedbssdesc-> - countryinfo, 0, + ret = parse_domain_info_11d(&bss->countryinfo, 0, &adapter->parsed_region_chan); if (ret == -1) { - lbs_pr_debug(1, "11D: Err Parse domain_info from AP..\n"); - LEAVE(); - return ret; + lbs_deb_11d("11D: Err Parse domain_info from AP..\n"); + goto done; } memset(&adapter->domainreg, 0, @@ -678,13 +679,15 @@ int libertas_parse_dnld_countryinfo_11d(wlan_private * priv) ret = set_domain_info_11d(priv); if (ret) { - lbs_pr_debug(1, "11D: Err set domainInfo to FW\n"); - LEAVE(); - return ret; + lbs_deb_11d("11D: Err set domainInfo to FW\n"); + goto done; } } - LEAVE(); - return 0; + ret = 0; + +done: + lbs_deb_leave_args(LBS_DEB_11D, "ret %d", ret); + return ret; } /** @@ -699,8 +702,8 @@ int libertas_create_dnld_countryinfo_11d(wlan_private * priv) struct region_channel *region_chan; u8 j; - ENTER(); - lbs_pr_debug(1, "11D:curbssparams.band[%d]\n", adapter->curbssparams.band); + lbs_deb_enter(LBS_DEB_11D); + lbs_deb_11d("11D:curbssparams.band[%d]\n", adapter->curbssparams.band); if (priv->adapter->enable11d) { /* update parsed_region_chan_11; dnld domaininf to FW */ @@ -709,7 +712,7 @@ int libertas_create_dnld_countryinfo_11d(wlan_private * priv) sizeof(adapter->region_channel[0]); j++) { region_chan = &adapter->region_channel[j]; - lbs_pr_debug(1, "11D:[%d] region_chan->band[%d]\n", j, + lbs_deb_11d("11D:[%d] region_chan->band[%d]\n", j, region_chan->band); if (!region_chan || !region_chan->valid @@ -722,10 +725,10 @@ int libertas_create_dnld_countryinfo_11d(wlan_private * priv) if (j >= sizeof(adapter->region_channel) / sizeof(adapter->region_channel[0])) { - lbs_pr_debug(1, "11D:region_chan not found. band[%d]\n", + lbs_deb_11d("11D:region_chan not found. band[%d]\n", adapter->curbssparams.band); - LEAVE(); - return -1; + ret = -1; + goto done; } memset(&adapter->parsed_region_chan, 0, @@ -742,13 +745,14 @@ int libertas_create_dnld_countryinfo_11d(wlan_private * priv) ret = set_domain_info_11d(priv); if (ret) { - lbs_pr_debug(1, "11D: Err set domainInfo to FW\n"); - LEAVE(); - return ret; + lbs_deb_11d("11D: Err set domainInfo to FW\n"); + goto done; } } + ret = 0; - LEAVE(); - return 0; +done: + lbs_deb_leave_args(LBS_DEB_11D, "ret %d", ret); + return ret; } diff --git a/drivers/net/wireless/libertas/11d.h b/drivers/net/wireless/libertas/11d.h index db2ebea9f23..73e42e71291 100644 --- a/drivers/net/wireless/libertas/11d.h +++ b/drivers/net/wireless/libertas/11d.h @@ -47,7 +47,7 @@ struct mrvlietypes_domainparamset { } __attribute__ ((packed)); struct cmd_ds_802_11d_domain_info { - u16 action; + __le16 action; struct mrvlietypes_domainparamset domain; } __attribute__ ((packed)); @@ -98,7 +98,9 @@ int libertas_cmd_enable_11d(wlan_private * priv, struct iwreq *wrq); int libertas_ret_802_11d_domain_info(wlan_private * priv, struct cmd_ds_command *resp); -int libertas_parse_dnld_countryinfo_11d(wlan_private * priv); +struct bss_descriptor; +int libertas_parse_dnld_countryinfo_11d(wlan_private * priv, + struct bss_descriptor * bss); int libertas_create_dnld_countryinfo_11d(wlan_private * priv); diff --git a/drivers/net/wireless/libertas/Makefile b/drivers/net/wireless/libertas/Makefile index 56a8ea1fbf0..a1097f59fd4 100644 --- a/drivers/net/wireless/libertas/Makefile +++ b/drivers/net/wireless/libertas/Makefile @@ -1,4 +1,4 @@ -usb8xxx-objs := main.o fw.o wext.o \ +libertas-objs := main.o fw.o wext.o \ rx.o tx.o cmd.o \ cmdresp.o scan.o \ join.o 11d.o \ @@ -8,5 +8,5 @@ usb8xxx-objs := main.o fw.o wext.o \ usb8xxx-objs += if_bootcmd.o usb8xxx-objs += if_usb.o +obj-$(CONFIG_LIBERTAS) += libertas.o obj-$(CONFIG_LIBERTAS_USB) += usb8xxx.o - diff --git a/drivers/net/wireless/libertas/README b/drivers/net/wireless/libertas/README index 378577200b5..1f92f50b643 100644 --- a/drivers/net/wireless/libertas/README +++ b/drivers/net/wireless/libertas/README @@ -1,7 +1,7 @@ ================================================================================ README for USB8388 - (c) Copyright © 2003-2006, Marvell International Ltd. + (c) Copyright © 2003-2006, Marvell International Ltd. All Rights Reserved This software file (the "File") is distributed by Marvell International @@ -47,15 +47,19 @@ Version 5 Command: iwpriv ethX ledgpio <n> BT Commands: - The blinding table (BT) contains a list of mac addresses that should be - ignored by the firmware. It is primarily used for debugging and - testing networks. It can be edited and inspected with the following - commands: + The blinding table (BT) contains a list of mac addresses that will be, + by default, ignored by the firmware. It is also possible to invert this + behavior so that we will ignore all traffic except for the portion + coming from mac addresess in the list. It is primarily used for + debugging and testing networks. It can be edited and inspected with + the following commands: iwpriv ethX bt_reset iwpriv ethX bt_add <mac_address> iwpriv ethX bt_del <mac_address> iwpriv ethX bt_list <id> + iwpriv ethX bt_get_invert <n> + iwpriv ethX bt_set_invert <n> FWT Commands: The forwarding table (FWT) is a feature used to manage mesh network @@ -135,7 +139,7 @@ fwt_add This command is used to insert an entry into the FWT table. The list of parameters must follow the following structure: - iwpriv ethX fwt_add da ra [metric dir ssn dsn hopcount ttl expiration sleepmode snr] + iwpriv ethX fwt_add da ra [metric dir rate ssn dsn hopcount ttl expiration sleepmode snr] The parameters between brackets are optional, but they must appear in the order specified. For example, if you want to specify the metric, @@ -150,6 +154,9 @@ fwt_add preferred, default is 0) dir -- direction (1 for direct, 0 for reverse, default is 1) + rate -- data rate used for transmission to the RA, + as specified for the rateadapt command, + default is 3 (11Mbps) ssn -- Source Sequence Number (time at the RA for reverse routes. Default is 0) dsn -- Destination Sequence Number (time at the DA @@ -207,13 +214,17 @@ fwt_list The output is a string of the following form: - da ra metric dir ssn dsn hopcount ttl expiration sleepmode snr + da ra valid metric dir rate ssn dsn hopcount ttl expiration + sleepmode snr precursor where the different fields are:- da -- DA MAC address (in the form "00:11:22:33:44:55") ra -- RA MAC address (in the form "00:11:22:33:44:55") + valid -- whether the route is valid (0 if not valid) metric -- route metric (cost: smaller-metric routes are preferred) dir -- direction (1 for direct, 0 for reverse) + rate -- data rate used for transmission to the RA, + as specified for the rateadapt command ssn -- Source Sequence Number (time at the RA for reverse routes) dsn -- Destination Sequence Number (time at the DA for direct routes) hopcount -- hop count (currently unused) @@ -221,33 +232,10 @@ fwt_list expiration -- entry expiration (in ticks, where a tick is 1024us, or ~ 1ms. Use 0 for an indefinite entry) sleepmode -- RA's sleep mode (currently unused) snr -- SNR in the link to RA (currently unused) + precursor -- predecessor in direct routes fwt_list_route - This command is used to list a route from the FWT table. The only - parameter is the route ID. If you want to list all the routes in a - table, start with rid=0, and keep incrementing rid until you get a - "(null)" string. This function is similar to fwt_list. The only - difference is the output format. Also note that this command is meant - for debugging. It is expected that users will use fwt_lookup and - fwt_list. One important reason for this is that the route id may change - as the route table is altered. - - iwpriv ethX fwt_list_route rid - - The output is a string of the following form: - - da metric dir nid ssn dsn hopcount ttl expiration - - where the different fields are:- - da -- DA MAC address (in the form "00:11:22:33:44:55") - metric -- route metric (cost: smaller-metric routes are preferred) - dir -- direction (1 for direct, 0 for reverse) - nid -- Next-hop (neighbor) host ID (nid) - ssn -- Source Sequence Number (time at the RA for reverse routes) - dsn -- Destination Sequence Number (time at the DA for direct routes) - hopcount -- hop count (currently unused) - ttl -- TTL count (only used in reverse entries) - expiration -- entry expiration (in ticks, where a tick is 1024us, or ~ 1ms. Use 0 for an indefinite entry) + This command is equivalent to fwt_list. fwt_list_neigh This command is used to list a neighbor from the FWT table. The only diff --git a/drivers/net/wireless/libertas/assoc.c b/drivers/net/wireless/libertas/assoc.c index c260bd1b3d4..ee82413b426 100644 --- a/drivers/net/wireless/libertas/assoc.c +++ b/drivers/net/wireless/libertas/assoc.c @@ -2,6 +2,7 @@ #include <linux/bitops.h> #include <net/ieee80211.h> +#include <linux/etherdevice.h> #include "assoc.h" #include "join.h" @@ -13,59 +14,88 @@ static const u8 bssid_any[ETH_ALEN] = { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF }; static const u8 bssid_off[ETH_ALEN] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; +static void print_assoc_req(const char * extra, struct assoc_request * assoc_req) +{ + lbs_deb_assoc( + "#### Association Request: %s\n" + " flags: 0x%08lX\n" + " SSID: '%s'\n" + " channel: %d\n" + " band: %d\n" + " mode: %d\n" + " BSSID: " MAC_FMT "\n" + " Encryption:%s%s%s\n" + " auth: %d\n", + extra, assoc_req->flags, + escape_essid(assoc_req->ssid, assoc_req->ssid_len), + assoc_req->channel, assoc_req->band, assoc_req->mode, + MAC_ARG(assoc_req->bssid), + assoc_req->secinfo.WPAenabled ? " WPA" : "", + assoc_req->secinfo.WPA2enabled ? " WPA2" : "", + assoc_req->secinfo.wep_enabled ? " WEP" : "", + assoc_req->secinfo.auth_mode); +} + + static int assoc_helper_essid(wlan_private *priv, struct assoc_request * assoc_req) { wlan_adapter *adapter = priv->adapter; int ret = 0; - int i; + struct bss_descriptor * bss; + int channel = -1; - ENTER(); + lbs_deb_enter(LBS_DEB_ASSOC); - lbs_pr_debug(1, "New SSID requested: %s\n", assoc_req->ssid.ssid); + /* FIXME: take channel into account when picking SSIDs if a channel + * is set. + */ + + if (test_bit(ASSOC_FLAG_CHANNEL, &assoc_req->flags)) + channel = assoc_req->channel; + + lbs_deb_assoc("New SSID requested: '%s'\n", + escape_essid(assoc_req->ssid, assoc_req->ssid_len)); if (assoc_req->mode == IW_MODE_INFRA) { if (adapter->prescan) { - libertas_send_specific_SSID_scan(priv, &assoc_req->ssid, 1); + libertas_send_specific_ssid_scan(priv, assoc_req->ssid, + assoc_req->ssid_len, 0); } - i = libertas_find_SSID_in_list(adapter, &assoc_req->ssid, - NULL, IW_MODE_INFRA); - if (i >= 0) { - lbs_pr_debug(1, - "SSID found in scan list ... associating...\n"); - - ret = wlan_associate(priv, &adapter->scantable[i]); - if (ret == 0) { - memcpy(&assoc_req->bssid, - &adapter->scantable[i].macaddress, - ETH_ALEN); - } + bss = libertas_find_ssid_in_list(adapter, assoc_req->ssid, + assoc_req->ssid_len, NULL, IW_MODE_INFRA, channel); + if (bss != NULL) { + lbs_deb_assoc("SSID found in scan list, associating\n"); + memcpy(&assoc_req->bss, bss, sizeof(struct bss_descriptor)); + ret = wlan_associate(priv, assoc_req); } else { - lbs_pr_debug(1, "SSID '%s' not found; cannot associate\n", - assoc_req->ssid.ssid); + lbs_deb_assoc("SSID not found; cannot associate\n"); } } else if (assoc_req->mode == IW_MODE_ADHOC) { /* Scan for the network, do not save previous results. Stale * scan data will cause us to join a non-existant adhoc network */ - libertas_send_specific_SSID_scan(priv, &assoc_req->ssid, 0); + libertas_send_specific_ssid_scan(priv, assoc_req->ssid, + assoc_req->ssid_len, 1); /* Search for the requested SSID in the scan table */ - i = libertas_find_SSID_in_list(adapter, &assoc_req->ssid, NULL, - IW_MODE_ADHOC); - if (i >= 0) { - lbs_pr_debug(1, "SSID found at %d in List, so join\n", ret); - libertas_join_adhoc_network(priv, &adapter->scantable[i]); + bss = libertas_find_ssid_in_list(adapter, assoc_req->ssid, + assoc_req->ssid_len, NULL, IW_MODE_ADHOC, channel); + if (bss != NULL) { + lbs_deb_assoc("SSID found, will join\n"); + memcpy(&assoc_req->bss, bss, sizeof(struct bss_descriptor)); + libertas_join_adhoc_network(priv, assoc_req); } else { /* else send START command */ - lbs_pr_debug(1, "SSID not found in list, so creating adhoc" - " with SSID '%s'\n", assoc_req->ssid.ssid); - libertas_start_adhoc_network(priv, &assoc_req->ssid); + lbs_deb_assoc("SSID not found, creating adhoc network\n"); + memcpy(&assoc_req->bss.ssid, &assoc_req->ssid, + IW_ESSID_MAX_SIZE); + assoc_req->bss.ssid_len = assoc_req->ssid_len; + libertas_start_adhoc_network(priv, assoc_req); } - memcpy(&assoc_req->bssid, &adapter->current_addr, ETH_ALEN); } - LEAVE(); + lbs_deb_leave_args(LBS_DEB_ASSOC, "ret %d", ret); ret |