* rt2500pci master mode and hostapd
From: Janne Tanskanen @ 2009-10-21 17:19 UTC (permalink / raw)
To: linux-wireless
Hi! I build a wireless access point using a-link wl54pc (pcmcia card,
rt2500pci module) and hostapd 0.6.9 with kernel version 2.6.32-rc5.
Problem is that even tho hostapd starts and iwconfig shows wlan0 in
master mode, other computers cant find the wireless network.
I found a working patch from here:
http://rt2x00.serialmonkey.com/phpBB/viewtopic.php?p=32632#p32632 and
all works now with it applied to vanilla kernel. Just wanted to post
this to the mailing list and ask why it's not added to mainline rt2x00
kernel tree yet? Patch on forum is from May, almost half year ago.
Hopefully it'll be included to mainline kernel asap.
--
Janne Tanskanen
^ permalink raw reply
* Re: [PATCH] libertas: remove unused lbs_cmd_802_11_inactivity_timeout()
From: Dan Williams @ 2009-10-21 18:12 UTC (permalink / raw)
To: Holger Schurig; +Cc: linux-wireless, John Linville
In-Reply-To: <200910190854.19967.hs4233@mail.mn-solutions.de>
On Mon, 2009-10-19 at 08:54 +0200, Holger Schurig wrote:
> > We were going to use this at one point, but we haven't yet, so we can
> > add it back when we do.
>
> So, what does this actually do?
Pretty much like it sounds; it lets the device go to into powersave at
user-specified interval after the last TX or RX, instead of having to
wait one full beacon of inactivity.
Dan
^ permalink raw reply
* Re: [PATCH] libertas: remove unused 11d code
From: Dan Williams @ 2009-10-21 18:13 UTC (permalink / raw)
To: Holger Schurig; +Cc: linux-wireless, John Linville
In-Reply-To: <200910190940.52830.hs4233@mail.mn-solutions.de>
On Mon, 2009-10-19 at 09:40 +0200, Holger Schurig wrote:
> Most of the 11d code was protected with an "if (priv->enable11d)" clause.
> But there was no code that anywhere that was able to set this
> variable to true. So all 11d code was dead for almost a year and no one
> complained. That's enought incentive to remove this code.
>
> Besides removing old cruft, we gain back the 11d capability in a common way
> when we merge the cfg80211 functionality.
>
> Signed-off-by: Holger Schurig <hs4233@mail.mn-solutions.de>
Acked-by: Dan Williams <dcbw@redhat.com>
Can add this back when somebody cares. Nobody has touched it in at
least 3 years.
> ---
>
> First I removed all protected with "if (priv->enable11d)".
>
> Then I removed the now empty functions because of the first step (e.g.
> lbs_create_dnld_countryinfo_11d() and lbs_parse_dnld_countryinfo_11d()
> became empty.
>
> Then there was no code that could invoke CMD_802_11D_DOMAIN_INFO, so I
> removed the parts from cmd.c and cmdresp.c that handled this.
>
> Then I removed the functions and variables that were unused.
>
> Then I removed priv->parsed_region_chan and it's initialisation code. It was
> only initialized and not used at all.
>
> And suddenly 11d. was empty, so I removed that as well.
>
>
> --- linux-wl.orig/drivers/net/wireless/libertas/11d.h
> +++ linux-wl/drivers/net/wireless/libertas/11d.h
> @@ -79,27 +79,4 @@
> u8 code;
> };
>
> -struct lbs_private;
> -
> -u8 lbs_get_scan_type_11d(u8 chan,
> - struct parsed_region_chan_11d *parsed_region_chan);
> -
> -u32 lbs_chan_2_freq(u8 chan);
> -
> -void lbs_init_11d(struct lbs_private *priv);
> -
> -int lbs_set_universaltable(struct lbs_private *priv, u8 band);
> -
> -int lbs_cmd_802_11d_domain_info(struct lbs_private *priv,
> - struct cmd_ds_command *cmd, u16 cmdno,
> - u16 cmdOption);
> -
> -int lbs_ret_802_11d_domain_info(struct cmd_ds_command *resp);
> -
> -struct bss_descriptor;
> -int lbs_parse_dnld_countryinfo_11d(struct lbs_private *priv,
> - struct bss_descriptor * bss);
> -
> -int lbs_create_dnld_countryinfo_11d(struct lbs_private *priv);
> -
> #endif
> --- linux-wl.orig/drivers/net/wireless/libertas/assoc.c
> +++ linux-wl/drivers/net/wireless/libertas/assoc.c
> @@ -371,11 +371,6 @@
> /* update curbssparams */
> priv->curbssparams.channel = bss->phy.ds.channel;
>
> - if (lbs_parse_dnld_countryinfo_11d(priv, bss)) {
> - ret = -1;
> - goto done;
> - }
> -
> ret = lbs_cmd_with_response(priv, command, &cmd);
> if (ret == 0) {
> ret = lbs_assoc_post(priv,
> @@ -650,11 +645,6 @@
> }
> }
>
> - if (lbs_parse_dnld_countryinfo_11d(priv, bss)) {
> - ret = -1;
> - goto out;
> - }
> -
> ret = lbs_cmd_with_response(priv, CMD_802_11_AD_HOC_JOIN, &cmd);
> if (ret == 0) {
> ret = lbs_adhoc_post(priv,
> @@ -754,12 +744,6 @@
> lbs_deb_join("ADHOC_START: rates=%02x %02x %02x %02x\n",
> cmd.rates[0], cmd.rates[1], cmd.rates[2], cmd.rates[3]);
>
> - if (lbs_create_dnld_countryinfo_11d(priv)) {
> - lbs_deb_join("ADHOC_START: dnld_countryinfo_11d failed\n");
> - ret = -1;
> - goto out;
> - }
> -
> lbs_deb_join("ADHOC_START: Starting Ad-Hoc BSS on channel %d, band %d\n",
> assoc_req->channel, assoc_req->band);
>
> --- linux-wl.orig/drivers/net/wireless/libertas/scan.c
> +++ linux-wl/drivers/net/wireless/libertas/scan.c
> @@ -144,31 +144,15 @@
> scantype = CMD_SCAN_TYPE_ACTIVE;
>
> for (rgnidx = 0; rgnidx < ARRAY_SIZE(priv->region_channel); rgnidx++) {
> - if (priv->enable11d && (priv->connect_status != LBS_CONNECTED)
> - && (priv->mesh_connect_status != LBS_CONNECTED)) {
> - /* Scan all the supported chan for the first scan */
> - if (!priv->universal_channel[rgnidx].valid)
> - continue;
> - scanregion = &priv->universal_channel[rgnidx];
> -
> - /* clear the parsed_region_chan for the first scan */
> - memset(&priv->parsed_region_chan, 0x00,
> - sizeof(priv->parsed_region_chan));
> - } else {
> - if (!priv->region_channel[rgnidx].valid)
> - continue;
> - scanregion = &priv->region_channel[rgnidx];
> - }
> + if (!priv->region_channel[rgnidx].valid)
> + continue;
> + scanregion = &priv->region_channel[rgnidx];
>
> for (nextchan = 0; nextchan < scanregion->nrcfp; nextchan++, chanidx++) {
> struct chanscanparamset *chan = &scanchanlist[chanidx];
>
> cfp = scanregion->CFP + nextchan;
>
> - if (priv->enable11d)
> - scantype = lbs_get_scan_type_11d(cfp->channel,
> - &priv->parsed_region_chan);
> -
> if (scanregion->band == BAND_B || scanregion->band == BAND_G)
> chan->radiotype = CMD_SCAN_RADIO_TYPE_BG;
>
> --- linux-wl.orig/drivers/net/wireless/libertas/wext.c
> +++ linux-wl/drivers/net/wireless/libertas/wext.c
> @@ -65,8 +65,6 @@
> for (j = 0; !cfp && (j < ARRAY_SIZE(priv->region_channel)); j++) {
> rc = &priv->region_channel[j];
>
> - if (priv->enable11d)
> - rc = &priv->universal_channel[j];
> if (!rc->valid || !rc->CFP)
> continue;
> if (rc->band != band)
> @@ -106,8 +104,6 @@
> for (j = 0; !cfp && (j < ARRAY_SIZE(priv->region_channel)); j++) {
> rc = &priv->region_channel[j];
>
> - if (priv->enable11d)
> - rc = &priv->universal_channel[j];
> if (!rc->valid || !rc->CFP)
> continue;
> if (rc->band != band)
> @@ -546,8 +542,6 @@
> struct chan_freq_power *cfp;
> u8 rates[MAX_RATES + 1];
>
> - u8 flag = 0;
> -
> lbs_deb_enter(LBS_DEB_WEXT);
>
> dwrq->length = sizeof(struct iw_range);
> @@ -569,52 +563,21 @@
>
> range->scan_capa = IW_SCAN_CAPA_ESSID;
>
> - if (priv->enable11d &&
> - (priv->connect_status == LBS_CONNECTED ||
> - priv->mesh_connect_status == LBS_CONNECTED)) {
> - u8 chan_no;
> - u8 band;
> -
> - struct parsed_region_chan_11d *parsed_region_chan =
> - &priv->parsed_region_chan;
> -
> - if (parsed_region_chan == NULL) {
> - lbs_deb_wext("11d: parsed_region_chan is NULL\n");
> - goto out;
> - }
> - band = parsed_region_chan->band;
> - lbs_deb_wext("band %d, nr_char %d\n", band,
> - parsed_region_chan->nr_chan);
> -
> + for (j = 0; (range->num_frequency < IW_MAX_FREQUENCIES)
> + && (j < ARRAY_SIZE(priv->region_channel)); j++) {
> + cfp = priv->region_channel[j].CFP;
> for (i = 0; (range->num_frequency < IW_MAX_FREQUENCIES)
> - && (i < parsed_region_chan->nr_chan); i++) {
> - chan_no = parsed_region_chan->chanpwr[i].chan;
> - lbs_deb_wext("chan_no %d\n", chan_no);
> - range->freq[range->num_frequency].i = (long)chan_no;
> + && priv->region_channel[j].valid
> + && cfp
> + && (i < priv->region_channel[j].nrcfp); i++) {
> + range->freq[range->num_frequency].i =
> + (long)cfp->channel;
> range->freq[range->num_frequency].m =
> - (long)lbs_chan_2_freq(chan_no) * 100000;
> + (long)cfp->freq * 100000;
> range->freq[range->num_frequency].e = 1;
> + cfp++;
> range->num_frequency++;
> }
> - flag = 1;
> - }
> - if (!flag) {
> - for (j = 0; (range->num_frequency < IW_MAX_FREQUENCIES)
> - && (j < ARRAY_SIZE(priv->region_channel)); j++) {
> - cfp = priv->region_channel[j].CFP;
> - for (i = 0; (range->num_frequency < IW_MAX_FREQUENCIES)
> - && priv->region_channel[j].valid
> - && cfp
> - && (i < priv->region_channel[j].nrcfp); i++) {
> - range->freq[range->num_frequency].i =
> - (long)cfp->channel;
> - range->freq[range->num_frequency].m =
> - (long)cfp->freq * 100000;
> - range->freq[range->num_frequency].e = 1;
> - cfp++;
> - range->num_frequency++;
> - }
> - }
> }
>
> lbs_deb_wext("IW_MAX_FREQUENCIES %d, num_frequency %d\n",
> @@ -699,7 +662,6 @@
> | IW_ENC_CAPA_CIPHER_CCMP;
> }
>
> -out:
> lbs_deb_leave(LBS_DEB_WEXT);
> return 0;
> }
> --- linux-wl.orig/drivers/net/wireless/libertas/11d.c
> +++ /dev/null
> @@ -1,697 +0,0 @@
> -/**
> - * This file contains functions for 802.11D.
> - */
> -#include <linux/ctype.h>
> -#include <linux/kernel.h>
> -#include <linux/wireless.h>
> -
> -#include "host.h"
> -#include "cmd.h"
> -#include "decl.h"
> -#include "11d.h"
> -#include "dev.h"
> -#include "wext.h"
> -
> -#define TX_PWR_DEFAULT 10
> -
> -static struct region_code_mapping region_code_mapping[] = {
> - {"US ", 0x10}, /* US FCC */
> - {"CA ", 0x10}, /* IC Canada */
> - {"SG ", 0x10}, /* Singapore */
> - {"EU ", 0x30}, /* ETSI */
> - {"AU ", 0x30}, /* Australia */
> - {"KR ", 0x30}, /* Republic Of Korea */
> - {"ES ", 0x31}, /* Spain */
> - {"FR ", 0x32}, /* France */
> - {"JP ", 0x40}, /* Japan */
> -};
> -
> -/* Following 2 structure defines the supported channels */
> -static struct chan_freq_power channel_freq_power_UN_BG[] = {
> - {1, 2412, TX_PWR_DEFAULT},
> - {2, 2417, TX_PWR_DEFAULT},
> - {3, 2422, TX_PWR_DEFAULT},
> - {4, 2427, TX_PWR_DEFAULT},
> - {5, 2432, TX_PWR_DEFAULT},
> - {6, 2437, TX_PWR_DEFAULT},
> - {7, 2442, TX_PWR_DEFAULT},
> - {8, 2447, TX_PWR_DEFAULT},
> - {9, 2452, TX_PWR_DEFAULT},
> - {10, 2457, TX_PWR_DEFAULT},
> - {11, 2462, TX_PWR_DEFAULT},
> - {12, 2467, TX_PWR_DEFAULT},
> - {13, 2472, TX_PWR_DEFAULT},
> - {14, 2484, TX_PWR_DEFAULT}
> -};
> -
> -static u8 lbs_region_2_code(u8 *region)
> -{
> - u8 i;
> -
> - for (i = 0; i < COUNTRY_CODE_LEN && region[i]; i++)
> - region[i] = toupper(region[i]);
> -
> - for (i = 0; i < ARRAY_SIZE(region_code_mapping); i++) {
> - if (!memcmp(region, region_code_mapping[i].region,
> - COUNTRY_CODE_LEN))
> - return (region_code_mapping[i].code);
> - }
> -
> - /* default is US */
> - return (region_code_mapping[0].code);
> -}
> -
> -static u8 *lbs_code_2_region(u8 code)
> -{
> - u8 i;
> -
> - for (i = 0; i < ARRAY_SIZE(region_code_mapping); i++) {
> - if (region_code_mapping[i].code == code)
> - return (region_code_mapping[i].region);
> - }
> - /* default is US */
> - return (region_code_mapping[0].region);
> -}
> -
> -/**
> - * @brief This function finds the nrchan-th chan after the firstchan
> - * @param band band
> - * @param firstchan first channel number
> - * @param nrchan number of channels
> - * @return the nrchan-th chan number
> -*/
> -static u8 lbs_get_chan_11d(u8 firstchan, u8 nrchan, u8 *chan)
> -/*find the nrchan-th chan after the firstchan*/
> -{
> - u8 i;
> - struct chan_freq_power *cfp;
> - u8 cfp_no;
> -
> - cfp = channel_freq_power_UN_BG;
> - cfp_no = ARRAY_SIZE(channel_freq_power_UN_BG);
> -
> - for (i = 0; i < cfp_no; i++) {
> - if ((cfp + i)->channel == firstchan) {
> - lbs_deb_11d("firstchan found\n");
> - break;
> - }
> - }
> -
> - if (i < cfp_no) {
> - /*if beyond the boundary */
> - if (i + nrchan < cfp_no) {
> - *chan = (cfp + i + nrchan)->channel;
> - return 1;
> - }
> - }
> -
> - return 0;
> -}
> -
> -/**
> - * @brief This function Checks if chan txpwr is learned from AP/IBSS
> - * @param chan chan number
> - * @param parsed_region_chan pointer to parsed_region_chan_11d
> - * @return TRUE; FALSE
> -*/
> -static u8 lbs_channel_known_11d(u8 chan,
> - struct parsed_region_chan_11d * parsed_region_chan)
> -{
> - struct chan_power_11d *chanpwr = parsed_region_chan->chanpwr;
> - u8 nr_chan = parsed_region_chan->nr_chan;
> - u8 i = 0;
> -
> - lbs_deb_hex(LBS_DEB_11D, "parsed_region_chan", (char *)chanpwr,
> - sizeof(struct chan_power_11d) * nr_chan);
> -
> - for (i = 0; i < nr_chan; i++) {
> - if (chan == chanpwr[i].chan) {
> - lbs_deb_11d("found chan %d\n", chan);
> - return 1;
> - }
> - }
> -
> - lbs_deb_11d("chan %d not found\n", chan);
> - return 0;
> -}
> -
> -u32 lbs_chan_2_freq(u8 chan)
> -{
> - struct chan_freq_power *cf;
> - u16 i;
> - u32 freq = 0;
> -
> - cf = channel_freq_power_UN_BG;
> -
> - for (i = 0; i < ARRAY_SIZE(channel_freq_power_UN_BG); i++) {
> - if (chan == cf[i].channel)
> - freq = cf[i].freq;
> - }
> -
> - return freq;
> -}
> -
> -static int generate_domain_info_11d(struct parsed_region_chan_11d
> - *parsed_region_chan,
> - struct lbs_802_11d_domain_reg *domaininfo)
> -{
> - u8 nr_subband = 0;
> -
> - u8 nr_chan = parsed_region_chan->nr_chan;
> - u8 nr_parsedchan = 0;
> -
> - u8 firstchan = 0, nextchan = 0, maxpwr = 0;
> -
> - u8 i, flag = 0;
> -
> - memcpy(domaininfo->countrycode, parsed_region_chan->countrycode,
> - COUNTRY_CODE_LEN);
> -
> - lbs_deb_11d("nrchan %d\n", nr_chan);
> - lbs_deb_hex(LBS_DEB_11D, "parsed_region_chan", (char *)parsed_region_chan,
> - sizeof(struct parsed_region_chan_11d));
> -
> - for (i = 0; i < nr_chan; i++) {
> - if (!flag) {
> - flag = 1;
> - nextchan = firstchan =
> - parsed_region_chan->chanpwr[i].chan;
> - maxpwr = parsed_region_chan->chanpwr[i].pwr;
> - nr_parsedchan = 1;
> - continue;
> - }
> -
> - if (parsed_region_chan->chanpwr[i].chan == nextchan + 1 &&
> - parsed_region_chan->chanpwr[i].pwr == maxpwr) {
> - nextchan++;
> - nr_parsedchan++;
> - } else {
> - domaininfo->subband[nr_subband].firstchan = firstchan;
> - domaininfo->subband[nr_subband].nrchan =
> - nr_parsedchan;
> - domaininfo->subband[nr_subband].maxtxpwr = maxpwr;
> - nr_subband++;
> - nextchan = firstchan =
> - parsed_region_chan->chanpwr[i].chan;
> - maxpwr = parsed_region_chan->chanpwr[i].pwr;
> - }
> - }
> -
> - if (flag) {
> - domaininfo->subband[nr_subband].firstchan = firstchan;
> - domaininfo->subband[nr_subband].nrchan = nr_parsedchan;
> - domaininfo->subband[nr_subband].maxtxpwr = maxpwr;
> - nr_subband++;
> - }
> - domaininfo->nr_subband = nr_subband;
> -
> - lbs_deb_11d("nr_subband=%x\n", domaininfo->nr_subband);
> - lbs_deb_hex(LBS_DEB_11D, "domaininfo", (char *)domaininfo,
> - COUNTRY_CODE_LEN + 1 +
> - sizeof(struct ieee_subbandset) * nr_subband);
> - return 0;
> -}
> -
> -/**
> - * @brief This function generates parsed_region_chan from Domain Info learned from AP/IBSS
> - * @param region_chan pointer to struct region_channel
> - * @param *parsed_region_chan pointer to parsed_region_chan_11d
> - * @return N/A
> -*/
> -static void lbs_generate_parsed_region_chan_11d(struct region_channel *region_chan,
> - struct parsed_region_chan_11d *
> - parsed_region_chan)
> -{
> - u8 i;
> - struct chan_freq_power *cfp;
> -
> - if (region_chan == NULL) {
> - lbs_deb_11d("region_chan is NULL\n");
> - return;
> - }
> -
> - cfp = region_chan->CFP;
> - if (cfp == NULL) {
> - lbs_deb_11d("cfp is NULL \n");
> - return;
> - }
> -
> - parsed_region_chan->band = region_chan->band;
> - parsed_region_chan->region = region_chan->region;
> - memcpy(parsed_region_chan->countrycode,
> - lbs_code_2_region(region_chan->region), COUNTRY_CODE_LEN);
> -
> - lbs_deb_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_deb_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_deb_11d("nrchan %d\n", parsed_region_chan->nr_chan);
> -
> - return;
> -}
> -
> -/**
> - * @brief generate parsed_region_chan from Domain Info learned from AP/IBSS
> - * @param region region ID
> - * @param band band
> - * @param chan chan
> - * @return TRUE;FALSE
> -*/
> -static u8 lbs_region_chan_supported_11d(u8 region, u8 chan)
> -{
> - struct chan_freq_power *cfp;
> - int cfp_no;
> - u8 idx;
> - int ret = 0;
> -
> - lbs_deb_enter(LBS_DEB_11D);
> -
> - cfp = lbs_get_region_cfp_table(region, &cfp_no);
> - if (cfp == NULL)
> - return 0;
> -
> - for (idx = 0; idx < cfp_no; idx++) {
> - if (chan == (cfp + idx)->channel) {
> - /* If Mrvl Chip Supported? */
> - if ((cfp + idx)->unsupported) {
> - ret = 0;
> - } else {
> - ret = 1;
> - }
> - goto done;
> - }
> - }
> -
> - /*chan is not in the region table */
> -
> -done:
> - lbs_deb_leave_args(LBS_DEB_11D, "ret %d", ret);
> - return ret;
> -}
> -
> -/**
> - * @brief This function checks if chan txpwr is learned from AP/IBSS
> - * @param chan chan number
> - * @param parsed_region_chan pointer to parsed_region_chan_11d
> - * @return 0
> -*/
> -static int parse_domain_info_11d(struct ieee_ie_country_info_full_set *countryinfo,
> - u8 band,
> - struct parsed_region_chan_11d *parsed_region_chan)
> -{
> - u8 nr_subband, nrchan;
> - u8 lastchan, firstchan;
> - u8 region;
> - u8 curchan = 0;
> -
> - u8 idx = 0; /*chan index in parsed_region_chan */
> -
> - u8 j, i;
> -
> - lbs_deb_enter(LBS_DEB_11D);
> -
> - /*validation Rules:
> - 1. valid region Code
> - 2. First Chan increment
> - 3. channel range no overlap
> - 4. channel is valid?
> - 5. channel is supported by region?
> - 6. Others
> - */
> -
> - lbs_deb_hex(LBS_DEB_11D, "countryinfo", (u8 *) countryinfo, 30);
> -
> - if ((*(countryinfo->countrycode)) == 0
> - || (countryinfo->header.len <= COUNTRY_CODE_LEN)) {
> - /* No region Info or Wrong region info: treat as No 11D info */
> - goto done;
> - }
> -
> - /*Step1: check region_code */
> - parsed_region_chan->region = region =
> - lbs_region_2_code(countryinfo->countrycode);
> -
> - lbs_deb_11d("regioncode=%x\n", (u8) parsed_region_chan->region);
> - lbs_deb_hex(LBS_DEB_11D, "countrycode", (char *)countryinfo->countrycode,
> - COUNTRY_CODE_LEN);
> -
> - parsed_region_chan->band = band;
> -
> - memcpy(parsed_region_chan->countrycode, countryinfo->countrycode,
> - COUNTRY_CODE_LEN);
> -
> - nr_subband = (countryinfo->header.len - COUNTRY_CODE_LEN) /
> - sizeof(struct ieee_subbandset);
> -
> - for (j = 0, lastchan = 0; j < nr_subband; j++) {
> -
> - if (countryinfo->subband[j].firstchan <= lastchan) {
> - /*Step2&3. Check First Chan Num increment and no overlap */
> - lbs_deb_11d("chan %d>%d, overlap\n",
> - countryinfo->subband[j].firstchan, lastchan);
> - continue;
> - }
> -
> - firstchan = countryinfo->subband[j].firstchan;
> - nrchan = countryinfo->subband[j].nrchan;
> -
> - for (i = 0; idx < MAX_NO_OF_CHAN && i < nrchan; i++) {
> - /*step4: channel is supported? */
> -
> - if (!lbs_get_chan_11d(firstchan, i, &curchan)) {
> - /* Chan is not found in UN table */
> - lbs_deb_11d("chan is not supported: %d \n", i);
> - break;
> - }
> -
> - lastchan = curchan;
> -
> - if (lbs_region_chan_supported_11d(region, curchan)) {
> - /*step5: Check if curchan is supported by mrvl in region */
> - parsed_region_chan->chanpwr[idx].chan = curchan;
> - parsed_region_chan->chanpwr[idx].pwr =
> - countryinfo->subband[j].maxtxpwr;
> - idx++;
> - } else {
> - /*not supported and ignore the chan */
> - lbs_deb_11d(
> - "i %d, chan %d unsupported in region %x, band %d\n",
> - i, curchan, region, band);
> - }
> - }
> -
> - /*Step6: Add other checking if any */
> -
> - }
> -
> - parsed_region_chan->nr_chan = idx;
> -
> - lbs_deb_11d("nrchan=%x\n", parsed_region_chan->nr_chan);
> - lbs_deb_hex(LBS_DEB_11D, "parsed_region_chan", (u8 *) parsed_region_chan,
> - 2 + COUNTRY_CODE_LEN + sizeof(struct parsed_region_chan_11d) * idx);
> -
> -done:
> - lbs_deb_enter(LBS_DEB_11D);
> - return 0;
> -}
> -
> -/**
> - * @brief This function calculates the scan type for channels
> - * @param chan chan number
> - * @param parsed_region_chan pointer to parsed_region_chan_11d
> - * @return PASSIVE if chan is unknown; ACTIVE if chan is known
> -*/
> -u8 lbs_get_scan_type_11d(u8 chan,
> - struct parsed_region_chan_11d * parsed_region_chan)
> -{
> - u8 scan_type = CMD_SCAN_TYPE_PASSIVE;
> -
> - lbs_deb_enter(LBS_DEB_11D);
> -
> - if (lbs_channel_known_11d(chan, parsed_region_chan)) {
> - lbs_deb_11d("found, do active scan\n");
> - scan_type = CMD_SCAN_TYPE_ACTIVE;
> - } else {
> - lbs_deb_11d("not found, do passive scan\n");
> - }
> -
> - lbs_deb_leave_args(LBS_DEB_11D, "ret scan_type %d", scan_type);
> - return scan_type;
> -
> -}
> -
> -void lbs_init_11d(struct lbs_private *priv)
> -{
> - priv->enable11d = 0;
> - memset(&(priv->parsed_region_chan), 0,
> - sizeof(struct parsed_region_chan_11d));
> - return;
> -}
> -
> -/**
> - * @brief This function sets DOMAIN INFO to FW
> - * @param priv pointer to struct lbs_private
> - * @return 0; -1
> -*/
> -static int set_domain_info_11d(struct lbs_private *priv)
> -{
> - int ret;
> -
> - if (!priv->enable11d) {
> - lbs_deb_11d("dnld domain Info with 11d disabled\n");
> - return 0;
> - }
> -
> - ret = lbs_prepare_and_send_command(priv, CMD_802_11D_DOMAIN_INFO,
> - CMD_ACT_SET,
> - CMD_OPTION_WAITFORRSP, 0, NULL);
> - if (ret)
> - lbs_deb_11d("fail to dnld domain info\n");
> -
> - return ret;
> -}
> -
> -/**
> - * @brief This function setups scan channels
> - * @param priv pointer to struct lbs_private
> - * @param band band
> - * @return 0
> -*/
> -int lbs_set_universaltable(struct lbs_private *priv, u8 band)
> -{
> - u16 size = sizeof(struct chan_freq_power);
> - u16 i = 0;
> -
> - memset(priv->universal_channel, 0,
> - sizeof(priv->universal_channel));
> -
> - priv->universal_channel[i].nrcfp =
> - sizeof(channel_freq_power_UN_BG) / size;
> - lbs_deb_11d("BG-band nrcfp %d\n",
> - priv->universal_channel[i].nrcfp);
> -
> - priv->universal_channel[i].CFP = channel_freq_power_UN_BG;
> - priv->universal_channel[i].valid = 1;
> - priv->universal_channel[i].region = UNIVERSAL_REGION_CODE;
> - priv->universal_channel[i].band = band;
> - i++;
> -
> - return 0;
> -}
> -
> -/**
> - * @brief This function implements command CMD_802_11D_DOMAIN_INFO
> - * @param priv pointer to struct lbs_private
> - * @param cmd pointer to cmd buffer
> - * @param cmdno cmd ID
> - * @param cmdOption cmd action
> - * @return 0
> -*/
> -int lbs_cmd_802_11d_domain_info(struct lbs_private *priv,
> - struct cmd_ds_command *cmd, u16 cmdno,
> - u16 cmdoption)
> -{
> - struct cmd_ds_802_11d_domain_info *pdomaininfo =
> - &cmd->params.domaininfo;
> - struct mrvl_ie_domain_param_set *domain = &pdomaininfo->domain;
> - u8 nr_subband = priv->domainreg.nr_subband;
> -
> - lbs_deb_enter(LBS_DEB_11D);
> -
> - lbs_deb_11d("nr_subband=%x\n", nr_subband);
> -
> - cmd->command = cpu_to_le16(cmdno);
> - pdomaininfo->action = cpu_to_le16(cmdoption);
> - if (cmdoption == CMD_ACT_GET) {
> - cmd->size =
> - cpu_to_le16(sizeof(pdomaininfo->action) + S_DS_GEN);
> - lbs_deb_hex(LBS_DEB_11D, "802_11D_DOMAIN_INFO", (u8 *) cmd,
> - le16_to_cpu(cmd->size));
> - goto done;
> - }
> -
> - domain->header.type = cpu_to_le16(TLV_TYPE_DOMAIN);
> - memcpy(domain->countrycode, priv->domainreg.countrycode,
> - sizeof(domain->countrycode));
> -
> - domain->header.len =
> - cpu_to_le16(nr_subband * sizeof(struct ieee_subbandset) +
> - sizeof(domain->countrycode));
> -
> - if (nr_subband) {
> - memcpy(domain->subband, priv->domainreg.subband,
> - nr_subband * sizeof(struct ieee_subbandset));
> -
> - cmd->size = cpu_to_le16(sizeof(pdomaininfo->action) +
> - le16_to_cpu(domain->header.len) +
> - sizeof(struct mrvl_ie_header) +
> - S_DS_GEN);
> - } else {
> - cmd->size =
> - cpu_to_le16(sizeof(pdomaininfo->action) + S_DS_GEN);
> - }
> -
> - lbs_deb_hex(LBS_DEB_11D, "802_11D_DOMAIN_INFO", (u8 *) cmd, le16_to_cpu(cmd->size));
> -
> -done:
> - lbs_deb_enter(LBS_DEB_11D);
> - return 0;
> -}
> -
> -/**
> - * @brief This function parses countryinfo from AP and download country info to FW
> - * @param priv pointer to struct lbs_private
> - * @param resp pointer to command response buffer
> - * @return 0; -1
> - */
> -int lbs_ret_802_11d_domain_info(struct cmd_ds_command *resp)
> -{
> - struct cmd_ds_802_11d_domain_info *domaininfo = &resp->params.domaininforesp;
> - struct mrvl_ie_domain_param_set *domain = &domaininfo->domain;
> - u16 action = le16_to_cpu(domaininfo->action);
> - s16 ret = 0;
> - u8 nr_subband = 0;
> -
> - lbs_deb_enter(LBS_DEB_11D);
> -
> - lbs_deb_hex(LBS_DEB_11D, "domain info resp", (u8 *) resp,
> - (int)le16_to_cpu(resp->size));
> -
> - nr_subband = (le16_to_cpu(domain->header.len) - COUNTRY_CODE_LEN) /
> - sizeof(struct ieee_subbandset);
> -
> - lbs_deb_11d("domain info resp: nr_subband %d\n", nr_subband);
> -
> - if (nr_subband > MRVDRV_MAX_SUBBAND_802_11D) {
> - lbs_deb_11d("Invalid Numrer of Subband returned!!\n");
> - return -1;
> - }
> -
> - switch (action) {
> - case CMD_ACT_SET: /*Proc Set action */
> - break;
> -
> - case CMD_ACT_GET:
> - break;
> - default:
> - lbs_deb_11d("Invalid action:%d\n", domaininfo->action);
> - ret = -1;
> - break;
> - }
> -
> - lbs_deb_leave_args(LBS_DEB_11D, "ret %d", ret);
> - return ret;
> -}
> -
> -/**
> - * @brief This function parses countryinfo from AP and download country info to FW
> - * @param priv pointer to struct lbs_private
> - * @return 0; -1
> - */
> -int lbs_parse_dnld_countryinfo_11d(struct lbs_private *priv,
> - struct bss_descriptor * bss)
> -{
> - int ret;
> -
> - lbs_deb_enter(LBS_DEB_11D);
> - if (priv->enable11d) {
> - memset(&priv->parsed_region_chan, 0,
> - sizeof(struct parsed_region_chan_11d));
> - ret = parse_domain_info_11d(&bss->countryinfo, 0,
> - &priv->parsed_region_chan);
> -
> - if (ret == -1) {
> - lbs_deb_11d("error parsing domain_info from AP\n");
> - goto done;
> - }
> -
> - memset(&priv->domainreg, 0,
> - sizeof(struct lbs_802_11d_domain_reg));
> - generate_domain_info_11d(&priv->parsed_region_chan,
> - &priv->domainreg);
> -
> - ret = set_domain_info_11d(priv);
> -
> - if (ret) {
> - lbs_deb_11d("error setting domain info\n");
> - goto done;
> - }
> - }
> - ret = 0;
> -
> -done:
> - lbs_deb_leave_args(LBS_DEB_11D, "ret %d", ret);
> - return ret;
> -}
> -
> -/**
> - * @brief This function generates 11D info from user specified regioncode and download to FW
> - * @param priv pointer to struct lbs_private
> - * @return 0; -1
> - */
> -int lbs_create_dnld_countryinfo_11d(struct lbs_private *priv)
> -{
> - int ret;
> - struct region_channel *region_chan;
> - u8 j;
> -
> - lbs_deb_enter(LBS_DEB_11D);
> - lbs_deb_11d("curbssparams.band %d\n", priv->curbssparams.band);
> -
> - if (priv->enable11d) {
> - /* update parsed_region_chan_11; dnld domaininf to FW */
> -
> - for (j = 0; j < ARRAY_SIZE(priv->region_channel); j++) {
> - region_chan = &priv->region_channel[j];
> -
> - lbs_deb_11d("%d region_chan->band %d\n", j,
> - region_chan->band);
> -
> - if (!region_chan || !region_chan->valid
> - || !region_chan->CFP)
> - continue;
> - if (region_chan->band != priv->curbssparams.band)
> - continue;
> - break;
> - }
> -
> - if (j >= ARRAY_SIZE(priv->region_channel)) {
> - lbs_deb_11d("region_chan not found, band %d\n",
> - priv->curbssparams.band);
> - ret = -1;
> - goto done;
> - }
> -
> - memset(&priv->parsed_region_chan, 0,
> - sizeof(struct parsed_region_chan_11d));
> - lbs_generate_parsed_region_chan_11d(region_chan,
> - &priv->
> - parsed_region_chan);
> -
> - memset(&priv->domainreg, 0,
> - sizeof(struct lbs_802_11d_domain_reg));
> - generate_domain_info_11d(&priv->parsed_region_chan,
> - &priv->domainreg);
> -
> - ret = set_domain_info_11d(priv);
> -
> - if (ret) {
> - lbs_deb_11d("error setting domain info\n");
> - goto done;
> - }
> -
> - }
> - ret = 0;
> -
> -done:
> - lbs_deb_leave_args(LBS_DEB_11D, "ret %d", ret);
> - return ret;
> -}
> --- linux-wl.orig/drivers/net/wireless/libertas/cmd.c
> +++ linux-wl/drivers/net/wireless/libertas/cmd.c
> @@ -191,11 +191,6 @@
> goto out;
> }
>
> - if (lbs_set_universaltable(priv, 0)) {
> - ret = -1;
> - goto out;
> - }
> -
> out:
> lbs_deb_leave(LBS_DEB_CMD);
> return ret;
> @@ -1512,11 +1507,6 @@
> ret = 0;
> goto done;
>
> - case CMD_802_11D_DOMAIN_INFO:
> - ret = lbs_cmd_802_11d_domain_info(priv, cmdptr,
> - cmd_no, cmd_action);
> - break;
> -
> case CMD_802_11_TPC_CFG:
> cmdptr->command = cpu_to_le16(CMD_802_11_TPC_CFG);
> cmdptr->size =
> --- linux-wl.orig/drivers/net/wireless/libertas/cmdresp.c
> +++ linux-wl/drivers/net/wireless/libertas/cmdresp.c
> @@ -228,10 +228,6 @@
> ret = lbs_ret_802_11_rssi(priv, resp);
> break;
>
> - case CMD_RET(CMD_802_11D_DOMAIN_INFO):
> - ret = lbs_ret_802_11d_domain_info(resp);
> - break;
> -
> case CMD_RET(CMD_802_11_TPC_CFG):
> spin_lock_irqsave(&priv->driver_lock, flags);
> memmove((void *)priv->cur_cmd->callback_arg, &resp->params.tpccfg,
> --- linux-wl.orig/drivers/net/wireless/libertas/dev.h
> +++ linux-wl/drivers/net/wireless/libertas/dev.h
> @@ -325,15 +325,6 @@
> /** region channel data */
> struct region_channel region_channel[MAX_REGION_CHANNEL_NUM];
>
> - struct region_channel universal_channel[MAX_REGION_CHANNEL_NUM];
> -
> - /** 11D and Domain Regulatory Data */
> - struct lbs_802_11d_domain_reg domainreg;
> - struct parsed_region_chan_11d parsed_region_chan;
> -
> - /** FSM variable for 11d support */
> - u32 enable11d;
> -
> /** MISCELLANEOUS */
> struct lbs_offset_value offsetvalue;
>
> --- linux-wl.orig/drivers/net/wireless/libertas/Makefile
> +++ linux-wl/drivers/net/wireless/libertas/Makefile
> @@ -1,4 +1,3 @@
> -libertas-y += 11d.o
> libertas-y += assoc.o
> libertas-y += cfg.o
> libertas-y += cmd.o
> #define CMD_OPTION_WAITFORRSP 0x0002
> --- linux-wl.orig/drivers/net/wireless/libertas/main.c
> +++ linux-wl/drivers/net/wireless/libertas/main.c
> @@ -1408,9 +1408,6 @@
> if (ret)
> goto done;
>
> - /* init 802.11d */
> - lbs_init_11d(priv);
> -
> if (lbs_cfg_register(priv)) {
> lbs_pr_err("cannot register device\n");
> goto done;
>
^ permalink raw reply
* Re: [PATCH] libertas: change IW_ESSID_MAX_SIZE -> IEEE80211_MAX_SSID_LEN
From: Dan Williams @ 2009-10-21 18:15 UTC (permalink / raw)
To: Holger Schurig; +Cc: linux-wireless, John Linville
In-Reply-To: <200910191023.41565.hs4233@mail.mn-solutions.de>
On Mon, 2009-10-19 at 10:23 +0200, Holger Schurig wrote:
> Signed-off-by: Holger Schurig <hs4233@mail.mn-solutions.de>
Acked-by: Dan Williams <dcbw@redhat.com>
> --- linux-wl.orig/drivers/net/wireless/libertas/assoc.c
> +++ linux-wl/drivers/net/wireless/libertas/assoc.c
> @@ -226,7 +226,7 @@
> priv->connect_status = LBS_CONNECTED;
>
> /* Update current SSID and BSSID */
> - memcpy(&priv->curbssparams.ssid, &bss->ssid, IW_ESSID_MAX_SIZE);
> + memcpy(&priv->curbssparams.ssid, &bss->ssid, IEEE80211_MAX_SSID_LEN);
> priv->curbssparams.ssid_len = bss->ssid_len;
> memcpy(priv->curbssparams.bssid, bss->bssid, ETH_ALEN);
>
> @@ -467,7 +467,7 @@
> memcpy(&priv->curbssparams.bssid, bss->bssid, ETH_ALEN);
>
> /* Set the new SSID to current SSID */
> - memcpy(&priv->curbssparams.ssid, &bss->ssid, IW_ESSID_MAX_SIZE);
> + memcpy(&priv->curbssparams.ssid, &bss->ssid, IEEE80211_MAX_SSID_LEN);
> priv->curbssparams.ssid_len = bss->ssid_len;
>
> netif_carrier_on(priv->dev);
> @@ -1083,7 +1083,7 @@
> /* else send START command */
> lbs_deb_assoc("SSID not found, creating adhoc network\n");
> memcpy(&assoc_req->bss.ssid, &assoc_req->ssid,
> - IW_ESSID_MAX_SIZE);
> + IEEE80211_MAX_SSID_LEN);
> assoc_req->bss.ssid_len = assoc_req->ssid_len;
> lbs_adhoc_start(priv, assoc_req);
> }
> @@ -1541,7 +1541,7 @@
>
> found = lbs_find_best_ssid_in_list(priv, preferred_mode);
> if (found && (found->ssid_len > 0)) {
> - memcpy(out_ssid, &found->ssid, IW_ESSID_MAX_SIZE);
> + memcpy(out_ssid, &found->ssid, IEEE80211_MAX_SSID_LEN);
> *out_ssid_len = found->ssid_len;
> *out_mode = found->mode;
> ret = 0;
> @@ -1759,7 +1759,7 @@
> assoc_req = priv->pending_assoc_req;
> if (!test_bit(ASSOC_FLAG_SSID, &assoc_req->flags)) {
> memcpy(&assoc_req->ssid, &priv->curbssparams.ssid,
> - IW_ESSID_MAX_SIZE);
> + IEEE80211_MAX_SSID_LEN);
> assoc_req->ssid_len = priv->curbssparams.ssid_len;
> }
>
> --- linux-wl.orig/drivers/net/wireless/libertas/cmd.c
> +++ linux-wl/drivers/net/wireless/libertas/cmd.c
> @@ -1168,7 +1168,7 @@
> ie->val.mesh_id_len = priv->mesh_ssid_len;
> memcpy(ie->val.mesh_id, priv->mesh_ssid, priv->mesh_ssid_len);
> ie->len = sizeof(struct mrvl_meshie_val) -
> - IW_ESSID_MAX_SIZE + priv->mesh_ssid_len;
> + IEEE80211_MAX_SSID_LEN + priv->mesh_ssid_len;
> cmd.length = cpu_to_le16(sizeof(struct mrvl_meshie_val));
> break;
> case CMD_ACT_MESH_CONFIG_STOP:
> --- linux-wl.orig/drivers/net/wireless/libertas/cmdresp.c
> +++ linux-wl/drivers/net/wireless/libertas/cmdresp.c
> @@ -68,7 +68,7 @@
> * no longer valid.
> */
> memset(&priv->curbssparams.bssid, 0, ETH_ALEN);
> - memset(&priv->curbssparams.ssid, 0, IW_ESSID_MAX_SIZE);
> + memset(&priv->curbssparams.ssid, 0, IEEE80211_MAX_SSID_LEN);
> priv->curbssparams.ssid_len = 0;
>
> if (priv->psstate != PS_STATE_FULL_POWER) {
> --- linux-wl.orig/drivers/net/wireless/libertas/dev.h
> +++ linux-wl/drivers/net/wireless/libertas/dev.h
> @@ -65,7 +65,7 @@
> /** bssid */
> u8 bssid[ETH_ALEN];
> /** ssid */
> - u8 ssid[IW_ESSID_MAX_SIZE + 1];
> + u8 ssid[IEEE80211_MAX_SSID_LEN + 1];
> u8 ssid_len;
>
> /** band */
> @@ -163,7 +163,7 @@
> struct work_struct sync_channel;
> /* remember which channel was scanned last, != 0 if currently scanning */
> int scan_channel;
> - u8 scan_ssid[IW_ESSID_MAX_SIZE + 1];
> + u8 scan_ssid[IEEE80211_MAX_SSID_LEN + 1];
> u8 scan_ssid_len;
>
> /** Hardware access */
> @@ -230,7 +230,7 @@
> struct current_bss_params curbssparams;
>
> uint16_t mesh_tlv;
> - u8 mesh_ssid[IW_ESSID_MAX_SIZE + 1];
> + u8 mesh_ssid[IEEE80211_MAX_SSID_LEN + 1];
> u8 mesh_ssid_len;
>
> /* IW_MODE_* */
> @@ -340,7 +340,7 @@
> struct bss_descriptor {
> u8 bssid[ETH_ALEN];
>
> - u8 ssid[IW_ESSID_MAX_SIZE + 1];
> + u8 ssid[IEEE80211_MAX_SSID_LEN + 1];
> u8 ssid_len;
>
> u16 capability;
> @@ -389,7 +389,7 @@
> #define ASSOC_FLAG_WPA_IE 11
> unsigned long flags;
>
> - u8 ssid[IW_ESSID_MAX_SIZE + 1];
> + u8 ssid[IEEE80211_MAX_SSID_LEN + 1];
> u8 ssid_len;
> u8 channel;
> u8 band;
> --- linux-wl.orig/drivers/net/wireless/libertas/host.h
> +++ linux-wl/drivers/net/wireless/libertas/host.h
> @@ -719,7 +719,7 @@
> struct cmd_ds_802_11_ad_hoc_start {
> struct cmd_header hdr;
>
> - u8 ssid[IW_ESSID_MAX_SIZE];
> + u8 ssid[IEEE80211_MAX_SSID_LEN];
> u8 bsstype;
> __le16 beaconperiod;
> u8 dtimperiod; /* Reserved on v9 and later */
> @@ -742,7 +742,7 @@
>
> struct adhoc_bssdesc {
> u8 bssid[ETH_ALEN];
> - u8 ssid[IW_ESSID_MAX_SIZE];
> + u8 ssid[IEEE80211_MAX_SSID_LEN];
> u8 type;
> __le16 beaconperiod;
> u8 dtimperiod;
> --- linux-wl.orig/drivers/net/wireless/libertas/persistcfg.c
> +++ linux-wl/drivers/net/wireless/libertas/persistcfg.c
> @@ -187,9 +187,9 @@
> if (ret)
> return ret;
>
> - if (defs.meshie.val.mesh_id_len > IW_ESSID_MAX_SIZE) {
> + if (defs.meshie.val.mesh_id_len > IEEE80211_MAX_SSID_LEN) {
> lbs_pr_err("inconsistent mesh ID length");
> - defs.meshie.val.mesh_id_len = IW_ESSID_MAX_SIZE;
> + defs.meshie.val.mesh_id_len = IEEE80211_MAX_SSID_LEN;
> }
>
> /* SSID not null terminated: reserve room for \0 + \n */
> @@ -214,7 +214,7 @@
> int len;
> int ret;
>
> - if (count < 2 || count > IW_ESSID_MAX_SIZE + 1)
> + if (count < 2 || count > IEEE80211_MAX_SSID_LEN + 1)
> return -EINVAL;
>
> memset(&cmd, 0, sizeof(struct cmd_ds_mesh_config));
> @@ -233,7 +233,7 @@
> /* SSID len */
> ie->val.mesh_id_len = len;
> /* IE len */
> - ie->len = sizeof(struct mrvl_meshie_val) - IW_ESSID_MAX_SIZE + len;
> + ie->len = sizeof(struct mrvl_meshie_val) - IEEE80211_MAX_SSID_LEN + len;
>
> ret = lbs_mesh_config_send(priv, &cmd, CMD_ACT_MESH_CONFIG_SET,
> CMD_TYPE_MESH_SET_MESH_IE);
> --- linux-wl.orig/drivers/net/wireless/libertas/types.h
> +++ linux-wl/drivers/net/wireless/libertas/types.h
> @@ -5,8 +5,8 @@
> #define _LBS_TYPES_H_
>
> #include <linux/if_ether.h>
> +#include <linux/ieee80211.h>
> #include <asm/byteorder.h>
> -#include <linux/wireless.h>
>
> struct ieee_ie_header {
> u8 id;
> @@ -247,7 +247,7 @@
> uint8_t active_metric_id;
> uint8_t mesh_capability;
> uint8_t mesh_id_len;
> - uint8_t mesh_id[IW_ESSID_MAX_SIZE];
> + uint8_t mesh_id[IEEE80211_MAX_SSID_LEN];
> } __attribute__ ((packed));
>
> struct mrvl_meshie {
> --- linux-wl.orig/drivers/net/wireless/libertas/scan.c
> +++ linux-wl/drivers/net/wireless/libertas/scan.c
> @@ -19,11 +19,11 @@
>
> //! Approximate amount of data needed to pass a scan result back to iwlist
> #define MAX_SCAN_CELL_SIZE (IW_EV_ADDR_LEN \
> - + IW_ESSID_MAX_SIZE \
> + + IEEE80211_MAX_SSID_LEN \
> + IW_EV_UINT_LEN \
> + IW_EV_FREQ_LEN \
> + IW_EV_QUAL_LEN \
> - + IW_ESSID_MAX_SIZE \
> + + IEEE80211_MAX_SSID_LEN \
> + IW_EV_PARAM_LEN \
> + 40) /* 40 for WPAIE */
>
> @@ -775,7 +775,7 @@
> /* SSID */
> iwe.cmd = SIOCGIWESSID;
> iwe.u.data.flags = 1;
> - iwe.u.data.length = min((uint32_t) bss->ssid_len, (uint32_t) IW_ESSID_MAX_SIZE);
> + iwe.u.data.length = min((uint32_t) bss->ssid_len, (uint32_t) IEEE80211_MAX_SSID_LEN);
> start = iwe_stream_add_point(info, start, stop, &iwe, bss->ssid);
>
> /* Mode */
> --- linux-wl.orig/drivers/net/wireless/libertas/wext.c
> +++ linux-wl/drivers/net/wireless/libertas/wext.c
> @@ -1989,7 +1989,7 @@
> {
> struct lbs_private *priv = dev->ml_priv;
> int ret = 0;
> - u8 ssid[IW_ESSID_MAX_SIZE];
> + u8 ssid[IEEE80211_MAX_SSID_LEN];
> u8 ssid_len = 0;
> struct assoc_request * assoc_req;
> int in_ssid_len = dwrq->length;
> @@ -2003,7 +2003,7 @@
> }
>
> /* Check the size of the string */
> - if (in_ssid_len > IW_ESSID_MAX_SIZE) {
> + if (in_ssid_len > IEEE80211_MAX_SSID_LEN) {
> ret = -E2BIG;
> goto out;
> }
> @@ -2034,7 +2034,7 @@
> ret = -ENOMEM;
> } else {
> /* Copy the SSID to the association request */
> - memcpy(&assoc_req->ssid, &ssid, IW_ESSID_MAX_SIZE);
> + memcpy(&assoc_req->ssid, &ssid, IEEE80211_MAX_SSID_LEN);
> assoc_req->ssid_len = ssid_len;
> set_bit(ASSOC_FLAG_SSID, &assoc_req->flags);
> lbs_postpone_association_work(priv);
> @@ -2085,7 +2085,7 @@
> }
>
> /* Check the size of the string */
> - if (dwrq->length > IW_ESSID_MAX_SIZE) {
> + if (dwrq->length > IEEE80211_MAX_SSID_LEN) {
> ret = -E2BIG;
> goto out;
> }
>
^ permalink raw reply
* Re: [PATCH] libertas: remove unused 11d.h as well, priv->countryinfo
From: Dan Williams @ 2009-10-21 18:16 UTC (permalink / raw)
To: Holger Schurig; +Cc: linux-wireless, John Linville
In-Reply-To: <200910191014.05320.hs4233@mail.mn-solutions.de>
On Mon, 2009-10-19 at 10:14 +0200, Holger Schurig wrote:
> Signed-off-by: Holger Schurig <hs4233@mail.mn-solutions.de>
Acked-by: Dan Williams <dcbw@redhat.com>
> --- linux-wl.orig/drivers/net/wireless/libertas/11d.h
> +++ /dev/null
> @@ -1,82 +0,0 @@
> -/**
> - * This header file contains data structures and
> - * function declarations of 802.11d
> - */
> -#ifndef _LBS_11D_
> -#define _LBS_11D_
> -
> -#include "types.h"
> -#include "defs.h"
> -
> -#define UNIVERSAL_REGION_CODE 0xff
> -
> -/** (Beaconsize(256)-5(IEId,len,contrystr(3))/3(FirstChan,NoOfChan,MaxPwr)
> - */
> -#define MRVDRV_MAX_SUBBAND_802_11D 83
> -
> -#define COUNTRY_CODE_LEN 3
> -#define MAX_NO_OF_CHAN 40
> -
> -struct cmd_ds_command;
> -
> -/** Data structure for Country IE*/
> -struct ieee_subbandset {
> - u8 firstchan;
> - u8 nrchan;
> - u8 maxtxpwr;
> -} __attribute__ ((packed));
> -
> -struct ieee_ie_country_info_set {
> - struct ieee_ie_header header;
> -
> - u8 countrycode[COUNTRY_CODE_LEN];
> - struct ieee_subbandset subband[1];
> -};
> -
> -struct ieee_ie_country_info_full_set {
> - struct ieee_ie_header header;
> -
> - u8 countrycode[COUNTRY_CODE_LEN];
> - struct ieee_subbandset subband[MRVDRV_MAX_SUBBAND_802_11D];
> -} __attribute__ ((packed));
> -
> -struct mrvl_ie_domain_param_set {
> - struct mrvl_ie_header header;
> -
> - u8 countrycode[COUNTRY_CODE_LEN];
> - struct ieee_subbandset subband[1];
> -} __attribute__ ((packed));
> -
> -struct cmd_ds_802_11d_domain_info {
> - __le16 action;
> - struct mrvl_ie_domain_param_set domain;
> -} __attribute__ ((packed));
> -
> -/** domain regulatory information */
> -struct lbs_802_11d_domain_reg {
> - /** country Code*/
> - u8 countrycode[COUNTRY_CODE_LEN];
> - /** No. of subband*/
> - u8 nr_subband;
> - struct ieee_subbandset subband[MRVDRV_MAX_SUBBAND_802_11D];
> -};
> -
> -struct chan_power_11d {
> - u8 chan;
> - u8 pwr;
> -} __attribute__ ((packed));
> -
> -struct parsed_region_chan_11d {
> - u8 band;
> - u8 region;
> - s8 countrycode[COUNTRY_CODE_LEN];
> - struct chan_power_11d chanpwr[MAX_NO_OF_CHAN];
> - u8 nr_chan;
> -} __attribute__ ((packed));
> -
> -struct region_code_mapping {
> - u8 region[COUNTRY_CODE_LEN];
> - u8 code;
> -};
> -
> -#endif
> --- linux-wl.orig/drivers/net/wireless/libertas/dev.h
> +++ linux-wl/drivers/net/wireless/libertas/dev.h
> @@ -360,8 +360,6 @@
> union ieee_phy_param_set phy;
> union ieee_ss_param_set ss;
>
> - struct ieee_ie_country_info_full_set countryinfo;
> -
> u8 wpa_ie[MAX_WPA_IE_LEN];
> size_t wpa_ie_len;
> u8 rsn_ie[MAX_WPA_IE_LEN];
> --- linux-wl.orig/drivers/net/wireless/libertas/host.h
> +++ linux-wl/drivers/net/wireless/libertas/host.h
> @@ -6,7 +6,8 @@
> #ifndef _LBS_HOST_H_
> #define _LBS_HOST_H_
>
> -#include "11d.h"
> +#include "types.h"
> +#include "defs.h"
>
> #define DEFAULT_AD_HOC_CHANNEL 6
>
> @@ -961,9 +962,6 @@
> struct cmd_ds_bbp_reg_access bbpreg;
> struct cmd_ds_rf_reg_access rfreg;
>
> - struct cmd_ds_802_11d_domain_info domaininfo;
> - struct cmd_ds_802_11d_domain_info domaininforesp;
> -
> struct cmd_ds_802_11_tpc_cfg tpccfg;
> struct cmd_ds_802_11_afc afc;
> struct cmd_ds_802_11_led_ctrl ledgpio;
> --- linux-wl.orig/drivers/net/wireless/libertas/scan.c
> +++ linux-wl/drivers/net/wireless/libertas/scan.c
> @@ -503,7 +503,6 @@
> struct ieee_ie_cf_param_set *cf;
> struct ieee_ie_ibss_param_set *ibss;
> DECLARE_SSID_BUF(ssid);
> - struct ieee_ie_country_info_set *pcountryinfo;
> uint8_t *pos, *end, *p;
> uint8_t n_ex_rates = 0, got_basic_rates = 0, n_basic_rates = 0;
> uint16_t beaconsize = 0;
> @@ -626,26 +625,6 @@
> lbs_deb_scan("got IBSS IE\n");
> break;
>
> - case WLAN_EID_COUNTRY:
> - pcountryinfo = (struct ieee_ie_country_info_set *) pos;
> - lbs_deb_scan("got COUNTRY IE\n");
> - if (pcountryinfo->header.len < sizeof(pcountryinfo->countrycode)
> - || pcountryinfo->header.len > 254) {
> - lbs_deb_scan("%s: 11D- Err CountryInfo len %d, min %zd, max 254\n",
> - __func__,
> - pcountryinfo->header.len,
> - sizeof(pcountryinfo->countrycode));
> - ret = -1;
> - goto done;
> - }
> -
> - memcpy(&bss->countryinfo, pcountryinfo,
> - pcountryinfo->header.len + 2);
> - lbs_deb_hex(LBS_DEB_SCAN, "process_bss: 11d countryinfo",
> - (uint8_t *) pcountryinfo,
> - (int) (pcountryinfo->header.len + 2));
> - break;
> -
> case WLAN_EID_EXT_SUPP_RATES:
> /* only process extended supported rate if data rate is
> * already found. Data rate IE should come before
>
^ permalink raw reply
* Re: l
From: Andrey Yurovsky @ 2009-10-21 18:23 UTC (permalink / raw)
To: Holger Schurig; +Cc: linux-wireless, Dan Williams, John Linville
In-Reply-To: <200910201513.10880.hs4233@mail.mn-solutions.de>
On Tue, Oct 20, 2009 at 6:13 AM, Holger Schurig
<hs4233@mail.mn-solutions.de> wrote:
> [PATCH] libertas spi: fix sparse errors
>
> This fixes the following sparse warnings:
>
> $ make modules SUBDIRS=drivers/net/wireless/libertas C=1 CF=-D__CHECK_ENDIAN__
> make: Entering directory `/usr/src/linux-wl'
> CHECK drivers/net/wireless/libertas/if_spi.c
> drivers/net/wireless/libertas/if_spi.c:137:16: warning: incorrect type in initializer (different base types)
> drivers/net/wireless/libertas/if_spi.c:137:16: expected unsigned short [unsigned] [usertype] reg_out
> drivers/net/wireless/libertas/if_spi.c:137:16: got restricted __le16 [usertype] <noident>
> drivers/net/wireless/libertas/if_spi.c:191:16: warning: incorrect type in initializer (different base types)
> drivers/net/wireless/libertas/if_spi.c:191:16: expected unsigned short [unsigned] [usertype] reg_out
> drivers/net/wireless/libertas/if_spi.c:191:16: got restricted __le16 [usertype] <noident>
> drivers/net/wireless/libertas/if_spi.c:256:24: warning: incorrect type in argument 1 (different base types)
> drivers/net/wireless/libertas/if_spi.c:256:24: expected restricted __le32 const [usertype] *p
> drivers/net/wireless/libertas/if_spi.c:256:24: got unsigned int *<noident>
> drivers/net/wireless/libertas/if_spi.c:243:24: warning: incorrect type in argument 1 (different base types)
> drivers/net/wireless/libertas/if_spi.c:243:24: expected restricted __le16 const [usertype] *p
> drivers/net/wireless/libertas/if_spi.c:243:24: got unsigned short *<noident>
> drivers/net/wireless/libertas/if_spi.c:171:7: warning: incorrect type in assignment (different base types)
> drivers/net/wireless/libertas/if_spi.c:171:7: expected unsigned short [unsigned] [usertype] buff
> drivers/net/wireless/libertas/if_spi.c:171:7: got restricted __le16 [usertype] <noident>
> drivers/net/wireless/libertas/if_spi.c:171:7: warning: incorrect type in assignment (different base types)
> drivers/net/wireless/libertas/if_spi.c:171:7: expected unsigned short [unsigned] [usertype] buff
> drivers/net/wireless/libertas/if_spi.c:171:7: got restricted __le16 [usertype] <noident>
> drivers/net/wireless/libertas/if_spi.c:171:7: warning: incorrect type in assignment (different base types)
> drivers/net/wireless/libertas/if_spi.c:171:7: expected unsigned short [unsigned] [usertype] buff
> drivers/net/wireless/libertas/if_spi.c:171:7: got restricted __le16 [usertype] <noident>
> drivers/net/wireless/libertas/if_spi.c:171:7: warning: incorrect type in assignment (different base types)
> drivers/net/wireless/libertas/if_spi.c:171:7: expected unsigned short [unsigned] [usertype] buff
> drivers/net/wireless/libertas/if_spi.c:171:7: got restricted __le16 [usertype] <noident>
> drivers/net/wireless/libertas/if_spi.c:171:7: warning: incorrect type in assignment (different base types)
> drivers/net/wireless/libertas/if_spi.c:171:7: expected unsigned short [unsigned] [usertype] buff
> drivers/net/wireless/libertas/if_spi.c:171:7: got restricted __le16 [usertype] <noident>
> drivers/net/wireless/libertas/if_spi.c:243:24: warning: incorrect type in argument 1 (different base types)
> drivers/net/wireless/libertas/if_spi.c:243:24: expected restricted __le16 const [usertype] *p
> drivers/net/wireless/libertas/if_spi.c:243:24: got unsigned short *<noident>
> drivers/net/wireless/libertas/if_spi.c:171:7: warning: incorrect type in assignment (different base types)
> drivers/net/wireless/libertas/if_spi.c:171:7: expected unsigned short [unsigned] [usertype] buff
> drivers/net/wireless/libertas/if_spi.c:171:7: got restricted __le16 [usertype] <noident>
> drivers/net/wireless/libertas/if_spi.c:171:7: warning: incorrect type in assignment (different base types)
> drivers/net/wireless/libertas/if_spi.c:171:7: expected unsigned short [unsigned] [usertype] buff
> drivers/net/wireless/libertas/if_spi.c:171:7: got restricted __le16 [usertype] <noident>
> drivers/net/wireless/libertas/if_spi.c:171:7: warning: incorrect type in assignment (different base types)
> drivers/net/wireless/libertas/if_spi.c:171:7: expected unsigned short [unsigned] [usertype] buff
> drivers/net/wireless/libertas/if_spi.c:171:7: got restricted __le16 [usertype] <noident>
> drivers/net/wireless/libertas/if_spi.c:171:7: warning: incorrect type in assignment (different base types)
> drivers/net/wireless/libertas/if_spi.c:171:7: expected unsigned short [unsigned] [usertype] buff
> drivers/net/wireless/libertas/if_spi.c:171:7: got restricted __le16 [usertype] <noident>
> drivers/net/wireless/libertas/if_spi.c:171:7: warning: incorrect type in assignment (different base types)
> drivers/net/wireless/libertas/if_spi.c:171:7: expected unsigned short [unsigned] [usertype] buff
> drivers/net/wireless/libertas/if_spi.c:171:7: got restricted __le16 [usertype] <noident>
> drivers/net/wireless/libertas/if_spi.c:171:7: warning: incorrect type in assignment (different base types)
> drivers/net/wireless/libertas/if_spi.c:171:7: expected unsigned short [unsigned] [usertype] buff
> drivers/net/wireless/libertas/if_spi.c:171:7: got restricted __le16 [usertype] <noident>
> drivers/net/wireless/libertas/if_spi.c:243:24: warning: incorrect type in argument 1 (different base types)
> drivers/net/wireless/libertas/if_spi.c:243:24: expected restricted __le16 const [usertype] *p
> drivers/net/wireless/libertas/if_spi.c:243:24: got unsigned short *<noident>
> drivers/net/wireless/libertas/if_spi.c:171:7: warning: incorrect type in assignment (different base types)
> drivers/net/wireless/libertas/if_spi.c:171:7: expected unsigned short [unsigned] [usertype] buff
> drivers/net/wireless/libertas/if_spi.c:171:7: got restricted __le16 [usertype] <noident>
> drivers/net/wireless/libertas/if_spi.c:171:7: warning: incorrect type in assignment (different base types)
> drivers/net/wireless/libertas/if_spi.c:171:7: expected unsigned short [unsigned] [usertype] buff
> drivers/net/wireless/libertas/if_spi.c:171:7: got restricted __le16 [usertype] <noident>
> drivers/net/wireless/libertas/if_spi.c:243:24: warning: incorrect type in argument 1 (different base types)
> drivers/net/wireless/libertas/if_spi.c:243:24: expected restricted __le16 const [usertype] *p
> drivers/net/wireless/libertas/if_spi.c:243:24: got unsigned short *<noident>
> drivers/net/wireless/libertas/if_spi.c:243:24: warning: incorrect type in argument 1 (different base types)
> drivers/net/wireless/libertas/if_spi.c:243:24: expected restricted __le16 const [usertype] *p
> drivers/net/wireless/libertas/if_spi.c:243:24: got unsigned short *<noident>
> drivers/net/wireless/libertas/if_spi.c:171:7: warning: incorrect type in assignment (different base types)
> drivers/net/wireless/libertas/if_spi.c:171:7: expected unsigned short [unsigned] [usertype] buff
> drivers/net/wireless/libertas/if_spi.c:171:7: got restricted __le16 [usertype] <noident>
> drivers/net/wireless/libertas/if_spi.c:171:7: warning: incorrect type in assignment (different base types)
> drivers/net/wireless/libertas/if_spi.c:171:7: expected unsigned short [unsigned] [usertype] buff
> drivers/net/wireless/libertas/if_spi.c:171:7: got restricted __le16 [usertype] <noident>
> drivers/net/wireless/libertas/if_spi.c:243:24: warning: incorrect type in argument 1 (different base types)
> drivers/net/wireless/libertas/if_spi.c:243:24: expected restricted __le16 const [usertype] *p
> drivers/net/wireless/libertas/if_spi.c:243:24: got unsigned short *<noident>
>
> Signed-off-by: Holger Schurig <hs4233@mail.mn-solutions.de>
>
> ---
>
> Andrey, can you test this?
>
> Dan, John: this is completely unrelated to my other libertas patches
>
> --- linux-wl.orig/drivers/net/wireless/libertas/if_spi.c
> +++ linux-wl/drivers/net/wireless/libertas/if_spi.c
> @@ -134,7 +134,7 @@
> static int spu_write(struct if_spi_card *card, u16 reg, const u8 *buf, int len)
> {
> int err = 0;
> - u16 reg_out = cpu_to_le16(reg | IF_SPI_WRITE_OPERATION_MASK);
> + __le16 reg_out = cpu_to_le16(reg | IF_SPI_WRITE_OPERATION_MASK);
> struct spi_message m;
> struct spi_transfer reg_trans;
> struct spi_transfer data_trans;
> @@ -166,7 +166,7 @@
>
> static inline int spu_write_u16(struct if_spi_card *card, u16 reg, u16 val)
> {
> - u16 buff;
> + __le16 buff;
>
> buff = cpu_to_le16(val);
> return spu_write(card, reg, (u8 *)&buff, sizeof(u16));
> @@ -188,7 +188,7 @@
> {
> unsigned int delay;
> int err = 0;
> - u16 reg_out = cpu_to_le16(reg | IF_SPI_READ_OPERATION_MASK);
> + __le16 reg_out = cpu_to_le16(reg | IF_SPI_READ_OPERATION_MASK);
> struct spi_message m;
> struct spi_transfer reg_trans;
> struct spi_transfer dummy_trans;
> @@ -235,7 +235,7 @@
> /* Read 16 bits from an SPI register */
> static inline int spu_read_u16(struct if_spi_card *card, u16 reg, u16 *val)
> {
> - u16 buf;
> + __le16 buf;
> int ret;
>
> ret = spu_read(card, reg, (u8 *)&buf, sizeof(buf));
> @@ -248,7 +248,7 @@
> * The low 16 bits are read first. */
> static int spu_read_u32(struct if_spi_card *card, u16 reg, u32 *val)
> {
> - u32 buf;
> + __le32 buf;
> int err;
>
> err = spu_read(card, reg, (u8 *)&buf, sizeof(buf));
>
> --
> http://www.holgerschurig.de
>
Tested-by: Andrey Yurovsky <andrey@cozybit.com>
On a Blackfin (LE) machine. Also, please fix the subject line : )
^ permalink raw reply
* Re: [PATCH] libertas: remove handling for CMD_802_11_LED_GPIO_CTRL
From: Dan Williams @ 2009-10-21 18:28 UTC (permalink / raw)
To: Holger Schurig; +Cc: linux-wireless, John Linville
In-Reply-To: <200910191331.20476.hs4233@mail.mn-solutions.de>
On Mon, 2009-10-19 at 13:31 +0200, Holger Schurig wrote:
> ... which just resided as an old-style command in cmd/cmdresp, but
> was nowhere useed. If we ever need it, we can re-add it as a newstyle
> command.
It's actually used by the OLPC folks; but right now there's simply no
mechanism to configure that ability via WEXT. Is there some way to do
this via the kernel LED framework instead that libertas should be
using?
Dan
> Signed-off-by: Holger Schurig <hs4233@mail.mn-solutions.de>
>
> --- linux-wl.orig/drivers/net/wireless/libertas/cmd.c
> +++ linux-wl/drivers/net/wireless/libertas/cmd.c
> @@ -1181,29 +1181,6 @@
>
> ret = 0;
> break;
> - case CMD_802_11_LED_GPIO_CTRL:
> - {
> - struct mrvl_ie_ledgpio *gpio =
> - (struct mrvl_ie_ledgpio*)
> - cmdptr->params.ledgpio.data;
> -
> - memmove(&cmdptr->params.ledgpio,
> - pdata_buf,
> - sizeof(struct cmd_ds_802_11_led_ctrl));
> -
> - cmdptr->command =
> - cpu_to_le16(CMD_802_11_LED_GPIO_CTRL);
> -
> -#define ACTION_NUMLED_TLVTYPE_LEN_FIELDS_LEN 8
> - cmdptr->size =
> - cpu_to_le16(le16_to_cpu(gpio->header.len)
> - + S_DS_GEN
> - + ACTION_NUMLED_TLVTYPE_LEN_FIELDS_LEN);
> - gpio->header.len = gpio->header.len;
> -
> - ret = 0;
> - break;
> - }
>
> case CMD_BT_ACCESS:
> ret = lbs_cmd_bt_access(cmdptr, cmd_action, pdata_buf);
> --- linux-wl.orig/drivers/net/wireless/libertas/cmdresp.c
> +++ linux-wl/drivers/net/wireless/libertas/cmdresp.c
> @@ -187,12 +187,6 @@
> sizeof(struct cmd_ds_802_11_tpc_cfg));
> spin_unlock_irqrestore(&priv->driver_lock, flags);
> break;
> - case CMD_RET(CMD_802_11_LED_GPIO_CTRL):
> - spin_lock_irqsave(&priv->driver_lock, flags);
> - memmove((void *)priv->cur_cmd->callback_arg, &resp->params.ledgpio,
> - sizeof(struct cmd_ds_802_11_led_ctrl));
> - spin_unlock_irqrestore(&priv->driver_lock, flags);
> - break;
>
> case CMD_RET(CMD_GET_TSF):
> spin_lock_irqsave(&priv->driver_lock, flags);
>
^ permalink raw reply
* Re: [RFC] libertas: monster-patch to make CFG/WEXT configurable
From: Dan Williams @ 2009-10-21 18:36 UTC (permalink / raw)
To: Holger Schurig; +Cc: linux-wireless
In-Reply-To: <200910191449.18915.hs4233@mail.mn-solutions.de>
On Mon, 2009-10-19 at 14:49 +0200, Holger Schurig wrote:
> This is a monster patch that makes CFG80211/WEXT operation
> configurable. My cfg80211-RFC/WIP-Patch would come on top of it,
> but would then be quite small, e.g. almost only changed to
> cfg.c/cfg.h.
>
> As there's no mesh/adhoc/monitor mode implemented in cfg80211-
> mode, I added many, many #ifdef/#endif pairs. Maybe too many.
> Is this too ugly? Or would this patch be applyable as-is ?
For the mesh interface stuff, especially in tx/rx paths, would you mind
not ifdefing that? Since with cfg80211, priv->mesh_dev will always be
NULL, those checks will be just fine and you still don't have to care
about mesh.
I'm sure that the bits for SNMP_MIB_OID_BSS_TYPE could also be converted
to use lib80211 or cfg80211 values instead of WEXT ones; I just picked
WEXT at the time because we had no cfg80211 yet.
Stuff like lbs_cmd_bt_access doesn't need to be ifdefed either, because
it simply won't be called if the debugfs bits are disabled.
I'm sure the WEXT-specific lbs_mac_event_disconnected bits could also be
abstracted like you did with the IWAP stuff a few patches ago too.
Basically, I don't mind having some ifdefs; but I think there are way
too many in that patch. Not all the mesh stuff needs to be disabled
just for cfg80211.
> If the patch is perceived to be too ugly, I could create an
> monitor.h/monitor.c file and singleout everything related to
> monitoring in it, where monitor.h would resolv to dummy static
> functions in the cfg80211-case ... at least as long as we don't
> have monitor suppport in libertas+cfg80211. The same for mesh
> support, e.g. here I could create a mesh.h/mesh.c and do the
> same.
>
> Signed-off-by: Holger Schurig <hs4233@mail.mn-solutions.de>
>
> --- linux-wl.orig/drivers/net/wireless/libertas/Kconfig
> +++ linux-wl/drivers/net/wireless/libertas/Kconfig
> @@ -37,3 +37,29 @@
> depends on LIBERTAS
> ---help---
> Debugging support.
> +
> +choice
> + prompt "interface to user-space"
> + depends on LIBERTAS
> + default LIBERTAS_WEXT
> +
> +config LIBERTAS_WEXT
> + bool "WEXT"
> + help
> + This is the old Libertas code as it always used to be:
> + configuration done via "iwconfig" or "wpa_supplicant -Dwext",
> + associating via libertas-internal code. This is currently the only
> + way to support:
> +
> + * AD-HOC
> + * Libertas' MESH
> + * Monitor interface ("rtap")
> +
> +config LIBERTAS_CFG80211
> + bool "CFG80211"
> + depends on EXPERIMENTAL
> + help
> + This is new new way of wireless: use cfg80211 for all, e.g.
> + "iw" or "wpa_supplicant -Dnl80211".
> +
> +endchoice
> --- linux-wl.orig/drivers/net/wireless/libertas/Makefile
> +++ linux-wl/drivers/net/wireless/libertas/Makefile
> @@ -1,15 +1,15 @@
> -libertas-y += assoc.o
> libertas-y += cfg.o
> libertas-y += cmd.o
> libertas-y += cmdresp.o
> libertas-y += debugfs.o
> -libertas-y += ethtool.o
> libertas-y += main.o
> -libertas-y += persistcfg.o
> libertas-y += rx.o
> -libertas-y += scan.o
> libertas-y += tx.o
> -libertas-y += wext.o
> +libertas-$(CONFIG_LIBERTAS_WEXT) += assoc.o
> +libertas-$(CONFIG_LIBERTAS_WEXT) += ethtool.o
> +libertas-$(CONFIG_LIBERTAS_WEXT) += persistcfg.o
> +libertas-$(CONFIG_LIBERTAS_WEXT) += scan.o
> +libertas-$(CONFIG_LIBERTAS_WEXT) += wext.o
>
> usb8xxx-objs += if_usb.o
> libertas_cs-objs += if_cs.o
> --- linux-wl.orig/drivers/net/wireless/libertas/cmd.c
> +++ linux-wl/drivers/net/wireless/libertas/cmd.c
> @@ -3,7 +3,6 @@
> * It prepares command and sends it to firmware when it is ready.
> */
>
> -#include <net/iw_handler.h>
> #include <net/lib80211.h>
> #include <linux/kfifo.h>
> #include <linux/sched.h>
> @@ -184,6 +183,8 @@
> memmove(priv->current_addr, cmd.permanentaddr, ETH_ALEN);
>
> memcpy(priv->dev->dev_addr, priv->current_addr, ETH_ALEN);
> +
> +#ifdef CONFIG_LIBERTAS_WEXT
> if (priv->mesh_dev)
> memcpy(priv->mesh_dev->dev_addr, priv->current_addr, ETH_ALEN);
>
> @@ -191,6 +192,7 @@
> ret = -1;
> goto out;
> }
> +#endif
>
> out:
> lbs_deb_leave(LBS_DEB_CMD);
> @@ -387,10 +389,12 @@
> cmd.oid = cpu_to_le16((u16) oid);
>
> switch (oid) {
> +#ifdef CONFIG_LIBERTAS_WEXT
> case SNMP_MIB_OID_BSS_TYPE:
> cmd.bufsize = cpu_to_le16(sizeof(u8));
> cmd.value[0] = (val == IW_MODE_ADHOC) ? 2 : 1;
> break;
> +#endif
> case SNMP_MIB_OID_11D_ENABLE:
> case SNMP_MIB_OID_FRAG_THRESHOLD:
> case SNMP_MIB_OID_RTS_THRESHOLD:
> @@ -442,12 +446,14 @@
>
> switch (le16_to_cpu(cmd.bufsize)) {
> case sizeof(u8):
> +#ifdef CONFIG_LIBERTAS_WEXT
> if (oid == SNMP_MIB_OID_BSS_TYPE) {
> if (cmd.value[0] == 2)
> *out_val = IW_MODE_ADHOC;
> else
> *out_val = IW_MODE_INFRA;
> } else
> +#endif
> *out_val = cmd.value[0];
> break;
> case sizeof(u16):
> @@ -702,6 +708,7 @@
> return 0;
> }
>
> +#ifdef CONFIG_LIBERTAS_WEXT
> static int lbs_cmd_bt_access(struct cmd_ds_command *cmd,
> u16 cmd_action, void *pdata_buf)
> {
> @@ -868,6 +875,7 @@
>
> return __lbs_mesh_config_send(priv, &cmd, action, priv->mesh_tlv);
> }
> +#endif
>
> static void lbs_queue_cmd(struct lbs_private *priv,
> struct cmd_ctrl_node *cmdnode)
> @@ -1155,10 +1163,6 @@
> cmd_action, pdata_buf);
> break;
>
> - case CMD_802_11_RSSI:
> - ret = lbs_cmd_802_11_rssi(priv, cmdptr);
> - break;
> -
> case CMD_802_11_SET_AFC:
> case CMD_802_11_GET_AFC:
>
> @@ -1184,6 +1188,11 @@
> ret = 0;
> break;
>
> +#ifdef CONFIG_LIBERTAS_WEXT
> + case CMD_802_11_RSSI:
> + ret = lbs_cmd_802_11_rssi(priv, cmdptr);
> + break;
> +
> case CMD_BT_ACCESS:
> ret = lbs_cmd_bt_access(cmdptr, cmd_action, pdata_buf);
> break;
> @@ -1195,6 +1204,8 @@
> case CMD_802_11_BEACON_CTRL:
> ret = lbs_cmd_bcn_ctrl(priv, cmdptr, cmd_action);
> break;
> +#endif
> +
> case CMD_802_11_DEEP_SLEEP:
> cmdptr->command = cpu_to_le16(CMD_802_11_DEEP_SLEEP);
> cmdptr->size = cpu_to_le16(sizeof(struct cmd_header));
> @@ -1487,6 +1498,7 @@
> * check if in power save mode, if yes, put the device back
> * to PS mode
> */
> +#ifdef CONFIG_LIBERTAS_WEXT
> if ((priv->psmode != LBS802_11POWERMODECAM) &&
> (priv->psstate == PS_STATE_FULL_POWER) &&
> ((priv->connect_status == LBS_CONNECTED) ||
> @@ -1508,6 +1520,9 @@
> lbs_ps_sleep(priv, 0);
> }
> }
> +#else
> + /* TODO: we need to figure out what to do here in cfg80211-mode */
> +#endif
> }
>
> ret = 0;
> --- linux-wl.orig/drivers/net/wireless/libertas/dev.h
> +++ linux-wl/drivers/net/wireless/libertas/dev.h
> @@ -6,8 +6,10 @@
> #ifndef _LBS_DEV_H_
> #define _LBS_DEV_H_
>
> +#include "defs.h"
> #include "scan.h"
> #include "assoc.h"
> +#include "host.h"
>
>
>
> @@ -21,6 +23,9 @@
> uint16_t sp_reserved;
> };
>
> +
> +#ifdef CONFIG_LIBERTAS_WEXT
> +
> /* Mesh statistics */
> struct lbs_mesh_stats {
> u32 fwd_bcast_cnt; /* Fwd: Broadcast counter */
> @@ -32,6 +37,8 @@
> u32 drop_blind; /* Rx: Dropped by blinding table */
> u32 tx_failed_cnt; /* Tx: Failed transmissions */
> };
> +#endif
> +
>
> /** Private structure for the MV device */
> struct lbs_private {
> @@ -48,11 +55,11 @@
> struct wireless_dev *wdev;
>
> /* Mesh */
> +#ifdef CONFIG_LIBERTAS_WEXT
> struct net_device *mesh_dev; /* Virtual device */
> u32 mesh_connect_status;
> struct lbs_mesh_stats mstats;
> int mesh_open;
> - int mesh_fw_ver;
> int mesh_autostart_enabled;
> uint16_t mesh_tlv;
> u8 mesh_ssid[IEEE80211_MAX_SSID_LEN + 1];
> @@ -62,6 +69,7 @@
> /* Monitor mode */
> struct net_device *rtap_net_dev;
> u32 monitormode;
> +#endif
>
> /* Debugfs */
> struct dentry *debugfs_dir;
> @@ -103,6 +111,7 @@
> int (*reset_deep_sleep_wakeup) (struct lbs_private *priv);
>
> /* Adapter info (from EEPROM) */
> + int mesh_fw_ver;
> u32 fwrelease;
> u32 fwcapinfo;
> u16 regioncode;
> @@ -138,11 +147,13 @@
> struct workqueue_struct *work_thread;
>
> /** Encryption stuff */
> +#ifdef CONFIG_LIBERTAS_WEXT
> 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;
> +#endif
> u16 wep_tx_keyidx;
> struct enc_key wep_keys[4];
>
> @@ -163,6 +174,7 @@
> spinlock_t driver_lock;
>
> /* NIC/link operation characteristics */
> + u16 capability;
> u16 mac_control;
> u8 radio_on;
> u8 channel;
> @@ -174,6 +186,7 @@
> struct delayed_work scan_work;
> int scan_channel;
> /* remember which channel was scanned last, != 0 if currently scanning */
> +#ifdef CONFIG_LIBERTAS_WEXT
> u8 scan_ssid[IEEE80211_MAX_SSID_LEN + 1];
> u8 scan_ssid_len;
>
> @@ -186,7 +199,6 @@
> struct bss_descriptor *networks;
> struct assoc_request * pending_assoc_req;
> struct assoc_request * in_progress_assoc_req;
> - u16 capability;
> uint16_t enablehwauto;
> uint16_t ratebitmap;
>
> @@ -211,6 +223,7 @@
> u8 rawNF[DEFAULT_DATA_AVG_FACTOR];
> u16 nextSNRNF;
> u16 numSNRNF;
> +#endif
> };
>
> extern struct cmd_confirm_sleep confirm_sleep;
> --- linux-wl.orig/drivers/net/wireless/libertas/main.c
> +++ linux-wl/drivers/net/wireless/libertas/main.c
> @@ -13,7 +13,6 @@
> #include <linux/kfifo.h>
> #include <linux/stddef.h>
> #include <linux/ieee80211.h>
> -#include <net/iw_handler.h>
> #include <net/cfg80211.h>
>
> #include "host.h"
> @@ -98,6 +97,7 @@
> * Attributes exported through sysfs
> */
>
> +#ifdef CONFIG_LIBERTAS_WEXT
> /**
> * @brief Get function for sysfs attribute anycast_mask
> */
> @@ -325,6 +325,8 @@
> static struct attribute_group lbs_mesh_attr_group = {
> .attrs = lbs_mesh_sysfs_entries,
> };
> +#endif
> +
>
> /**
> * @brief This function opens the ethX or mshX interface
> @@ -341,6 +343,7 @@
>
> spin_lock_irq(&priv->driver_lock);
>
> +#ifdef CONFIG_LIBERTAS_WEXT
> if (priv->monitormode) {
> ret = -EBUSY;
> goto out;
> @@ -351,6 +354,9 @@
> priv->mesh_connect_status = LBS_CONNECTED;
> netif_carrier_on(dev);
> } else {
> +#else
> + if (1) {
> +#endif
> priv->infra_open = 1;
>
> if (priv->connect_status == LBS_CONNECTED)
> @@ -361,13 +367,16 @@
>
> if (!priv->tx_pending_len)
> netif_wake_queue(dev);
> - out:
>
> +#ifdef CONFIG_LIBERTAS_WEXT
> + out:
> +#endif
> spin_unlock_irq(&priv->driver_lock);
> lbs_deb_leave_args(LBS_DEB_NET, "ret %d", ret);
> return ret;
> }
>
> +#ifdef CONFIG_LIBERTAS_WEXT
> /**
> * @brief This function closes the mshX interface
> *
> @@ -383,7 +392,6 @@
>
> priv->mesh_open = 0;
> priv->mesh_connect_status = LBS_DISCONNECTED;
> -
> netif_stop_queue(dev);
> netif_carrier_off(dev);
>
> @@ -394,6 +402,7 @@
> lbs_deb_leave(LBS_DEB_MESH);
> return 0;
> }
> +#endif
>
> /**
> * @brief This function closes the ethX interface
> @@ -428,8 +437,10 @@
>
> dev->trans_start = jiffies;
>
> +#ifdef CONFIG_LIBERTAS_WEXT
> if (priv->currenttxskb)
> lbs_send_tx_feedback(priv, 0);
> +#endif
>
> /* XX: Shouldn't we also call into the hw-specific driver
> to kick it somehow? */
> @@ -490,8 +501,10 @@
>
> memcpy(priv->current_addr, phwaddr->sa_data, ETH_ALEN);
> memcpy(dev->dev_addr, phwaddr->sa_data, ETH_ALEN);
> +#ifdef CONFIG_LIBERTAS_WEXT
> if (priv->mesh_dev)
> memcpy(priv->mesh_dev->dev_addr, phwaddr->sa_data, ETH_ALEN);
> +#endif
>
> done:
> lbs_deb_leave_args(LBS_DEB_NET, "ret %d", ret);
> @@ -554,8 +567,10 @@
> lbs_deb_enter(LBS_DEB_NET);
>
> dev_flags = priv->dev->flags;
> +#ifdef CONFIG_LIBERTAS_WEXT
> if (priv->mesh_dev)
> dev_flags |= priv->mesh_dev->flags;
> +#endif
>
> if (dev_flags & IFF_PROMISC) {
> priv->mac_control |= CMD_ACT_MAC_PROMISCUOUS_ENABLE;
> @@ -572,8 +587,10 @@
>
> /* Once for priv->dev, again for priv->mesh_dev if it exists */
> nr_addrs = lbs_add_mcast_addrs(&mcast_cmd, priv->dev, 0);
> +#ifdef CONFIG_LIBERTAS_WEXT
> if (nr_addrs >= 0 && priv->mesh_dev)
> nr_addrs = lbs_add_mcast_addrs(&mcast_cmd, priv->mesh_dev, nr_addrs);
> +#endif
> if (nr_addrs < 0)
> goto do_allmulti;
>
> @@ -816,9 +833,11 @@
> waiting for TX feedback */
> if (priv->connect_status == LBS_CONNECTED)
> netif_wake_queue(priv->dev);
> +#ifdef CONFIG_LIBERTAS_WEXT
> if (priv->mesh_dev &&
> priv->mesh_connect_status == LBS_CONNECTED)
> netif_wake_queue(priv->mesh_dev);
> +#endif
> }
> }
> spin_unlock_irq(&priv->driver_lock);
> @@ -838,8 +857,10 @@
> lbs_deb_enter(LBS_DEB_FW);
>
> netif_device_detach(priv->dev);
> +#ifdef CONFIG_LIBERTAS_WEXT
> if (priv->mesh_dev)
> netif_device_detach(priv->mesh_dev);
> +#endif
>
> priv->fw_ready = 0;
> lbs_deb_leave(LBS_DEB_FW);
> @@ -882,8 +903,10 @@
> 0, 0, NULL);
>
> netif_device_attach(priv->dev);
> +#ifdef CONFIG_LIBERTAS_WEXT
> if (priv->mesh_dev)
> netif_device_attach(priv->mesh_dev);
> +#endif
>
> lbs_deb_leave(LBS_DEB_FW);
> }
> @@ -1004,6 +1027,7 @@
> return 0;
> }
>
> +#ifdef CONFIG_LIBERTAS_WEXT
> static void lbs_sync_channel_worker(struct work_struct *work)
> {
> struct lbs_private *priv = container_of(work, struct lbs_private,
> @@ -1014,15 +1038,19 @@
> lbs_pr_info("Channel synchronization failed.");
> lbs_deb_leave(LBS_DEB_MAIN);
> }
> -
> +#endif
>
> static int lbs_init_adapter(struct lbs_private *priv)
> {
> + int ret = 0;
> +#ifdef CONFIG_LIBERTAS_WEXT
> size_t bufsize;
> - int i, ret = 0;
> + int i;
> +#endif
>
> lbs_deb_enter(LBS_DEB_MAIN);
>
> +#ifdef CONFIG_LIBERTAS_WEXT
> /* Allocate buffer to store the BSSID list */
> bufsize = MAX_NETWORK_COUNT * sizeof(struct bss_descriptor);
> priv->networks = kzalloc(bufsize, GFP_KERNEL);
> @@ -1039,17 +1067,18 @@
> list_add_tail(&priv->networks[i].list,
> &priv->network_free_list);
> }
> + priv->secinfo.auth_mode = IW_AUTH_ALG_OPEN_SYSTEM;
> + priv->mode = IW_MODE_INFRA;
> + priv->enablehwauto = 1;
> + priv->mesh_connect_status = LBS_DISCONNECTED;
> +#endif
>
> memset(priv->current_addr, 0xff, ETH_ALEN);
>
> priv->connect_status = LBS_DISCONNECTED;
> - priv->mesh_connect_status = LBS_DISCONNECTED;
> - priv->secinfo.auth_mode = IW_AUTH_ALG_OPEN_SYSTEM;
> - priv->mode = IW_MODE_INFRA;
> priv->channel = DEFAULT_AD_HOC_CHANNEL;
> priv->mac_control = CMD_ACT_MAC_RX_ON | CMD_ACT_MAC_TX_ON;
> priv->radio_on = 1;
> - priv->enablehwauto = 1;
> priv->capability = WLAN_CAPABILITY_SHORT_PREAMBLE;
> priv->psmode = LBS802_11POWERMODECAM;
> priv->psstate = PS_STATE_FULL_POWER;
> @@ -1103,8 +1132,10 @@
> kfifo_free(priv->event_fifo);
> del_timer(&priv->command_timer);
> del_timer(&priv->auto_deepsleep_timer);
> +#ifdef CONFIG_LIBERTAS_WEXT
> kfree(priv->networks);
> priv->networks = NULL;
> +#endif
>
> lbs_deb_leave(LBS_DEB_MAIN);
> }
> @@ -1166,8 +1197,8 @@
>
> dev->netdev_ops = &lbs_netdev_ops;
> dev->watchdog_timeo = 5 * HZ;
> +#ifdef CONFIG_LIBERTAS_WEXT
> dev->ethtool_ops = &lbs_ethtool_ops;
> -#ifdef WIRELESS_EXT
> dev->wireless_handlers = &lbs_handler_def;
> #endif
> dev->flags |= IFF_BROADCAST | IFF_MULTICAST;
> @@ -1177,11 +1208,8 @@
>
>
> priv->card = card;
> - priv->mesh_open = 0;
> priv->infra_open = 0;
>
> -
> - priv->rtap_net_dev = NULL;
> strcpy(dev->name, "wlan%d");
>
> lbs_deb_thread("Starting main thread...\n");
> @@ -1193,13 +1221,18 @@
> }
>
> priv->work_thread = create_singlethread_workqueue("lbs_worker");
> - INIT_DELAYED_WORK(&priv->assoc_work, lbs_association_worker);
> - INIT_DELAYED_WORK(&priv->scan_work, lbs_scan_worker);
> - INIT_WORK(&priv->mcast_work, lbs_set_mcast_worker);
> - INIT_WORK(&priv->sync_channel, lbs_sync_channel_worker);
> +#ifdef CONFIG_LIBERTAS_WEXT
> + priv->rtap_net_dev = NULL;
>
> sprintf(priv->mesh_ssid, "mesh");
> priv->mesh_ssid_len = 4;
> + priv->mesh_open = 0;
> +
> + INIT_DELAYED_WORK(&priv->assoc_work, lbs_association_worker);
> + INIT_DELAYED_WORK(&priv->scan_work, lbs_scan_worker);
> + INIT_WORK(&priv->sync_channel, lbs_sync_channel_worker);
> +#endif
> + INIT_WORK(&priv->mcast_work, lbs_set_mcast_worker);
>
> priv->wol_criteria = 0xffffffff;
> priv->wol_gpio = 0xff;
> @@ -1231,13 +1264,15 @@
>
> lbs_deb_enter(LBS_DEB_MAIN);
>
> + dev = priv->dev;
> +
> +#ifdef CONFIG_LIBERTAS_WEXT
> lbs_remove_mesh(priv);
> lbs_remove_rtap(priv);
>
> - dev = priv->dev;
> -
> cancel_delayed_work_sync(&priv->scan_work);
> cancel_delayed_work_sync(&priv->assoc_work);
> +#endif
> cancel_work_sync(&priv->mcast_work);
>
> /* worker thread destruction blocks on the in-flight command which
> @@ -1295,6 +1330,7 @@
>
> lbs_update_channel(priv);
>
> +#ifdef CONFIG_LIBERTAS_WEXT
> /* Check mesh FW version and appropriately send the mesh start
> * command
> */
> @@ -1342,6 +1378,7 @@
> if (device_create_file(&dev->dev, &dev_attr_lbs_rtap))
> lbs_pr_err("cannot register lbs_rtap attribute\n");
> }
> +#endif
>
> lbs_debugfs_init_one(priv, dev);
>
> @@ -1372,10 +1409,12 @@
> netif_carrier_off(dev);
>
> lbs_debugfs_remove_one(priv);
> +#ifdef CONFIG_LIBERTAS_WEXT
> if (priv->mesh_tlv) {
> device_remove_file(&dev->dev, &dev_attr_lbs_mesh);
> device_remove_file(&dev->dev, &dev_attr_lbs_rtap);
> }
> +#endif
>
> /* Delete the timeout of the currently processing command */
> del_timer_sync(&priv->command_timer);
> @@ -1408,6 +1447,7 @@
> EXPORT_SYMBOL_GPL(lbs_stop_card);
>
>
> +#ifdef CONFIG_LIBERTAS_WEXT
> static const struct net_device_ops mesh_netdev_ops = {
> .ndo_open = lbs_dev_open,
> .ndo_stop = lbs_mesh_stop,
> @@ -1445,7 +1485,7 @@
>
> SET_NETDEV_DEV(priv->mesh_dev, priv->dev->dev.parent);
>
> -#ifdef WIRELESS_EXT
> +#ifdef CONFIG_LIBERTAS_WEXT
> mesh_dev->wireless_handlers = (struct iw_handler_def *)&mesh_handler_def;
> #endif
> mesh_dev->flags |= IFF_BROADCAST | IFF_MULTICAST;
> @@ -1496,6 +1536,7 @@
> free_netdev(mesh_dev);
> lbs_deb_leave(LBS_DEB_MESH);
> }
> +#endif
>
> void lbs_queue_event(struct lbs_private *priv, u32 event)
> {
> @@ -1556,6 +1597,7 @@
> * rtap interface support fuctions
> */
>
> +#ifdef CONFIG_LIBERTAS_WEXT
> static int lbs_rtap_open(struct net_device *dev)
> {
> /* Yes, _stop_ the queue. Because we don't support injection */
> @@ -1632,6 +1674,7 @@
> lbs_deb_leave_args(LBS_DEB_MAIN, "ret %d", ret);
> return ret;
> }
> +#endif
>
> module_init(lbs_init_module);
> module_exit(lbs_exit_module);
> --- linux-wl.orig/drivers/net/wireless/libertas/cmdresp.c
> +++ linux-wl/drivers/net/wireless/libertas/cmdresp.c
> @@ -7,7 +7,6 @@
> #include <linux/if_arp.h>
> #include <linux/netdevice.h>
> #include <asm/unaligned.h>
> -#include <net/iw_handler.h>
>
> #include "host.h"
> #include "decl.h"
> @@ -27,13 +26,16 @@
> */
> void lbs_mac_event_disconnected(struct lbs_private *priv)
> {
> +#ifdef CONFIG_LIBERTAS_WEXT
> union iwreq_data wrqu;
> +#endif
>
> if (priv->connect_status != LBS_CONNECTED)
> return;
>
> lbs_deb_enter(LBS_DEB_ASSOC);
>
> +#ifdef CONFIG_LIBERTAS_WEXT
> memset(wrqu.ap_addr.sa_data, 0x00, ETH_ALEN);
> wrqu.ap_addr.sa_family = ARPHRD_ETHER;
>
> @@ -44,6 +46,9 @@
>
> msleep_interruptible(1000);
> wireless_send_event(priv->dev, SIOCGIWAP, &wrqu, NULL);
> +#else
> + /* TODO: find out what to do in the cfg80211 case */
> +#endif
>
> /* report disconnect to upper layer */
> netif_stop_queue(priv->dev);
> @@ -55,6 +60,7 @@
> priv->tx_pending_len = 0;
>
> /* reset SNR/NF/RSSI values */
> +#ifdef CONFIG_LIBERTAS_WEXT
> memset(priv->SNR, 0x00, sizeof(priv->SNR));
> memset(priv->NF, 0x00, sizeof(priv->NF));
> memset(priv->RSSI, 0x00, sizeof(priv->RSSI));
> @@ -62,7 +68,6 @@
> memset(priv->rawNF, 0x00, sizeof(priv->rawNF));
> priv->nextSNRNF = 0;
> priv->numSNRNF = 0;
> - priv->connect_status = LBS_DISCONNECTED;
>
> /* Clear out associated SSID and BSSID since connection is
> * no longer valid.
> @@ -70,6 +75,9 @@
> memset(&priv->curbssparams.bssid, 0, ETH_ALEN);
> memset(&priv->curbssparams.ssid, 0, IEEE80211_MAX_SSID_LEN);
> priv->curbssparams.ssid_len = 0;
> +#endif
> + priv->connect_status = LBS_DISCONNECTED;
> +
>
> if (priv->psstate != PS_STATE_FULL_POWER) {
> /* make firmware to exit PS mode */
> @@ -88,9 +96,12 @@
> */
> static void handle_mic_failureevent(struct lbs_private *priv, u32 event)
> {
> +#ifdef CONFIG_LIBERTAS_WEXT
> char buf[50];
> +#endif
>
> lbs_deb_enter(LBS_DEB_CMD);
> +#ifdef CONFIG_LIBERTAS_WEXT
> memset(buf, 0, sizeof(buf));
>
> sprintf(buf, "%s", "MLME-MICHAELMICFAILURE.indication ");
> @@ -102,6 +113,7 @@
> }
>
> lbs_send_iwevcustom_event(priv, buf);
> +#endif
> lbs_deb_leave(LBS_DEB_CMD);
> }
>
> @@ -177,10 +189,6 @@
> case CMD_RET(CMD_802_11_BEACON_STOP):
> break;
>
> - case CMD_RET(CMD_802_11_RSSI):
> - ret = lbs_ret_802_11_rssi(priv, resp);
> - break;
> -
> case CMD_RET(CMD_802_11_TPC_CFG):
> spin_lock_irqsave(&priv->driver_lock, flags);
> memmove((void *)priv->cur_cmd->callback_arg, &resp->params.tpccfg,
> @@ -202,9 +210,16 @@
> sizeof(resp->params.fwt));
> spin_unlock_irqrestore(&priv->driver_lock, flags);
> break;
> +
> +#ifdef CONFIG_LIBERTAS_WEXT
> + case CMD_RET(CMD_802_11_RSSI):
> + ret = lbs_ret_802_11_rssi(priv, resp);
> + break;
> +
> case CMD_RET(CMD_802_11_BEACON_CTRL):
> ret = lbs_ret_802_11_bcn_ctrl(priv, resp);
> break;
> +#endif
>
> default:
> lbs_pr_err("CMD_RESP: unknown cmd response 0x%04x\n",
> @@ -297,9 +312,13 @@
> * ad-hoc mode. It takes place in
> * lbs_execute_next_command().
> */
> +#ifdef CONFIG_LIBERTAS_WEXT
> if (priv->mode == IW_MODE_ADHOC &&
> action == CMD_SUBCMD_ENTER_PS)
> priv->psmode = LBS802_11POWERMODECAM;
> +#else
> + /* TODO: we need to figure out what to do here in cfg80211-mode */
> +#endif
> } else if (action == CMD_SUBCMD_ENTER_PS) {
> priv->needtowakeup = 0;
> priv->psstate = PS_STATE_AWAKE;
> @@ -516,6 +535,7 @@
> lbs_pr_alert("EVENT: snr high\n");
> break;
>
> +#ifdef CONFIG_LIBERTAS_WEXT
> case MACREG_INT_CODE_MESH_AUTO_STARTED:
> /* Ignore spurious autostart events if autostart is disabled */
> if (!priv->mesh_autostart_enabled) {
> @@ -532,6 +552,7 @@
> priv->mode = IW_MODE_ADHOC;
> schedule_work(&priv->sync_channel);
> break;
> +#endif
>
> default:
> lbs_pr_alert("EVENT: unknown event id %d\n", event);
> --- linux-wl.orig/drivers/net/wireless/libertas/debugfs.c
> +++ linux-wl/drivers/net/wireless/libertas/debugfs.c
> @@ -4,7 +4,6 @@
> #include <linux/delay.h>
> #include <linux/mm.h>
> #include <linux/string.h>
> -#include <net/iw_handler.h>
> #include <net/lib80211.h>
>
> #include "dev.h"
> @@ -60,6 +59,7 @@
> }
>
>
> +#ifdef CONFIG_LIBERTAS_WEXT
> static ssize_t lbs_getscantable(struct file *file, char __user *userbuf,
> size_t count, loff_t *ppos)
> {
> @@ -103,6 +103,7 @@
> free_page(addr);
> return res;
> }
> +#endif
>
> static ssize_t lbs_sleepparams_write(struct file *file,
> const char __user *user_buf, size_t count,
> @@ -722,8 +723,10 @@
>
> static const struct lbs_debugfs_files debugfs_files[] = {
> { "info", 0444, FOPS(lbs_dev_info, write_file_dummy), },
> +#ifdef CONFIG_LIBERTAS_WEXT
> { "getscantable", 0444, FOPS(lbs_getscantable,
> write_file_dummy), },
> +#endif
> { "sleepparams", 0644, FOPS(lbs_sleepparams_read,
> lbs_sleepparams_write), },
> };
> --- linux-wl.orig/drivers/net/wireless/libertas/rx.c
> +++ linux-wl/drivers/net/wireless/libertas/rx.c
> @@ -34,6 +34,7 @@
> void *eth80211_hdr;
> } __attribute__ ((packed));
>
> +#ifdef CONFIG_LIBERTAS_WEXT
> static int process_rxed_802_11_packet(struct lbs_private *priv,
> struct sk_buff *skb);
>
> @@ -129,6 +130,7 @@
>
> lbs_deb_leave(LBS_DEB_RX);
> }
> +#endif
>
> /**
> * @brief This function processes received packet and forwards it
> @@ -154,12 +156,15 @@
>
> skb->ip_summed = CHECKSUM_NONE;
>
> +#ifdef CONFIG_LIBERTAS_WEXT
> if (priv->monitormode)
> return process_rxed_802_11_packet(priv, skb);
> +#endif
>
> p_rx_pd = (struct rxpd *) skb->data;
> p_rx_pkt = (struct rxpackethdr *) ((u8 *)p_rx_pd +
> le32_to_cpu(p_rx_pd->pkt_ptr));
> +#ifdef CONFIG_LIBERTAS_WEXT
> if (priv->mesh_dev) {
> if (priv->mesh_fw_ver == MESH_FW_OLD) {
> if (p_rx_pd->rx_control & RxPD_MESH_FRAME)
> @@ -169,6 +174,7 @@
> dev = priv->mesh_dev;
> }
> }
> +#endif
>
> lbs_deb_hex(LBS_DEB_RX, "RX Data: Before chop rxpd", skb->data,
> min_t(unsigned int, skb->len, 100));
> @@ -232,6 +238,7 @@
> */
> skb_pull(skb, hdrchop);
>
> +#ifdef CONFIG_LIBERTAS_WEXT
> /* Take the data rate from the rxpd structure
> * only if the rate is auto
> */
> @@ -239,6 +246,7 @@
> priv->cur_rate = lbs_fw_index_to_data_rate(p_rx_pd->rx_rate);
>
> lbs_compute_rssi(priv, p_rx_pd);
> +#endif
>
> lbs_deb_rx("rx data: size of actual packet %d\n", skb->len);
> dev->stats.rx_bytes += skb->len;
> @@ -257,6 +265,7 @@
> }
> EXPORT_SYMBOL_GPL(lbs_process_rxed_packet);
>
> +#ifdef CONFIG_LIBERTAS_WEXT
> /**
> * @brief This function converts Tx/Rx rates from the Marvell WLAN format
> * (see Table 2 in Section 3.1) to IEEE80211_RADIOTAP_RATE units (500 Kb/s)
> @@ -381,3 +390,4 @@
> lbs_deb_leave_args(LBS_DEB_RX, "ret %d", ret);
> return ret;
> }
> +#endif
> --- linux-wl.orig/drivers/net/wireless/libertas/tx.c
> +++ linux-wl/drivers/net/wireless/libertas/tx.c
> @@ -12,6 +12,7 @@
> #include "dev.h"
> #include "wext.h"
>
> +#ifdef CONFIG_LIBERTAS_WEXT
> /**
> * @brief This function converts Tx/Rx rates from IEEE80211_RADIOTAP_RATE
> * units (500 Kb/s) into Marvell WLAN format (see Table 8 in Section 3.2.1)
> @@ -49,6 +50,7 @@
> }
> return 0;
> }
> +#endif
>
> /**
> * @brief This function checks the conditions and sends packet to IF
> @@ -88,8 +90,10 @@
>
>
> netif_stop_queue(priv->dev);
> +#ifdef CONFIG_LIBERTAS_WEXT
> if (priv->mesh_dev)
> netif_stop_queue(priv->mesh_dev);
> +#endif
>
> if (priv->tx_pending_len) {
> /* This can happen if packets come in on the mesh and eth
> @@ -111,6 +115,7 @@
> p802x_hdr = skb->data;
> pkt_len = skb->len;
>
> +#ifdef CONFIG_LIBERTAS_WEXT
> if (dev == priv->rtap_net_dev) {
> struct tx_radiotap_hdr *rtap_hdr = (void *)skb->data;
>
> @@ -123,6 +128,9 @@
>
> /* copy destination address from 802.11 header */
> memcpy(txpd->tx_dest_addr_high, p802x_hdr + 4, ETH_ALEN);
> +#else
> + if (0) {
> +#endif
> } else {
> /* copy destination address from 802.3 header */
> memcpy(txpd->tx_dest_addr_high, p802x_hdr, ETH_ALEN);
> @@ -131,12 +139,14 @@
> txpd->tx_packet_length = cpu_to_le16(pkt_len);
> txpd->tx_packet_location = cpu_to_le32(sizeof(struct txpd));
>
> +#ifdef CONFIG_LIBERTAS_WEXT
> if (dev == priv->mesh_dev) {
> if (priv->mesh_fw_ver == MESH_FW_OLD)
> txpd->tx_control |= cpu_to_le32(TxPD_MESH_FRAME);
> else if (priv->mesh_fw_ver == MESH_FW_NEW)
> txpd->u.bss.bss_num = MESH_IFACE_ID;
> }
> +#endif
>
> lbs_deb_hex(LBS_DEB_TX, "txpd", (u8 *) &txpd, sizeof(struct txpd));
>
> @@ -154,6 +164,7 @@
>
> dev->trans_start = jiffies;
>
> +#ifdef CONFIG_LIBERTAS_WEXT
> if (priv->monitormode) {
> /* Keep the skb to echo it back once Tx feedback is
> received from FW */
> @@ -161,6 +172,9 @@
>
> /* Keep the skb around for when we get feedback */
> priv->currenttxskb = skb;
> +#else
> + if (0) {
> +#endif
> } else {
> free:
> dev_kfree_skb_any(skb);
> @@ -173,6 +187,7 @@
> return ret;
> }
>
> +#ifdef CONFIG_LIBERTAS_WEXT
> /**
> * @brief This function sends to the host the last transmitted packet,
> * filling the radiotap headers with transmission information.
> @@ -207,3 +222,4 @@
> netif_wake_queue(priv->mesh_dev);
> }
> EXPORT_SYMBOL_GPL(lbs_send_tx_feedback);
> +#endif
> --- linux-wl.orig/drivers/net/wireless/libertas/if_usb.c
> +++ linux-wl/drivers/net/wireless/libertas/if_usb.c
> @@ -757,6 +757,7 @@
> lbs_deb_usbd(&cardp->udev->dev, "**EVENT** 0x%X\n", event);
> kfree_skb(skb);
>
> +#ifdef CONFIG_LIBERTAS_WEXT
> /* Icky undocumented magic special case */
> if (event & 0xffff0000) {
> u32 trycount = (event & 0xffff0000) >> 16;
> @@ -764,6 +765,7 @@
> lbs_send_tx_feedback(priv, trycount);
> } else
> lbs_queue_event(priv, event & 0xFF);
> +#endif
> break;
>
> default:
> --- linux-wl.orig/drivers/net/wireless/libertas/assoc.h
> +++ linux-wl/drivers/net/wireless/libertas/assoc.h
> @@ -3,6 +3,7 @@
> #ifndef _LBS_ASSOC_H_
> #define _LBS_ASSOC_H_
>
> +#ifdef CONFIG_LIBERTAS_WEXT
>
> #include "defs.h"
> #include "host.h"
> @@ -152,4 +153,6 @@
> int lbs_cmd_802_11_key_material(struct lbs_private *priv, uint16_t cmd_action,
> struct assoc_request *assoc);
>
> +#endif
> +
> #endif /* _LBS_ASSOC_H */
> --- linux-wl.orig/drivers/net/wireless/libertas/scan.h
> +++ linux-wl/drivers/net/wireless/libertas/scan.h
> @@ -7,6 +7,8 @@
> #ifndef _LBS_SCAN_H
> #define _LBS_SCAN_H
>
> +#ifdef CONFIG_LIBERTAS_WEXT
> +
> #include <net/iw_handler.h>
>
> struct lbs_private;
> @@ -61,3 +63,5 @@
> void lbs_scan_worker(struct work_struct *work);
>
> #endif
> +
> +#endif
> --- linux-wl.orig/drivers/net/wireless/libertas/wext.h
> +++ linux-wl/drivers/net/wireless/libertas/wext.h
> @@ -4,9 +4,13 @@
> #ifndef _LBS_WEXT_H_
> #define _LBS_WEXT_H_
>
> +#ifdef CONFIG_LIBERTAS_WEXT
> +
> void lbs_send_iwevcustom_event(struct lbs_private *priv, s8 *str);
>
> extern struct iw_handler_def lbs_handler_def;
> extern struct iw_handler_def mesh_handler_def;
>
> #endif
> +
> +#endif
^ permalink raw reply
* Re: [RFC] libertas: monster-patch to make CFG/WEXT configurable
From: Dan Williams @ 2009-10-21 18:39 UTC (permalink / raw)
To: Holger Schurig; +Cc: linux-wireless
In-Reply-To: <1256150184.5010.45.camel@localhost.localdomain>
On Wed, 2009-10-21 at 11:36 -0700, Dan Williams wrote:
> On Mon, 2009-10-19 at 14:49 +0200, Holger Schurig wrote:
> > This is a monster patch that makes CFG80211/WEXT operation
> > configurable. My cfg80211-RFC/WIP-Patch would come on top of it,
> > but would then be quite small, e.g. almost only changed to
> > cfg.c/cfg.h.
> >
> > As there's no mesh/adhoc/monitor mode implemented in cfg80211-
> > mode, I added many, many #ifdef/#endif pairs. Maybe too many.
> > Is this too ugly? Or would this patch be applyable as-is ?
>
> For the mesh interface stuff, especially in tx/rx paths, would you mind
> not ifdefing that? Since with cfg80211, priv->mesh_dev will always be
> NULL, those checks will be just fine and you still don't have to care
> about mesh.
>
> I'm sure that the bits for SNMP_MIB_OID_BSS_TYPE could also be converted
> to use lib80211 or cfg80211 values instead of WEXT ones; I just picked
> WEXT at the time because we had no cfg80211 yet.
>
> Stuff like lbs_cmd_bt_access doesn't need to be ifdefed either, because
> it simply won't be called if the debugfs bits are disabled.
>
> I'm sure the WEXT-specific lbs_mac_event_disconnected bits could also be
> abstracted like you did with the IWAP stuff a few patches ago too.
I just saw the v2 patch from earlier that did this. Thanks.
> Basically, I don't mind having some ifdefs; but I think there are way
> too many in that patch. Not all the mesh stuff needs to be disabled
> just for cfg80211.
>
> > If the patch is perceived to be too ugly, I could create an
> > monitor.h/monitor.c file and singleout everything related to
> > monitoring in it, where monitor.h would resolv to dummy static
> > functions in the cfg80211-case ... at least as long as we don't
> > have monitor suppport in libertas+cfg80211. The same for mesh
> > support, e.g. here I could create a mesh.h/mesh.c and do the
> > same.
> >
> > Signed-off-by: Holger Schurig <hs4233@mail.mn-solutions.de>
> >
> > --- linux-wl.orig/drivers/net/wireless/libertas/Kconfig
> > +++ linux-wl/drivers/net/wireless/libertas/Kconfig
> > @@ -37,3 +37,29 @@
> > depends on LIBERTAS
> > ---help---
> > Debugging support.
> > +
> > +choice
> > + prompt "interface to user-space"
> > + depends on LIBERTAS
> > + default LIBERTAS_WEXT
> > +
> > +config LIBERTAS_WEXT
> > + bool "WEXT"
> > + help
> > + This is the old Libertas code as it always used to be:
> > + configuration done via "iwconfig" or "wpa_supplicant -Dwext",
> > + associating via libertas-internal code. This is currently the only
> > + way to support:
> > +
> > + * AD-HOC
> > + * Libertas' MESH
> > + * Monitor interface ("rtap")
> > +
> > +config LIBERTAS_CFG80211
> > + bool "CFG80211"
> > + depends on EXPERIMENTAL
> > + help
> > + This is new new way of wireless: use cfg80211 for all, e.g.
> > + "iw" or "wpa_supplicant -Dnl80211".
> > +
> > +endchoice
> > --- linux-wl.orig/drivers/net/wireless/libertas/Makefile
> > +++ linux-wl/drivers/net/wireless/libertas/Makefile
> > @@ -1,15 +1,15 @@
> > -libertas-y += assoc.o
> > libertas-y += cfg.o
> > libertas-y += cmd.o
> > libertas-y += cmdresp.o
> > libertas-y += debugfs.o
> > -libertas-y += ethtool.o
> > libertas-y += main.o
> > -libertas-y += persistcfg.o
> > libertas-y += rx.o
> > -libertas-y += scan.o
> > libertas-y += tx.o
> > -libertas-y += wext.o
> > +libertas-$(CONFIG_LIBERTAS_WEXT) += assoc.o
> > +libertas-$(CONFIG_LIBERTAS_WEXT) += ethtool.o
> > +libertas-$(CONFIG_LIBERTAS_WEXT) += persistcfg.o
> > +libertas-$(CONFIG_LIBERTAS_WEXT) += scan.o
> > +libertas-$(CONFIG_LIBERTAS_WEXT) += wext.o
> >
> > usb8xxx-objs += if_usb.o
> > libertas_cs-objs += if_cs.o
> > --- linux-wl.orig/drivers/net/wireless/libertas/cmd.c
> > +++ linux-wl/drivers/net/wireless/libertas/cmd.c
> > @@ -3,7 +3,6 @@
> > * It prepares command and sends it to firmware when it is ready.
> > */
> >
> > -#include <net/iw_handler.h>
> > #include <net/lib80211.h>
> > #include <linux/kfifo.h>
> > #include <linux/sched.h>
> > @@ -184,6 +183,8 @@
> > memmove(priv->current_addr, cmd.permanentaddr, ETH_ALEN);
> >
> > memcpy(priv->dev->dev_addr, priv->current_addr, ETH_ALEN);
> > +
> > +#ifdef CONFIG_LIBERTAS_WEXT
> > if (priv->mesh_dev)
> > memcpy(priv->mesh_dev->dev_addr, priv->current_addr, ETH_ALEN);
> >
> > @@ -191,6 +192,7 @@
> > ret = -1;
> > goto out;
> > }
> > +#endif
> >
> > out:
> > lbs_deb_leave(LBS_DEB_CMD);
> > @@ -387,10 +389,12 @@
> > cmd.oid = cpu_to_le16((u16) oid);
> >
> > switch (oid) {
> > +#ifdef CONFIG_LIBERTAS_WEXT
> > case SNMP_MIB_OID_BSS_TYPE:
> > cmd.bufsize = cpu_to_le16(sizeof(u8));
> > cmd.value[0] = (val == IW_MODE_ADHOC) ? 2 : 1;
> > break;
> > +#endif
> > case SNMP_MIB_OID_11D_ENABLE:
> > case SNMP_MIB_OID_FRAG_THRESHOLD:
> > case SNMP_MIB_OID_RTS_THRESHOLD:
> > @@ -442,12 +446,14 @@
> >
> > switch (le16_to_cpu(cmd.bufsize)) {
> > case sizeof(u8):
> > +#ifdef CONFIG_LIBERTAS_WEXT
> > if (oid == SNMP_MIB_OID_BSS_TYPE) {
> > if (cmd.value[0] == 2)
> > *out_val = IW_MODE_ADHOC;
> > else
> > *out_val = IW_MODE_INFRA;
> > } else
> > +#endif
> > *out_val = cmd.value[0];
> > break;
> > case sizeof(u16):
> > @@ -702,6 +708,7 @@
> > return 0;
> > }
> >
> > +#ifdef CONFIG_LIBERTAS_WEXT
> > static int lbs_cmd_bt_access(struct cmd_ds_command *cmd,
> > u16 cmd_action, void *pdata_buf)
> > {
> > @@ -868,6 +875,7 @@
> >
> > return __lbs_mesh_config_send(priv, &cmd, action, priv->mesh_tlv);
> > }
> > +#endif
> >
> > static void lbs_queue_cmd(struct lbs_private *priv,
> > struct cmd_ctrl_node *cmdnode)
> > @@ -1155,10 +1163,6 @@
> > cmd_action, pdata_buf);
> > break;
> >
> > - case CMD_802_11_RSSI:
> > - ret = lbs_cmd_802_11_rssi(priv, cmdptr);
> > - break;
> > -
> > case CMD_802_11_SET_AFC:
> > case CMD_802_11_GET_AFC:
> >
> > @@ -1184,6 +1188,11 @@
> > ret = 0;
> > break;
> >
> > +#ifdef CONFIG_LIBERTAS_WEXT
> > + case CMD_802_11_RSSI:
> > + ret = lbs_cmd_802_11_rssi(priv, cmdptr);
> > + break;
> > +
> > case CMD_BT_ACCESS:
> > ret = lbs_cmd_bt_access(cmdptr, cmd_action, pdata_buf);
> > break;
> > @@ -1195,6 +1204,8 @@
> > case CMD_802_11_BEACON_CTRL:
> > ret = lbs_cmd_bcn_ctrl(priv, cmdptr, cmd_action);
> > break;
> > +#endif
> > +
> > case CMD_802_11_DEEP_SLEEP:
> > cmdptr->command = cpu_to_le16(CMD_802_11_DEEP_SLEEP);
> > cmdptr->size = cpu_to_le16(sizeof(struct cmd_header));
> > @@ -1487,6 +1498,7 @@
> > * check if in power save mode, if yes, put the device back
> > * to PS mode
> > */
> > +#ifdef CONFIG_LIBERTAS_WEXT
> > if ((priv->psmode != LBS802_11POWERMODECAM) &&
> > (priv->psstate == PS_STATE_FULL_POWER) &&
> > ((priv->connect_status == LBS_CONNECTED) ||
> > @@ -1508,6 +1520,9 @@
> > lbs_ps_sleep(priv, 0);
> > }
> > }
> > +#else
> > + /* TODO: we need to figure out what to do here in cfg80211-mode */
> > +#endif
> > }
> >
> > ret = 0;
> > --- linux-wl.orig/drivers/net/wireless/libertas/dev.h
> > +++ linux-wl/drivers/net/wireless/libertas/dev.h
> > @@ -6,8 +6,10 @@
> > #ifndef _LBS_DEV_H_
> > #define _LBS_DEV_H_
> >
> > +#include "defs.h"
> > #include "scan.h"
> > #include "assoc.h"
> > +#include "host.h"
> >
> >
> >
> > @@ -21,6 +23,9 @@
> > uint16_t sp_reserved;
> > };
> >
> > +
> > +#ifdef CONFIG_LIBERTAS_WEXT
> > +
> > /* Mesh statistics */
> > struct lbs_mesh_stats {
> > u32 fwd_bcast_cnt; /* Fwd: Broadcast counter */
> > @@ -32,6 +37,8 @@
> > u32 drop_blind; /* Rx: Dropped by blinding table */
> > u32 tx_failed_cnt; /* Tx: Failed transmissions */
> > };
> > +#endif
> > +
> >
> > /** Private structure for the MV device */
> > struct lbs_private {
> > @@ -48,11 +55,11 @@
> > struct wireless_dev *wdev;
> >
> > /* Mesh */
> > +#ifdef CONFIG_LIBERTAS_WEXT
> > struct net_device *mesh_dev; /* Virtual device */
> > u32 mesh_connect_status;
> > struct lbs_mesh_stats mstats;
> > int mesh_open;
> > - int mesh_fw_ver;
> > int mesh_autostart_enabled;
> > uint16_t mesh_tlv;
> > u8 mesh_ssid[IEEE80211_MAX_SSID_LEN + 1];
> > @@ -62,6 +69,7 @@
> > /* Monitor mode */
> > struct net_device *rtap_net_dev;
> > u32 monitormode;
> > +#endif
> >
> > /* Debugfs */
> > struct dentry *debugfs_dir;
> > @@ -103,6 +111,7 @@
> > int (*reset_deep_sleep_wakeup) (struct lbs_private *priv);
> >
> > /* Adapter info (from EEPROM) */
> > + int mesh_fw_ver;
> > u32 fwrelease;
> > u32 fwcapinfo;
> > u16 regioncode;
> > @@ -138,11 +147,13 @@
> > struct workqueue_struct *work_thread;
> >
> > /** Encryption stuff */
> > +#ifdef CONFIG_LIBERTAS_WEXT
> > 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;
> > +#endif
> > u16 wep_tx_keyidx;
> > struct enc_key wep_keys[4];
> >
> > @@ -163,6 +174,7 @@
> > spinlock_t driver_lock;
> >
> > /* NIC/link operation characteristics */
> > + u16 capability;
> > u16 mac_control;
> > u8 radio_on;
> > u8 channel;
> > @@ -174,6 +186,7 @@
> > struct delayed_work scan_work;
> > int scan_channel;
> > /* remember which channel was scanned last, != 0 if currently scanning */
> > +#ifdef CONFIG_LIBERTAS_WEXT
> > u8 scan_ssid[IEEE80211_MAX_SSID_LEN + 1];
> > u8 scan_ssid_len;
> >
> > @@ -186,7 +199,6 @@
> > struct bss_descriptor *networks;
> > struct assoc_request * pending_assoc_req;
> > struct assoc_request * in_progress_assoc_req;
> > - u16 capability;
> > uint16_t enablehwauto;
> > uint16_t ratebitmap;
> >
> > @@ -211,6 +223,7 @@
> > u8 rawNF[DEFAULT_DATA_AVG_FACTOR];
> > u16 nextSNRNF;
> > u16 numSNRNF;
> > +#endif
> > };
> >
> > extern struct cmd_confirm_sleep confirm_sleep;
> > --- linux-wl.orig/drivers/net/wireless/libertas/main.c
> > +++ linux-wl/drivers/net/wireless/libertas/main.c
> > @@ -13,7 +13,6 @@
> > #include <linux/kfifo.h>
> > #include <linux/stddef.h>
> > #include <linux/ieee80211.h>
> > -#include <net/iw_handler.h>
> > #include <net/cfg80211.h>
> >
> > #include "host.h"
> > @@ -98,6 +97,7 @@
> > * Attributes exported through sysfs
> > */
> >
> > +#ifdef CONFIG_LIBERTAS_WEXT
> > /**
> > * @brief Get function for sysfs attribute anycast_mask
> > */
> > @@ -325,6 +325,8 @@
> > static struct attribute_group lbs_mesh_attr_group = {
> > .attrs = lbs_mesh_sysfs_entries,
> > };
> > +#endif
> > +
> >
> > /**
> > * @brief This function opens the ethX or mshX interface
> > @@ -341,6 +343,7 @@
> >
> > spin_lock_irq(&priv->driver_lock);
> >
> > +#ifdef CONFIG_LIBERTAS_WEXT
> > if (priv->monitormode) {
> > ret = -EBUSY;
> > goto out;
> > @@ -351,6 +354,9 @@
> > priv->mesh_connect_status = LBS_CONNECTED;
> > netif_carrier_on(dev);
> > } else {
> > +#else
> > + if (1) {
> > +#endif
> > priv->infra_open = 1;
> >
> > if (priv->connect_status == LBS_CONNECTED)
> > @@ -361,13 +367,16 @@
> >
> > if (!priv->tx_pending_len)
> > netif_wake_queue(dev);
> > - out:
> >
> > +#ifdef CONFIG_LIBERTAS_WEXT
> > + out:
> > +#endif
> > spin_unlock_irq(&priv->driver_lock);
> > lbs_deb_leave_args(LBS_DEB_NET, "ret %d", ret);
> > return ret;
> > }
> >
> > +#ifdef CONFIG_LIBERTAS_WEXT
> > /**
> > * @brief This function closes the mshX interface
> > *
> > @@ -383,7 +392,6 @@
> >
> > priv->mesh_open = 0;
> > priv->mesh_connect_status = LBS_DISCONNECTED;
> > -
> > netif_stop_queue(dev);
> > netif_carrier_off(dev);
> >
> > @@ -394,6 +402,7 @@
> > lbs_deb_leave(LBS_DEB_MESH);
> > return 0;
> > }
> > +#endif
> >
> > /**
> > * @brief This function closes the ethX interface
> > @@ -428,8 +437,10 @@
> >
> > dev->trans_start = jiffies;
> >
> > +#ifdef CONFIG_LIBERTAS_WEXT
> > if (priv->currenttxskb)
> > lbs_send_tx_feedback(priv, 0);
> > +#endif
> >
> > /* XX: Shouldn't we also call into the hw-specific driver
> > to kick it somehow? */
> > @@ -490,8 +501,10 @@
> >
> > memcpy(priv->current_addr, phwaddr->sa_data, ETH_ALEN);
> > memcpy(dev->dev_addr, phwaddr->sa_data, ETH_ALEN);
> > +#ifdef CONFIG_LIBERTAS_WEXT
> > if (priv->mesh_dev)
> > memcpy(priv->mesh_dev->dev_addr, phwaddr->sa_data, ETH_ALEN);
> > +#endif
> >
> > done:
> > lbs_deb_leave_args(LBS_DEB_NET, "ret %d", ret);
> > @@ -554,8 +567,10 @@
> > lbs_deb_enter(LBS_DEB_NET);
> >
> > dev_flags = priv->dev->flags;
> > +#ifdef CONFIG_LIBERTAS_WEXT
> > if (priv->mesh_dev)
> > dev_flags |= priv->mesh_dev->flags;
> > +#endif
> >
> > if (dev_flags & IFF_PROMISC) {
> > priv->mac_control |= CMD_ACT_MAC_PROMISCUOUS_ENABLE;
> > @@ -572,8 +587,10 @@
> >
> > /* Once for priv->dev, again for priv->mesh_dev if it exists */
> > nr_addrs = lbs_add_mcast_addrs(&mcast_cmd, priv->dev, 0);
> > +#ifdef CONFIG_LIBERTAS_WEXT
> > if (nr_addrs >= 0 && priv->mesh_dev)
> > nr_addrs = lbs_add_mcast_addrs(&mcast_cmd, priv->mesh_dev, nr_addrs);
> > +#endif
> > if (nr_addrs < 0)
> > goto do_allmulti;
> >
> > @@ -816,9 +833,11 @@
> > waiting for TX feedback */
> > if (priv->connect_status == LBS_CONNECTED)
> > netif_wake_queue(priv->dev);
> > +#ifdef CONFIG_LIBERTAS_WEXT
> > if (priv->mesh_dev &&
> > priv->mesh_connect_status == LBS_CONNECTED)
> > netif_wake_queue(priv->mesh_dev);
> > +#endif
> > }
> > }
> > spin_unlock_irq(&priv->driver_lock);
> > @@ -838,8 +857,10 @@
> > lbs_deb_enter(LBS_DEB_FW);
> >
> > netif_device_detach(priv->dev);
> > +#ifdef CONFIG_LIBERTAS_WEXT
> > if (priv->mesh_dev)
> > netif_device_detach(priv->mesh_dev);
> > +#endif
> >
> > priv->fw_ready = 0;
> > lbs_deb_leave(LBS_DEB_FW);
> > @@ -882,8 +903,10 @@
> > 0, 0, NULL);
> >
> > netif_device_attach(priv->dev);
> > +#ifdef CONFIG_LIBERTAS_WEXT
> > if (priv->mesh_dev)
> > netif_device_attach(priv->mesh_dev);
> > +#endif
> >
> > lbs_deb_leave(LBS_DEB_FW);
> > }
> > @@ -1004,6 +1027,7 @@
> > return 0;
> > }
> >
> > +#ifdef CONFIG_LIBERTAS_WEXT
> > static void lbs_sync_channel_worker(struct work_struct *work)
> > {
> > struct lbs_private *priv = container_of(work, struct lbs_private,
> > @@ -1014,15 +1038,19 @@
> > lbs_pr_info("Channel synchronization failed.");
> > lbs_deb_leave(LBS_DEB_MAIN);
> > }
> > -
> > +#endif
> >
> > static int lbs_init_adapter(struct lbs_private *priv)
> > {
> > + int ret = 0;
> > +#ifdef CONFIG_LIBERTAS_WEXT
> > size_t bufsize;
> > - int i, ret = 0;
> > + int i;
> > +#endif
> >
> > lbs_deb_enter(LBS_DEB_MAIN);
> >
> > +#ifdef CONFIG_LIBERTAS_WEXT
> > /* Allocate buffer to store the BSSID list */
> > bufsize = MAX_NETWORK_COUNT * sizeof(struct bss_descriptor);
> > priv->networks = kzalloc(bufsize, GFP_KERNEL);
> > @@ -1039,17 +1067,18 @@
> > list_add_tail(&priv->networks[i].list,
> > &priv->network_free_list);
> > }
> > + priv->secinfo.auth_mode = IW_AUTH_ALG_OPEN_SYSTEM;
> > + priv->mode = IW_MODE_INFRA;
> > + priv->enablehwauto = 1;
> > + priv->mesh_connect_status = LBS_DISCONNECTED;
> > +#endif
> >
> > memset(priv->current_addr, 0xff, ETH_ALEN);
> >
> > priv->connect_status = LBS_DISCONNECTED;
> > - priv->mesh_connect_status = LBS_DISCONNECTED;
> > - priv->secinfo.auth_mode = IW_AUTH_ALG_OPEN_SYSTEM;
> > - priv->mode = IW_MODE_INFRA;
> > priv->channel = DEFAULT_AD_HOC_CHANNEL;
> > priv->mac_control = CMD_ACT_MAC_RX_ON | CMD_ACT_MAC_TX_ON;
> > priv->radio_on = 1;
> > - priv->enablehwauto = 1;
> > priv->capability = WLAN_CAPABILITY_SHORT_PREAMBLE;
> > priv->psmode = LBS802_11POWERMODECAM;
> > priv->psstate = PS_STATE_FULL_POWER;
> > @@ -1103,8 +1132,10 @@
> > kfifo_free(priv->event_fifo);
> > del_timer(&priv->command_timer);
> > del_timer(&priv->auto_deepsleep_timer);
> > +#ifdef CONFIG_LIBERTAS_WEXT
> > kfree(priv->networks);
> > priv->networks = NULL;
> > +#endif
> >
> > lbs_deb_leave(LBS_DEB_MAIN);
> > }
> > @@ -1166,8 +1197,8 @@
> >
> > dev->netdev_ops = &lbs_netdev_ops;
> > dev->watchdog_timeo = 5 * HZ;
> > +#ifdef CONFIG_LIBERTAS_WEXT
> > dev->ethtool_ops = &lbs_ethtool_ops;
> > -#ifdef WIRELESS_EXT
> > dev->wireless_handlers = &lbs_handler_def;
> > #endif
> > dev->flags |= IFF_BROADCAST | IFF_MULTICAST;
> > @@ -1177,11 +1208,8 @@
> >
> >
> > priv->card = card;
> > - priv->mesh_open = 0;
> > priv->infra_open = 0;
> >
> > -
> > - priv->rtap_net_dev = NULL;
> > strcpy(dev->name, "wlan%d");
> >
> > lbs_deb_thread("Starting main thread...\n");
> > @@ -1193,13 +1221,18 @@
> > }
> >
> > priv->work_thread = create_singlethread_workqueue("lbs_worker");
> > - INIT_DELAYED_WORK(&priv->assoc_work, lbs_association_worker);
> > - INIT_DELAYED_WORK(&priv->scan_work, lbs_scan_worker);
> > - INIT_WORK(&priv->mcast_work, lbs_set_mcast_worker);
> > - INIT_WORK(&priv->sync_channel, lbs_sync_channel_worker);
> > +#ifdef CONFIG_LIBERTAS_WEXT
> > + priv->rtap_net_dev = NULL;
> >
> > sprintf(priv->mesh_ssid, "mesh");
> > priv->mesh_ssid_len = 4;
> > + priv->mesh_open = 0;
> > +
> > + INIT_DELAYED_WORK(&priv->assoc_work, lbs_association_worker);
> > + INIT_DELAYED_WORK(&priv->scan_work, lbs_scan_worker);
> > + INIT_WORK(&priv->sync_channel, lbs_sync_channel_worker);
> > +#endif
> > + INIT_WORK(&priv->mcast_work, lbs_set_mcast_worker);
> >
> > priv->wol_criteria = 0xffffffff;
> > priv->wol_gpio = 0xff;
> > @@ -1231,13 +1264,15 @@
> >
> > lbs_deb_enter(LBS_DEB_MAIN);
> >
> > + dev = priv->dev;
> > +
> > +#ifdef CONFIG_LIBERTAS_WEXT
> > lbs_remove_mesh(priv);
> > lbs_remove_rtap(priv);
> >
> > - dev = priv->dev;
> > -
> > cancel_delayed_work_sync(&priv->scan_work);
> > cancel_delayed_work_sync(&priv->assoc_work);
> > +#endif
> > cancel_work_sync(&priv->mcast_work);
> >
> > /* worker thread destruction blocks on the in-flight command which
> > @@ -1295,6 +1330,7 @@
> >
> > lbs_update_channel(priv);
> >
> > +#ifdef CONFIG_LIBERTAS_WEXT
> > /* Check mesh FW version and appropriately send the mesh start
> > * command
> > */
> > @@ -1342,6 +1378,7 @@
> > if (device_create_file(&dev->dev, &dev_attr_lbs_rtap))
> > lbs_pr_err("cannot register lbs_rtap attribute\n");
> > }
> > +#endif
> >
> > lbs_debugfs_init_one(priv, dev);
> >
> > @@ -1372,10 +1409,12 @@
> > netif_carrier_off(dev);
> >
> > lbs_debugfs_remove_one(priv);
> > +#ifdef CONFIG_LIBERTAS_WEXT
> > if (priv->mesh_tlv) {
> > device_remove_file(&dev->dev, &dev_attr_lbs_mesh);
> > device_remove_file(&dev->dev, &dev_attr_lbs_rtap);
> > }
> > +#endif
> >
> > /* Delete the timeout of the currently processing command */
> > del_timer_sync(&priv->command_timer);
> > @@ -1408,6 +1447,7 @@
> > EXPORT_SYMBOL_GPL(lbs_stop_card);
> >
> >
> > +#ifdef CONFIG_LIBERTAS_WEXT
> > static const struct net_device_ops mesh_netdev_ops = {
> > .ndo_open = lbs_dev_open,
> > .ndo_stop = lbs_mesh_stop,
> > @@ -1445,7 +1485,7 @@
> >
> > SET_NETDEV_DEV(priv->mesh_dev, priv->dev->dev.parent);
> >
> > -#ifdef WIRELESS_EXT
> > +#ifdef CONFIG_LIBERTAS_WEXT
> > mesh_dev->wireless_handlers = (struct iw_handler_def *)&mesh_handler_def;
> > #endif
> > mesh_dev->flags |= IFF_BROADCAST | IFF_MULTICAST;
> > @@ -1496,6 +1536,7 @@
> > free_netdev(mesh_dev);
> > lbs_deb_leave(LBS_DEB_MESH);
> > }
> > +#endif
> >
> > void lbs_queue_event(struct lbs_private *priv, u32 event)
> > {
> > @@ -1556,6 +1597,7 @@
> > * rtap interface support fuctions
> > */
> >
> > +#ifdef CONFIG_LIBERTAS_WEXT
> > static int lbs_rtap_open(struct net_device *dev)
> > {
> > /* Yes, _stop_ the queue. Because we don't support injection */
> > @@ -1632,6 +1674,7 @@
> > lbs_deb_leave_args(LBS_DEB_MAIN, "ret %d", ret);
> > return ret;
> > }
> > +#endif
> >
> > module_init(lbs_init_module);
> > module_exit(lbs_exit_module);
> > --- linux-wl.orig/drivers/net/wireless/libertas/cmdresp.c
> > +++ linux-wl/drivers/net/wireless/libertas/cmdresp.c
> > @@ -7,7 +7,6 @@
> > #include <linux/if_arp.h>
> > #include <linux/netdevice.h>
> > #include <asm/unaligned.h>
> > -#include <net/iw_handler.h>
> >
> > #include "host.h"
> > #include "decl.h"
> > @@ -27,13 +26,16 @@
> > */
> > void lbs_mac_event_disconnected(struct lbs_private *priv)
> > {
> > +#ifdef CONFIG_LIBERTAS_WEXT
> > union iwreq_data wrqu;
> > +#endif
> >
> > if (priv->connect_status != LBS_CONNECTED)
> > return;
> >
> > lbs_deb_enter(LBS_DEB_ASSOC);
> >
> > +#ifdef CONFIG_LIBERTAS_WEXT
> > memset(wrqu.ap_addr.sa_data, 0x00, ETH_ALEN);
> > wrqu.ap_addr.sa_family = ARPHRD_ETHER;
> >
> > @@ -44,6 +46,9 @@
> >
> > msleep_interruptible(1000);
> > wireless_send_event(priv->dev, SIOCGIWAP, &wrqu, NULL);
> > +#else
> > + /* TODO: find out what to do in the cfg80211 case */
> > +#endif
> >
> > /* report disconnect to upper layer */
> > netif_stop_queue(priv->dev);
> > @@ -55,6 +60,7 @@
> > priv->tx_pending_len = 0;
> >
> > /* reset SNR/NF/RSSI values */
> > +#ifdef CONFIG_LIBERTAS_WEXT
> > memset(priv->SNR, 0x00, sizeof(priv->SNR));
> > memset(priv->NF, 0x00, sizeof(priv->NF));
> > memset(priv->RSSI, 0x00, sizeof(priv->RSSI));
> > @@ -62,7 +68,6 @@
> > memset(priv->rawNF, 0x00, sizeof(priv->rawNF));
> > priv->nextSNRNF = 0;
> > priv->numSNRNF = 0;
> > - priv->connect_status = LBS_DISCONNECTED;
> >
> > /* Clear out associated SSID and BSSID since connection is
> > * no longer valid.
> > @@ -70,6 +75,9 @@
> > memset(&priv->curbssparams.bssid, 0, ETH_ALEN);
> > memset(&priv->curbssparams.ssid, 0, IEEE80211_MAX_SSID_LEN);
> > priv->curbssparams.ssid_len = 0;
> > +#endif
> > + priv->connect_status = LBS_DISCONNECTED;
> > +
> >
> > if (priv->psstate != PS_STATE_FULL_POWER) {
> > /* make firmware to exit PS mode */
> > @@ -88,9 +96,12 @@
> > */
> > static void handle_mic_failureevent(struct lbs_private *priv, u32 event)
> > {
> > +#ifdef CONFIG_LIBERTAS_WEXT
> > char buf[50];
> > +#endif
> >
> > lbs_deb_enter(LBS_DEB_CMD);
> > +#ifdef CONFIG_LIBERTAS_WEXT
> > memset(buf, 0, sizeof(buf));
> >
> > sprintf(buf, "%s", "MLME-MICHAELMICFAILURE.indication ");
> > @@ -102,6 +113,7 @@
> > }
> >
> > lbs_send_iwevcustom_event(priv, buf);
> > +#endif
> > lbs_deb_leave(LBS_DEB_CMD);
> > }
> >
> > @@ -177,10 +189,6 @@
> > case CMD_RET(CMD_802_11_BEACON_STOP):
> > break;
> >
> > - case CMD_RET(CMD_802_11_RSSI):
> > - ret = lbs_ret_802_11_rssi(priv, resp);
> > - break;
> > -
> > case CMD_RET(CMD_802_11_TPC_CFG):
> > spin_lock_irqsave(&priv->driver_lock, flags);
> > memmove((void *)priv->cur_cmd->callback_arg, &resp->params.tpccfg,
> > @@ -202,9 +210,16 @@
> > sizeof(resp->params.fwt));
> > spin_unlock_irqrestore(&priv->driver_lock, flags);
> > break;
> > +
> > +#ifdef CONFIG_LIBERTAS_WEXT
> > + case CMD_RET(CMD_802_11_RSSI):
> > + ret = lbs_ret_802_11_rssi(priv, resp);
> > + break;
> > +
> > case CMD_RET(CMD_802_11_BEACON_CTRL):
> > ret = lbs_ret_802_11_bcn_ctrl(priv, resp);
> > break;
> > +#endif
> >
> > default:
> > lbs_pr_err("CMD_RESP: unknown cmd response 0x%04x\n",
> > @@ -297,9 +312,13 @@
> > * ad-hoc mode. It takes place in
> > * lbs_execute_next_command().
> > */
> > +#ifdef CONFIG_LIBERTAS_WEXT
> > if (priv->mode == IW_MODE_ADHOC &&
> > action == CMD_SUBCMD_ENTER_PS)
> > priv->psmode = LBS802_11POWERMODECAM;
> > +#else
> > + /* TODO: we need to figure out what to do here in cfg80211-mode */
> > +#endif
> > } else if (action == CMD_SUBCMD_ENTER_PS) {
> > priv->needtowakeup = 0;
> > priv->psstate = PS_STATE_AWAKE;
> > @@ -516,6 +535,7 @@
> > lbs_pr_alert("EVENT: snr high\n");
> > break;
> >
> > +#ifdef CONFIG_LIBERTAS_WEXT
> > case MACREG_INT_CODE_MESH_AUTO_STARTED:
> > /* Ignore spurious autostart events if autostart is disabled */
> > if (!priv->mesh_autostart_enabled) {
> > @@ -532,6 +552,7 @@
> > priv->mode = IW_MODE_ADHOC;
> > schedule_work(&priv->sync_channel);
> > break;
> > +#endif
> >
> > default:
> > lbs_pr_alert("EVENT: unknown event id %d\n", event);
> > --- linux-wl.orig/drivers/net/wireless/libertas/debugfs.c
> > +++ linux-wl/drivers/net/wireless/libertas/debugfs.c
> > @@ -4,7 +4,6 @@
> > #include <linux/delay.h>
> > #include <linux/mm.h>
> > #include <linux/string.h>
> > -#include <net/iw_handler.h>
> > #include <net/lib80211.h>
> >
> > #include "dev.h"
> > @@ -60,6 +59,7 @@
> > }
> >
> >
> > +#ifdef CONFIG_LIBERTAS_WEXT
> > static ssize_t lbs_getscantable(struct file *file, char __user *userbuf,
> > size_t count, loff_t *ppos)
> > {
> > @@ -103,6 +103,7 @@
> > free_page(addr);
> > return res;
> > }
> > +#endif
> >
> > static ssize_t lbs_sleepparams_write(struct file *file,
> > const char __user *user_buf, size_t count,
> > @@ -722,8 +723,10 @@
> >
> > static const struct lbs_debugfs_files debugfs_files[] = {
> > { "info", 0444, FOPS(lbs_dev_info, write_file_dummy), },
> > +#ifdef CONFIG_LIBERTAS_WEXT
> > { "getscantable", 0444, FOPS(lbs_getscantable,
> > write_file_dummy), },
> > +#endif
> > { "sleepparams", 0644, FOPS(lbs_sleepparams_read,
> > lbs_sleepparams_write), },
> > };
> > --- linux-wl.orig/drivers/net/wireless/libertas/rx.c
> > +++ linux-wl/drivers/net/wireless/libertas/rx.c
> > @@ -34,6 +34,7 @@
> > void *eth80211_hdr;
> > } __attribute__ ((packed));
> >
> > +#ifdef CONFIG_LIBERTAS_WEXT
> > static int process_rxed_802_11_packet(struct lbs_private *priv,
> > struct sk_buff *skb);
> >
> > @@ -129,6 +130,7 @@
> >
> > lbs_deb_leave(LBS_DEB_RX);
> > }
> > +#endif
> >
> > /**
> > * @brief This function processes received packet and forwards it
> > @@ -154,12 +156,15 @@
> >
> > skb->ip_summed = CHECKSUM_NONE;
> >
> > +#ifdef CONFIG_LIBERTAS_WEXT
> > if (priv->monitormode)
> > return process_rxed_802_11_packet(priv, skb);
> > +#endif
> >
> > p_rx_pd = (struct rxpd *) skb->data;
> > p_rx_pkt = (struct rxpackethdr *) ((u8 *)p_rx_pd +
> > le32_to_cpu(p_rx_pd->pkt_ptr));
> > +#ifdef CONFIG_LIBERTAS_WEXT
> > if (priv->mesh_dev) {
> > if (priv->mesh_fw_ver == MESH_FW_OLD) {
> > if (p_rx_pd->rx_control & RxPD_MESH_FRAME)
> > @@ -169,6 +174,7 @@
> > dev = priv->mesh_dev;
> > }
> > }
> > +#endif
> >
> > lbs_deb_hex(LBS_DEB_RX, "RX Data: Before chop rxpd", skb->data,
> > min_t(unsigned int, skb->len, 100));
> > @@ -232,6 +238,7 @@
> > */
> > skb_pull(skb, hdrchop);
> >
> > +#ifdef CONFIG_LIBERTAS_WEXT
> > /* Take the data rate from the rxpd structure
> > * only if the rate is auto
> > */
> > @@ -239,6 +246,7 @@
> > priv->cur_rate = lbs_fw_index_to_data_rate(p_rx_pd->rx_rate);
> >
> > lbs_compute_rssi(priv, p_rx_pd);
> > +#endif
> >
> > lbs_deb_rx("rx data: size of actual packet %d\n", skb->len);
> > dev->stats.rx_bytes += skb->len;
> > @@ -257,6 +265,7 @@
> > }
> > EXPORT_SYMBOL_GPL(lbs_process_rxed_packet);
> >
> > +#ifdef CONFIG_LIBERTAS_WEXT
> > /**
> > * @brief This function converts Tx/Rx rates from the Marvell WLAN format
> > * (see Table 2 in Section 3.1) to IEEE80211_RADIOTAP_RATE units (500 Kb/s)
> > @@ -381,3 +390,4 @@
> > lbs_deb_leave_args(LBS_DEB_RX, "ret %d", ret);
> > return ret;
> > }
> > +#endif
> > --- linux-wl.orig/drivers/net/wireless/libertas/tx.c
> > +++ linux-wl/drivers/net/wireless/libertas/tx.c
> > @@ -12,6 +12,7 @@
> > #include "dev.h"
> > #include "wext.h"
> >
> > +#ifdef CONFIG_LIBERTAS_WEXT
> > /**
> > * @brief This function converts Tx/Rx rates from IEEE80211_RADIOTAP_RATE
> > * units (500 Kb/s) into Marvell WLAN format (see Table 8 in Section 3.2.1)
> > @@ -49,6 +50,7 @@
> > }
> > return 0;
> > }
> > +#endif
> >
> > /**
> > * @brief This function checks the conditions and sends packet to IF
> > @@ -88,8 +90,10 @@
> >
> >
> > netif_stop_queue(priv->dev);
> > +#ifdef CONFIG_LIBERTAS_WEXT
> > if (priv->mesh_dev)
> > netif_stop_queue(priv->mesh_dev);
> > +#endif
> >
> > if (priv->tx_pending_len) {
> > /* This can happen if packets come in on the mesh and eth
> > @@ -111,6 +115,7 @@
> > p802x_hdr = skb->data;
> > pkt_len = skb->len;
> >
> > +#ifdef CONFIG_LIBERTAS_WEXT
> > if (dev == priv->rtap_net_dev) {
> > struct tx_radiotap_hdr *rtap_hdr = (void *)skb->data;
> >
> > @@ -123,6 +128,9 @@
> >
> > /* copy destination address from 802.11 header */
> > memcpy(txpd->tx_dest_addr_high, p802x_hdr + 4, ETH_ALEN);
> > +#else
> > + if (0) {
> > +#endif
> > } else {
> > /* copy destination address from 802.3 header */
> > memcpy(txpd->tx_dest_addr_high, p802x_hdr, ETH_ALEN);
> > @@ -131,12 +139,14 @@
> > txpd->tx_packet_length = cpu_to_le16(pkt_len);
> > txpd->tx_packet_location = cpu_to_le32(sizeof(struct txpd));
> >
> > +#ifdef CONFIG_LIBERTAS_WEXT
> > if (dev == priv->mesh_dev) {
> > if (priv->mesh_fw_ver == MESH_FW_OLD)
> > txpd->tx_control |= cpu_to_le32(TxPD_MESH_FRAME);
> > else if (priv->mesh_fw_ver == MESH_FW_NEW)
> > txpd->u.bss.bss_num = MESH_IFACE_ID;
> > }
> > +#endif
> >
> > lbs_deb_hex(LBS_DEB_TX, "txpd", (u8 *) &txpd, sizeof(struct txpd));
> >
> > @@ -154,6 +164,7 @@
> >
> > dev->trans_start = jiffies;
> >
> > +#ifdef CONFIG_LIBERTAS_WEXT
> > if (priv->monitormode) {
> > /* Keep the skb to echo it back once Tx feedback is
> > received from FW */
> > @@ -161,6 +172,9 @@
> >
> > /* Keep the skb around for when we get feedback */
> > priv->currenttxskb = skb;
> > +#else
> > + if (0) {
> > +#endif
> > } else {
> > free:
> > dev_kfree_skb_any(skb);
> > @@ -173,6 +187,7 @@
> > return ret;
> > }
> >
> > +#ifdef CONFIG_LIBERTAS_WEXT
> > /**
> > * @brief This function sends to the host the last transmitted packet,
> > * filling the radiotap headers with transmission information.
> > @@ -207,3 +222,4 @@
> > netif_wake_queue(priv->mesh_dev);
> > }
> > EXPORT_SYMBOL_GPL(lbs_send_tx_feedback);
> > +#endif
> > --- linux-wl.orig/drivers/net/wireless/libertas/if_usb.c
> > +++ linux-wl/drivers/net/wireless/libertas/if_usb.c
> > @@ -757,6 +757,7 @@
> > lbs_deb_usbd(&cardp->udev->dev, "**EVENT** 0x%X\n", event);
> > kfree_skb(skb);
> >
> > +#ifdef CONFIG_LIBERTAS_WEXT
> > /* Icky undocumented magic special case */
> > if (event & 0xffff0000) {
> > u32 trycount = (event & 0xffff0000) >> 16;
> > @@ -764,6 +765,7 @@
> > lbs_send_tx_feedback(priv, trycount);
> > } else
> > lbs_queue_event(priv, event & 0xFF);
> > +#endif
> > break;
> >
> > default:
> > --- linux-wl.orig/drivers/net/wireless/libertas/assoc.h
> > +++ linux-wl/drivers/net/wireless/libertas/assoc.h
> > @@ -3,6 +3,7 @@
> > #ifndef _LBS_ASSOC_H_
> > #define _LBS_ASSOC_H_
> >
> > +#ifdef CONFIG_LIBERTAS_WEXT
> >
> > #include "defs.h"
> > #include "host.h"
> > @@ -152,4 +153,6 @@
> > int lbs_cmd_802_11_key_material(struct lbs_private *priv, uint16_t cmd_action,
> > struct assoc_request *assoc);
> >
> > +#endif
> > +
> > #endif /* _LBS_ASSOC_H */
> > --- linux-wl.orig/drivers/net/wireless/libertas/scan.h
> > +++ linux-wl/drivers/net/wireless/libertas/scan.h
> > @@ -7,6 +7,8 @@
> > #ifndef _LBS_SCAN_H
> > #define _LBS_SCAN_H
> >
> > +#ifdef CONFIG_LIBERTAS_WEXT
> > +
> > #include <net/iw_handler.h>
> >
> > struct lbs_private;
> > @@ -61,3 +63,5 @@
> > void lbs_scan_worker(struct work_struct *work);
> >
> > #endif
> > +
> > +#endif
> > --- linux-wl.orig/drivers/net/wireless/libertas/wext.h
> > +++ linux-wl/drivers/net/wireless/libertas/wext.h
> > @@ -4,9 +4,13 @@
> > #ifndef _LBS_WEXT_H_
> > #define _LBS_WEXT_H_
> >
> > +#ifdef CONFIG_LIBERTAS_WEXT
> > +
> > void lbs_send_iwevcustom_event(struct lbs_private *priv, s8 *str);
> >
> > extern struct iw_handler_def lbs_handler_def;
> > extern struct iw_handler_def mesh_handler_def;
> >
> > #endif
> > +
> > +#endif
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply
* Re: NOHZ: local_softirq_pending 08
From: Tilman Schmidt @ 2009-10-21 18:46 UTC (permalink / raw)
To: Jarek Poplawski
Cc: David Miller, johannes, hidave.darkstar, linux-kernel, tglx,
linux-wireless, linux-ppp, netdev, paulus
In-Reply-To: <4AD76184.6030900@gmail.com>
[-- Attachment #1: Type: text/plain, Size: 2202 bytes --]
On 15.10.2009 19:53 Jarek Poplawski wrote:
> Jarek Poplawski wrote, On 10/15/2009 01:40 PM:
>
>> On 12-10-2009 13:25, Tilman Schmidt wrote:
>>> I have encountered the message in the subject during a test of
>>> the Gigaset CAPI driver, and would like to determine whether
>>> it's a bug in the driver, a bug somewhere else, or no bug at
>>> all. The test scenario was PPP over ISDN with pppd+capiplugin.
>>> In an alternative scenario, also PPP over ISDN but with
>>> smpppd+capidrv, the message did not occur.
I'm sorry, I had confused the two cases. The message occurs in
the smpppd+capidrv scenario, not with pppd+capiplugin.
>>> Johannes' answer pointed me to the netif_rx() function.
>>> The Gigaset driver itself doesn't call that function at all.
>>> In the scenario where I saw the message, it was the SYNC_PPP
>>> line discipline that did.
This analysis was therefore wrong. It would be the netif_rx()
call towards the end of isdn_ppp_push_higher() in
drivers/isdn/i4l/isdn_ppp.c L1177.
>> Anyway, I agree with Michael Buesch there is no reason to waste time
>> for tracking all netif_rx vs netif_rx_ni uses, and it seems we could
>> avoid it by using the "proper" version of raise_softirq_irqoff() in
>> __napi_schedule(). Could anybody try if I'm not wrong?
>>
>> net/core/dev.c | 2 +-
>> 1 files changed, 1 insertions(+), 1 deletions(-)
>>
>> diff --git a/net/core/dev.c b/net/core/dev.c
>> index 28b0b9e..7fc4009 100644
>> --- a/net/core/dev.c
>> +++ b/net/core/dev.c
>> @@ -2728,7 +2728,7 @@ void __napi_schedule(struct napi_struct *n)
>>
>> local_irq_save(flags);
>> list_add_tail(&n->poll_list, &__get_cpu_var(softnet_data).poll_list);
>> - __raise_softirq_irqoff(NET_RX_SOFTIRQ);
>> + raise_softirq_irqoff(NET_RX_SOFTIRQ);
>> local_irq_restore(flags);
>> }
>> EXPORT_SYMBOL(__napi_schedule);
I have tested your patch and I can confirm that it fixes the messages.
I have not noticed any ill effects.
Thanks,
Tilman
--
Tilman Schmidt E-Mail: tilman@imap.cc
Bonn, Germany
Diese Nachricht besteht zu 100% aus wiederverwerteten Bits.
Ungeöffnet mindestens haltbar bis: (siehe Rückseite)
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 254 bytes --]
^ permalink raw reply
* WARNING: at net/mac80211/rx.c:2488 ath_rx_tasklet+0x4a5/0x5ee [ath9k]()
From: Dominik D. Geyer @ 2009-10-21 19:48 UTC (permalink / raw)
To: linux-wireless
Just found this one in my logs. The system uses the bit older kernel
2.6.30-gentoo-r3 (with gentoo patches - I don't think it has an effect on this).
The wireless card uses the ath9k driver.
Maybe this issue is already fixed in newer kernel versions. I'm going to fetch
2.6.32.
------------[ cut here ]------------
WARNING: at net/mac80211/rx.c:2488 ath_rx_tasklet+0x4a5/0x5ee [ath9k]()
Hardware name: CN400-8237
Modules linked in: snd_pcm_oss snd_mixer_oss dm_crypt dm_mod padlock_aes via_rng vfat fat pppoe pppox ppp_generic slhc bridge stp llc w83627hf hwmon_vid w83697hf_wdt snd_via82xx snd_ac97_codec ac97_bus snd_pcm snd_timer snd_page_alloc snd_mpu401_uart ath9k snd_rawmidi snd led_class soundcore i2c_viapro via_rhine
Pid: 0, comm: swapper Not tainted 2.6.30-gentoo-r3-homeserver #8
Call Trace:
[<c01191fb>] ? warn_slowpath_common+0x41/0x71
[<c0119218>] ? warn_slowpath_common+0x5e/0x71
[<c0119235>] ? warn_slowpath_null+0xa/0xc
[<cf8ca4ba>] ? ath_rx_tasklet+0x4a5/0x5ee [ath9k]
[<cf8c7b6f>] ? ath9k_tasklet+0x31/0x55 [ath9k]
[<c011c833>] ? tasklet_action+0x3d/0x63
[<c011c659>] ? __do_softirq+0x4c/0xb5
[<c011c6e4>] ? do_softirq+0x22/0x26
[<c011c8e1>] ? irq_exit+0x25/0x4e
[<c0103fbf>] ? do_IRQ+0x53/0x64
[<c0102d69>] ? common_interrupt+0x29/0x30
[<c0107037>] ? default_idle+0x25/0x38
[<c0101aa8>] ? cpu_idle+0x23/0x3c
[<c04ba917>] ? start_kernel+0x23f/0x242
---[ end trace 52a130d663d9bfc8 ]---
^ permalink raw reply
* Re: TL-WN721N
From: Pavel Roskin @ 2009-10-21 20:23 UTC (permalink / raw)
To: Azhar; +Cc: linux-wireless
In-Reply-To: <loom.20091018T103209-571@post.gmane.org>
On Sun, 2009-10-18 at 08:33 +0000, Azhar wrote:
> ndiswrapper -l
>
> WARNING: All config files need .conf: /etc/modprobe.d/ndiswrapper, it will be
> ignored in a future release.
This has been fixed in the ndiswrapper subversion repository. Next
version of ndiswrapper will use /etc/modprobe.d/ndiswrapper.conf
--
Regards,
Pavel Roskin
^ permalink raw reply
* [PATCH] net: Adjust softirq raising in __napi_schedule
From: Jarek Poplawski @ 2009-10-21 21:19 UTC (permalink / raw)
To: Tilman Schmidt
Cc: David Miller, johannes, hidave.darkstar, linux-kernel, tglx,
linux-wireless, linux-ppp, netdev, paulus, Michael Buesch,
Oliver Hartkopp
In-Reply-To: <4ADF5710.4030505@imap.cc>
On Wed, Oct 21, 2009 at 08:46:40PM +0200, Tilman Schmidt wrote:
...
> I have tested your patch and I can confirm that it fixes the messages.
> I have not noticed any ill effects.
OK. So, in any case, here is this next variant/proposal.
Thanks,
Jarek P.
------------------------>
net: Adjust softirq raising in __napi_schedule
This patch changes __raise_softirq_irqoff() to raise_softirq_irqoff()
in __napi_schedule() to enable proper softirq scheduling from process
context. The main intent is to let use netif_rx() universally, and
make netif_rx_ni() redundant.
Currently using netif_rx() instead of netif_rx_ni() triggers:
"NOHZ: local_softirq_pending 08" warnings, but additional cost of one
"if" on the fast path doesn't seem to justify maintaining it
separately.
This patch is based on the analysis, suggestions and the original
patch for mac80211 by: Michael Buesch <mb@bu3sch.de>
Another patch calling netif_rx variants conditionally was done by:
Oliver Hartkopp <oliver@hartkopp.net>
Reported-by: Michael Buesch <mb@bu3sch.de>
Reported-by: Oliver Hartkopp <oliver@hartkopp.net>
Reported-by: Tilman Schmidt <tilman@imap.cc>
Diagnosed-by: Michael Buesch <mb@bu3sch.de>
Tested-by: Tilman Schmidt <tilman@imap.cc>
Signed-off-by: Jarek Poplawski <jarkao2@gmail.com>
---
net/core/dev.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/net/core/dev.c b/net/core/dev.c
index 28b0b9e..7fc4009 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -2728,7 +2728,7 @@ void __napi_schedule(struct napi_struct *n)
local_irq_save(flags);
list_add_tail(&n->poll_list, &__get_cpu_var(softnet_data).poll_list);
- __raise_softirq_irqoff(NET_RX_SOFTIRQ);
+ raise_softirq_irqoff(NET_RX_SOFTIRQ);
local_irq_restore(flags);
}
EXPORT_SYMBOL(__napi_schedule);
^ permalink raw reply related
* Re: [PATCH] net: Adjust softirq raising in __napi_schedule
From: Johannes Berg @ 2009-10-21 21:25 UTC (permalink / raw)
To: Jarek Poplawski
Cc: Tilman Schmidt, David Miller, hidave.darkstar, linux-kernel, tglx,
linux-wireless, linux-ppp, netdev, paulus, Michael Buesch,
Oliver Hartkopp
In-Reply-To: <20091021211906.GA11401@ami.dom.local>
[-- Attachment #1: Type: text/plain, Size: 2238 bytes --]
On Wed, 2009-10-21 at 23:19 +0200, Jarek Poplawski wrote:
> On Wed, Oct 21, 2009 at 08:46:40PM +0200, Tilman Schmidt wrote:
> ...
> > I have tested your patch and I can confirm that it fixes the messages.
> > I have not noticed any ill effects.
>
> OK. So, in any case, here is this next variant/proposal.
>
> Thanks,
> Jarek P.
> ------------------------>
> net: Adjust softirq raising in __napi_schedule
>
> This patch changes __raise_softirq_irqoff() to raise_softirq_irqoff()
> in __napi_schedule() to enable proper softirq scheduling from process
> context. The main intent is to let use netif_rx() universally, and
> make netif_rx_ni() redundant.
>
> Currently using netif_rx() instead of netif_rx_ni() triggers:
> "NOHZ: local_softirq_pending 08" warnings, but additional cost of one
> "if" on the fast path doesn't seem to justify maintaining it
> separately.
>
> This patch is based on the analysis, suggestions and the original
> patch for mac80211 by: Michael Buesch <mb@bu3sch.de>
>
> Another patch calling netif_rx variants conditionally was done by:
> Oliver Hartkopp <oliver@hartkopp.net>
>
> Reported-by: Michael Buesch <mb@bu3sch.de>
> Reported-by: Oliver Hartkopp <oliver@hartkopp.net>
> Reported-by: Tilman Schmidt <tilman@imap.cc>
> Diagnosed-by: Michael Buesch <mb@bu3sch.de>
> Tested-by: Tilman Schmidt <tilman@imap.cc>
> Signed-off-by: Jarek Poplawski <jarkao2@gmail.com>
> ---
>
> net/core/dev.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/net/core/dev.c b/net/core/dev.c
> index 28b0b9e..7fc4009 100644
> --- a/net/core/dev.c
> +++ b/net/core/dev.c
> @@ -2728,7 +2728,7 @@ void __napi_schedule(struct napi_struct *n)
>
> local_irq_save(flags);
> list_add_tail(&n->poll_list, &__get_cpu_var(softnet_data).poll_list);
> - __raise_softirq_irqoff(NET_RX_SOFTIRQ);
> + raise_softirq_irqoff(NET_RX_SOFTIRQ);
This still doesn't make any sense.
There may or may not be a lot of code that assumes that everything else
is run with other tasklets disabled, and that it cannot be interrupted
by a tasklet and thus create a race.
Can you prove that is not the case, across the entire networking layer?
johannes
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 801 bytes --]
^ permalink raw reply
* Re: Broadcom 4318 not working with bleeding edge kernels
From: Celejar @ 2009-10-21 21:34 UTC (permalink / raw)
To: Pavel Roskin; +Cc: linux-wireless
In-Reply-To: <1256138957.26054.4.camel@mj>
On Wed, 21 Oct 2009 11:29:17 -0400
Pavel Roskin <proski@gnu.org> wrote:
> On Tue, 2009-10-20 at 21:47 -0400, Celejar wrote:
>
> > Oct 17 19:44:19 localhost wpa_supplicant[3477]: Trying to associate
> > with 00:14:d1:3e:ff:30 (SSID='cranford' freq=2437 MHz) Oct 17
> > 19:44:19 localhost wpa_supplicant[3477]: Association request to the
> > driver failed
>
> Since the message is from wpa_supplicant, it must be something between
> wpa_supplicant and mac80211. I don't think any code in b43 is
> involved.
>
> Perhaps you should include some information about wpa_supplicant, i.e.
> its version and the command line. Please try the latest
> wpa_supplicant. Please try both wext and nl80211 drivers. That would
> help understand the extent of the problem.
Version is 0.6.9, from the Debian package version 0.6.9.3. I don't
know the exact command line, since I've been invoking it through the
Debian ifupdown scripts. I haven't been specifying a backend, and the
Debian documentation states that wext is used in that case.
I have been playing with it some more, and it sometimes works, and
sometimes doesn't. The only absolutely consistent pattern that I've
seen is that (in my limited testing) it seems to always work right
after unloading / reloading the driver (b43) (or a fresh boot).
As I mentioned, I've been using the Debian ifupdown scripts. I have
now tried running wpa_supplicant directly, and so far it has worked
consistently, with a very minimal, mostly default config:
'wpa_supplicant -iwlan0 -c/wpa.conf'
where wpa.conf contains:
ctrl_interface=/var/run/wpa_supplicant
network={
ssid="my-ssid"
psk="my passphrase"
}
So at this point, I guess the problem is something that I need to
report to Debian, some sort of bugginess with their scripts. Thanks
for the help ;)
Celejar
--
mailmin.sourceforge.net - remote access via secure (OpenPGP) email
ssuds.sourceforge.net - A Simple Sudoku Solver and Generator
^ permalink raw reply
* Re: [PATCH] net: Adjust softirq raising in __napi_schedule
From: Tilman Schmidt @ 2009-10-21 21:37 UTC (permalink / raw)
To: Johannes Berg
Cc: Jarek Poplawski, David Miller, hidave.darkstar, linux-kernel,
tglx, linux-wireless, linux-ppp, netdev, paulus, Michael Buesch,
Oliver Hartkopp
In-Reply-To: <1256160330.12174.2.camel@johannes.local>
[-- Attachment #1: Type: text/plain, Size: 574 bytes --]
Johannes Berg schrieb:
> This still doesn't make any sense.
>
> There may or may not be a lot of code that assumes that everything else
> is run with other tasklets disabled, and that it cannot be interrupted
> by a tasklet and thus create a race.
>
> Can you prove that is not the case, across the entire networking layer?
So what's the solution you propose?
--
Tilman Schmidt E-Mail: tilman@imap.cc
Bonn, Germany
Diese Nachricht besteht zu 100% aus wiederverwerteten Bits.
Ungeöffnet mindestens haltbar bis: (siehe Rückseite)
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 254 bytes --]
^ permalink raw reply
* Re: [PATCH] net: Adjust softirq raising in __napi_schedule
From: Jarek Poplawski @ 2009-10-21 21:39 UTC (permalink / raw)
To: Johannes Berg
Cc: Tilman Schmidt, David Miller, hidave.darkstar, linux-kernel, tglx,
linux-wireless, linux-ppp, netdev, paulus, Michael Buesch,
Oliver Hartkopp
In-Reply-To: <1256160330.12174.2.camel@johannes.local>
On Thu, Oct 22, 2009 at 06:25:30AM +0900, Johannes Berg wrote:
> On Wed, 2009-10-21 at 23:19 +0200, Jarek Poplawski wrote:
...
> > --- a/net/core/dev.c
> > +++ b/net/core/dev.c
> > @@ -2728,7 +2728,7 @@ void __napi_schedule(struct napi_struct *n)
> >
> > local_irq_save(flags);
> > list_add_tail(&n->poll_list, &__get_cpu_var(softnet_data).poll_list);
> > - __raise_softirq_irqoff(NET_RX_SOFTIRQ);
> > + raise_softirq_irqoff(NET_RX_SOFTIRQ);
>
> This still doesn't make any sense.
>
> There may or may not be a lot of code that assumes that everything else
> is run with other tasklets disabled, and that it cannot be interrupted
> by a tasklet and thus create a race.
>
> Can you prove that is not the case, across the entire networking layer?
I'm not sure I can understand your question. This patch is mainly to
avoid using netif_rx()/netif_rx_ni() pair as a test of proper process
context handling; IMHO there're better tools for this (lockdep,
WARN_ON's).
Jarek P.
^ permalink raw reply
* Re: Broadcom 4318 not working with bleeding edge kernels
From: Hin-Tak Leung @ 2009-10-21 22:37 UTC (permalink / raw)
To: Celejar; +Cc: Pavel Roskin, linux-wireless
In-Reply-To: <20091021173449.0a3ec80f.celejar@gmail.com>
On Wed, Oct 21, 2009 at 10:34 PM, Celejar <celejar@gmail.com> wrote:
> On Wed, 21 Oct 2009 11:29:17 -0400
> Pavel Roskin <proski@gnu.org> wrote:
>
>> On Tue, 2009-10-20 at 21:47 -0400, Celejar wrote:
>>
>> > Oct 17 19:44:19 localhost wpa_supplicant[3477]: Trying to associate
>> > with 00:14:d1:3e:ff:30 (SSID='cranford' freq=2437 MHz) Oct 17
>> > 19:44:19 localhost wpa_supplicant[3477]: Association request to the
>> > driver failed
>>
>> Since the message is from wpa_supplicant, it must be something between
>> wpa_supplicant and mac80211. I don't think any code in b43 is
>> involved.
>>
>> Perhaps you should include some information about wpa_supplicant, i.e.
>> its version and the command line. Please try the latest
>> wpa_supplicant. Please try both wext and nl80211 drivers. That would
>> help understand the extent of the problem.
>
> Version is 0.6.9, from the Debian package version 0.6.9.3. I don't
> know the exact command line, since I've been invoking it through the
> Debian ifupdown scripts. I haven't been specifying a backend, and the
> Debian documentation states that wext is used in that case.
'ps -lax -w -w' should show the full command line of currently running
processes. Read the documentation of ps.
also, have a look inside /var/log/wpa_supplicant.log (or wherever
Debian puts it) for the log.
> I have been playing with it some more, and it sometimes works, and
> sometimes doesn't. The only absolutely consistent pattern that I've
> seen is that (in my limited testing) it seems to always work right
> after unloading / reloading the driver (b43) (or a fresh boot).
>
> As I mentioned, I've been using the Debian ifupdown scripts. I have
> now tried running wpa_supplicant directly, and so far it has worked
> consistently, with a very minimal, mostly default config:
>
> 'wpa_supplicant -iwlan0 -c/wpa.conf'
>
> where wpa.conf contains:
>
> ctrl_interface=/var/run/wpa_supplicant
>
> network={
> ssid="my-ssid"
> psk="my passphrase"
> }
>
>
> So at this point, I guess the problem is something that I need to
> report to Debian, some sort of bugginess with their scripts. Thanks
> for the help ;)
>
> Celejar
> --
> mailmin.sourceforge.net - remote access via secure (OpenPGP) email
> ssuds.sourceforge.net - A Simple Sudoku Solver and Generator
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
^ permalink raw reply
* Re: [RFT 00/15] ath9k_hw ar9271 updates & AR5416 force bias
From: Luis R. Rodriguez @ 2009-10-22 3:42 UTC (permalink / raw)
To: linux-wireless, Sujith; +Cc: ath9k-devel, Luis R. Rodriguez
In-Reply-To: <1255934026-20686-1-git-send-email-lrodriguez@atheros.com>
On Mon, Oct 19, 2009 at 3:33 PM, Luis R. Rodriguez
<lrodriguez@atheros.com> wrote:
> This series started off to extend support for ar9271 on ath9k_hw
> but after review of the phy related code I noticed a fix for
> AR5416 was only partially being implemented and used for all
> chipsets. This series then adds the changes I've noticed so far
> required for ar9271 but also fixes and completes the orientation
> fix for AR5416 (force bias). Since I'm touching phy.c I also extend
> documentation for it.
>
> I don't have AR9285 cards with me but I do have an AR5416 cardbus
> card -- I'd appreciate it if someone can give this a test on AR9285
> but also more AR5416 cards -- this should help with TX on of AR5416
> and AR5418 on the 2.4 GHz band.
>
> Reports on issues or performance differences are greatly appreciated;
> the only issue I'd expect you'd see on non AR5416 hardware is a BUG_ON()
> which would be very obvious to notice and the performance enhancements
> should be seen on AR5416 for TX -- not yet sure exactly under what
> circumstances.
>
> Luis R. Rodriguez (15):
> ath9k_hw: modify the rf control register for ar9271 revision 1.0
> ath9k_hw: update register initialization/reset values for ar9271
> ath9k_hw: change the way we initialize the pll for ar9271
> ath9k_hw: start documenting 802.11n RF anlong front ends
> ath9k_hw: bail out early on ath9k_hw_init_rf()
> ath9k_hw: simplify rf attach and rename to
> ath9k_hw_rf_alloc_ext_banks()
> ath9k_hw: simplify ath9k_hw_rf_alloc_ext_banks()
> ath9k_hw: rename ath9k_hw_rf_free() to ath9k_hw_rf_free_ext_banks()
> ath9k_hw: make both analog channel change routines return int
> ath9k_hw: use a callback for frequency change
> ath9k_hw: order phy.c code and integrate spur mitigation
> ath9k_hw: make spur mitigation a callback
> ath9k_hw: remove unused modesIndex param from ath9k_hw_write_regs()
> ath9k_hw: Fix and complete force bias for AR5416
> ath9k_hw: make ath9k_phy_modify_rx_buffer() static
Omni-patch:
http://bombadil.infradead.org/~mcgrof/patches/all/all-2009-10-19.patch
Luis
^ permalink raw reply
* Re: [PATCH] cfg80211: allow driver to signal noise level
From: Holger Schurig @ 2009-10-22 7:13 UTC (permalink / raw)
To: Johannes Berg; +Cc: John Linville, linux-wireless
In-Reply-To: <1256080691.4475.8.camel@johannes.local>
On Wednesday 21 October 2009 01:18:11 Johannes Berg wrote:
> As discussed previously, noise is not a property of a station.
URL?
Should I aim for an "iw dev XXX show noise", e.g. try to
handle it as a property of the card? I could either add
an .get_noise() to cfg80211_ops, or better an .get_card_status()
with some bitmask of filled fields, like for the .get_station()
call. What would you prefer?
--
http://www.holgerschurig.de
^ permalink raw reply
* Re: [PATCH] libertas: move mic failure event to wext.c
From: Holger Schurig @ 2009-10-22 7:21 UTC (permalink / raw)
To: Randy Dunlap; +Cc: linux-wireless, John Linville, Dan Williams
In-Reply-To: <20091020085431.e26cce67.rdunlap@xenotime.net>
> argh. urgh. This file (or files) need to lose this
> non-kernel-doc function notation. Please.
Two things here:
* it's a copy and paste patch, so we move things just to another
place. This makes the cfg80211-patch less intrusive and also
makes the driver way smaller, once we don't compile WEXT in or
get rid of WEXT altogether. Normally for copy-and-paste patches
you shouldn't change other things.
* When I started with libertas, those comments where mostly
useful for me. I didn't care for /** or @, as I just read the
text. For me, those extra decorations have a less
negative "touch". The "positive" effect of having comments at
all did by far outweight the formatting.
For new code, I use a "normal" comment style, for example see
http://marc.info/?l=linux-wireless&m=125569942616188&w=2
So, if the comment style really annoys you, you could submit a
comment-reformat-patch.
--
http://www.holgerschurig.de
^ permalink raw reply
* Re: [PATCH] libertas: remove unused lbs_cmd_802_11_inactivity_timeout()
From: Holger Schurig @ 2009-10-22 7:28 UTC (permalink / raw)
To: Dan Williams; +Cc: linux-wireless, John Linville
In-Reply-To: <1256148756.5010.34.camel@localhost.localdomain>
> Pretty much like it sounds; it lets the device go to into
> powersave at user-specified interval after the last TX or RX,
> instead of having to wait one full beacon of inactivity.
Ok, nice.
But it could also have sounded like "report how long the card was
inactive", e.g. what "iw XXX link" can show.
Do you already have any idea about how to make those things like
TCP, inactivity etc available in NL80211/cfg80211 ?
--
http://www.holgerschurig.de
^ permalink raw reply
* [PATCH] libertas spi: fix sparse errors
From: Holger Schurig @ 2009-10-22 7:49 UTC (permalink / raw)
To: linux-wireless, John Linville, Dan Williams
This fixes the following sparse warnings:
$ make modules SUBDIRS=drivers/net/wireless/libertas C=1 CF=-D__CHECK_ENDIAN__
make: Entering directory `/usr/src/linux-wl'
CHECK drivers/net/wireless/libertas/if_spi.c
drivers/net/wireless/libertas/if_spi.c:137:16: warning: incorrect type in initializer (different base types)
drivers/net/wireless/libertas/if_spi.c:137:16: expected unsigned short [unsigned] [usertype] reg_out
drivers/net/wireless/libertas/if_spi.c:137:16: got restricted __le16 [usertype] <noident>
drivers/net/wireless/libertas/if_spi.c:191:16: warning: incorrect type in initializer (different base types)
drivers/net/wireless/libertas/if_spi.c:191:16: expected unsigned short [unsigned] [usertype] reg_out
drivers/net/wireless/libertas/if_spi.c:191:16: got restricted __le16 [usertype] <noident>
drivers/net/wireless/libertas/if_spi.c:256:24: warning: incorrect type in argument 1 (different base types)
drivers/net/wireless/libertas/if_spi.c:256:24: expected restricted __le32 const [usertype] *p
drivers/net/wireless/libertas/if_spi.c:256:24: got unsigned int *<noident>
drivers/net/wireless/libertas/if_spi.c:243:24: warning: incorrect type in argument 1 (different base types)
drivers/net/wireless/libertas/if_spi.c:243:24: expected restricted __le16 const [usertype] *p
drivers/net/wireless/libertas/if_spi.c:243:24: got unsigned short *<noident>
drivers/net/wireless/libertas/if_spi.c:171:7: warning: incorrect type in assignment (different base types)
drivers/net/wireless/libertas/if_spi.c:171:7: expected unsigned short [unsigned] [usertype] buff
drivers/net/wireless/libertas/if_spi.c:171:7: got restricted __le16 [usertype] <noident>
drivers/net/wireless/libertas/if_spi.c:171:7: warning: incorrect type in assignment (different base types)
drivers/net/wireless/libertas/if_spi.c:171:7: expected unsigned short [unsigned] [usertype] buff
drivers/net/wireless/libertas/if_spi.c:171:7: got restricted __le16 [usertype] <noident>
drivers/net/wireless/libertas/if_spi.c:171:7: warning: incorrect type in assignment (different base types)
drivers/net/wireless/libertas/if_spi.c:171:7: expected unsigned short [unsigned] [usertype] buff
drivers/net/wireless/libertas/if_spi.c:171:7: got restricted __le16 [usertype] <noident>
drivers/net/wireless/libertas/if_spi.c:171:7: warning: incorrect type in assignment (different base types)
drivers/net/wireless/libertas/if_spi.c:171:7: expected unsigned short [unsigned] [usertype] buff
drivers/net/wireless/libertas/if_spi.c:171:7: got restricted __le16 [usertype] <noident>
drivers/net/wireless/libertas/if_spi.c:171:7: warning: incorrect type in assignment (different base types)
drivers/net/wireless/libertas/if_spi.c:171:7: expected unsigned short [unsigned] [usertype] buff
drivers/net/wireless/libertas/if_spi.c:171:7: got restricted __le16 [usertype] <noident>
drivers/net/wireless/libertas/if_spi.c:243:24: warning: incorrect type in argument 1 (different base types)
drivers/net/wireless/libertas/if_spi.c:243:24: expected restricted __le16 const [usertype] *p
drivers/net/wireless/libertas/if_spi.c:243:24: got unsigned short *<noident>
drivers/net/wireless/libertas/if_spi.c:171:7: warning: incorrect type in assignment (different base types)
drivers/net/wireless/libertas/if_spi.c:171:7: expected unsigned short [unsigned] [usertype] buff
drivers/net/wireless/libertas/if_spi.c:171:7: got restricted __le16 [usertype] <noident>
drivers/net/wireless/libertas/if_spi.c:171:7: warning: incorrect type in assignment (different base types)
drivers/net/wireless/libertas/if_spi.c:171:7: expected unsigned short [unsigned] [usertype] buff
drivers/net/wireless/libertas/if_spi.c:171:7: got restricted __le16 [usertype] <noident>
drivers/net/wireless/libertas/if_spi.c:171:7: warning: incorrect type in assignment (different base types)
drivers/net/wireless/libertas/if_spi.c:171:7: expected unsigned short [unsigned] [usertype] buff
drivers/net/wireless/libertas/if_spi.c:171:7: got restricted __le16 [usertype] <noident>
drivers/net/wireless/libertas/if_spi.c:171:7: warning: incorrect type in assignment (different base types)
drivers/net/wireless/libertas/if_spi.c:171:7: expected unsigned short [unsigned] [usertype] buff
drivers/net/wireless/libertas/if_spi.c:171:7: got restricted __le16 [usertype] <noident>
drivers/net/wireless/libertas/if_spi.c:171:7: warning: incorrect type in assignment (different base types)
drivers/net/wireless/libertas/if_spi.c:171:7: expected unsigned short [unsigned] [usertype] buff
drivers/net/wireless/libertas/if_spi.c:171:7: got restricted __le16 [usertype] <noident>
drivers/net/wireless/libertas/if_spi.c:171:7: warning: incorrect type in assignment (different base types)
drivers/net/wireless/libertas/if_spi.c:171:7: expected unsigned short [unsigned] [usertype] buff
drivers/net/wireless/libertas/if_spi.c:171:7: got restricted __le16 [usertype] <noident>
drivers/net/wireless/libertas/if_spi.c:243:24: warning: incorrect type in argument 1 (different base types)
drivers/net/wireless/libertas/if_spi.c:243:24: expected restricted __le16 const [usertype] *p
drivers/net/wireless/libertas/if_spi.c:243:24: got unsigned short *<noident>
drivers/net/wireless/libertas/if_spi.c:171:7: warning: incorrect type in assignment (different base types)
drivers/net/wireless/libertas/if_spi.c:171:7: expected unsigned short [unsigned] [usertype] buff
drivers/net/wireless/libertas/if_spi.c:171:7: got restricted __le16 [usertype] <noident>
drivers/net/wireless/libertas/if_spi.c:171:7: warning: incorrect type in assignment (different base types)
drivers/net/wireless/libertas/if_spi.c:171:7: expected unsigned short [unsigned] [usertype] buff
drivers/net/wireless/libertas/if_spi.c:171:7: got restricted __le16 [usertype] <noident>
drivers/net/wireless/libertas/if_spi.c:243:24: warning: incorrect type in argument 1 (different base types)
drivers/net/wireless/libertas/if_spi.c:243:24: expected restricted __le16 const [usertype] *p
drivers/net/wireless/libertas/if_spi.c:243:24: got unsigned short *<noident>
drivers/net/wireless/libertas/if_spi.c:243:24: warning: incorrect type in argument 1 (different base types)
drivers/net/wireless/libertas/if_spi.c:243:24: expected restricted __le16 const [usertype] *p
drivers/net/wireless/libertas/if_spi.c:243:24: got unsigned short *<noident>
drivers/net/wireless/libertas/if_spi.c:171:7: warning: incorrect type in assignment (different base types)
drivers/net/wireless/libertas/if_spi.c:171:7: expected unsigned short [unsigned] [usertype] buff
drivers/net/wireless/libertas/if_spi.c:171:7: got restricted __le16 [usertype] <noident>
drivers/net/wireless/libertas/if_spi.c:171:7: warning: incorrect type in assignment (different base types)
drivers/net/wireless/libertas/if_spi.c:171:7: expected unsigned short [unsigned] [usertype] buff
drivers/net/wireless/libertas/if_spi.c:171:7: got restricted __le16 [usertype] <noident>
drivers/net/wireless/libertas/if_spi.c:243:24: warning: incorrect type in argument 1 (different base types)
drivers/net/wireless/libertas/if_spi.c:243:24: expected restricted __le16 const [usertype] *p
drivers/net/wireless/libertas/if_spi.c:243:24: got unsigned short *<noident>
Signed-off-by: Holger Schurig <hs4233@mail.mn-solutions.de>
Tested-by: Andrey Yurovsky <andrey@cozybit.com>
---
v2: fixed subject line, Andrey tested on a Blackfin machine
--- linux-wl.orig/drivers/net/wireless/libertas/if_spi.c
+++ linux-wl/drivers/net/wireless/libertas/if_spi.c
@@ -134,7 +134,7 @@
static int spu_write(struct if_spi_card *card, u16 reg, const u8 *buf, int len)
{
int err = 0;
- u16 reg_out = cpu_to_le16(reg | IF_SPI_WRITE_OPERATION_MASK);
+ __le16 reg_out = cpu_to_le16(reg | IF_SPI_WRITE_OPERATION_MASK);
struct spi_message m;
struct spi_transfer reg_trans;
struct spi_transfer data_trans;
@@ -166,7 +166,7 @@
static inline int spu_write_u16(struct if_spi_card *card, u16 reg, u16 val)
{
- u16 buff;
+ __le16 buff;
buff = cpu_to_le16(val);
return spu_write(card, reg, (u8 *)&buff, sizeof(u16));
@@ -188,7 +188,7 @@
{
unsigned int delay;
int err = 0;
- u16 reg_out = cpu_to_le16(reg | IF_SPI_READ_OPERATION_MASK);
+ __le16 reg_out = cpu_to_le16(reg | IF_SPI_READ_OPERATION_MASK);
struct spi_message m;
struct spi_transfer reg_trans;
struct spi_transfer dummy_trans;
@@ -235,7 +235,7 @@
/* Read 16 bits from an SPI register */
static inline int spu_read_u16(struct if_spi_card *card, u16 reg, u16 *val)
{
- u16 buf;
+ __le16 buf;
int ret;
ret = spu_read(card, reg, (u8 *)&buf, sizeof(buf));
@@ -248,7 +248,7 @@
* The low 16 bits are read first. */
static int spu_read_u32(struct if_spi_card *card, u16 reg, u32 *val)
{
- u32 buf;
+ __le32 buf;
int err;
err = spu_read(card, reg, (u8 *)&buf, sizeof(buf));
--
http://www.holgerschurig.de
^ permalink raw reply
* Re: [PATCH] libertas: remove handling for CMD_802_11_LED_GPIO_CTRL
From: Holger Schurig @ 2009-10-22 7:53 UTC (permalink / raw)
To: Dan Williams; +Cc: linux-wireless, John Linville
In-Reply-To: <1256149730.5010.39.camel@localhost.localdomain>
> It's actually used by the OLPC folks; but right now there's
> simply no mechanism to configure that ability via WEXT. Is
> there some way to do this via the kernel LED framework instead
> that libertas should be using?
They use it?
No one did bother to send a patch for the in-kernel Libertas
driver during the last year. Sigh.
Also, if they use it, they need a patch on top of what is now in
the kernel, because the current in-kernel libertas driver has no
code to issue the CMD_802_11_LED_GPIO_CTRL. That's why I removed
it in the first place.
It's O.K. for me to keep this code in (it doesn't harm), but a
better approach would be
a) use a new-style commands, a.k.a. lbs_cmd_with_response()
b) use the in-kernel LED support (as you said)
--
http://www.holgerschurig.de
^ permalink raw reply
* Re: [RFC] libertas: monster-patch to make CFG/WEXT configurable
From: Holger Schurig @ 2009-10-22 9:28 UTC (permalink / raw)
To: Dan Williams; +Cc: linux-wireless
In-Reply-To: <1256150184.5010.45.camel@localhost.localdomain>
> For the mesh interface stuff, especially in tx/rx paths, would
> you mind not ifdefing that? Since with cfg80211,
> priv->mesh_dev will always be NULL, those checks will be just
> fine and you still don't have to care about mesh.
Sure, I'll do that.
I just thought that there's no need for priv->mesh_dev in the
cfg80211 case. Wouldn't mesh be activated by "iw dev XXX set
type mesh"? Then cfg80211_ops .change_intf() would be called.
Now that could either populate priv->mesh_dev ... or it could
change priv->dev. Not sure about what is better. But the answer
to this would tell us how to handle the mesh tx/rx paths.
cmdresp.c checks for priv->mesh_autostart_enabled. Is this
another "sitting-forever-in-OLPC" thingy? It's nowhere else
used and there's no code to set it.
> I'm sure that the bits for SNMP_MIB_OID_BSS_TYPE could also be
> converted to use lib80211 or cfg80211 values instead of WEXT
> ones; I just picked WEXT at the time because we had no cfg80211
> yet.
Good idea.
However, when I'm teaching cfg80211 about the SNMP-commands, I'll
use new-style commands anyway. I'd need them for RTS threshold
etc anyway.
BTW: I added the RX part of the monitor in my cfg80211
implementation. But for my CF card, I'm still stuck with firmware
5.0.16.p0. That doesn't support monitor mode. However, I also
have some USB stick around (got it from you!). Do you know which
firmware for this USB stick supports monitor?
--
http://www.holgerschurig.de
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox