Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 150641
b: refs/heads/master
c: 5fd164e
h: refs/heads/master
i:
  150639: 0496213
v: v3
  • Loading branch information
Dan Williams authored and John W. Linville committed Jun 3, 2009
1 parent 72423a5 commit 012d9c0
Show file tree
Hide file tree
Showing 6 changed files with 71 additions and 99 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: d77b034f62d4b8c6c39450d99de224b9b2c5debb
refs/heads/master: 5fd164e96cb9dc111f75468378de38c67b0fd161
57 changes: 27 additions & 30 deletions trunk/drivers/net/wireless/libertas/assoc.c
Original file line number Diff line number Diff line change
Expand Up @@ -219,11 +219,10 @@ static int lbs_adhoc_join(struct lbs_private *priv,
memcpy(&cmd.bss.bssid, &bss->bssid, ETH_ALEN);
memcpy(&cmd.bss.ssid, &bss->ssid, bss->ssid_len);

memcpy(&cmd.bss.phyparamset, &bss->phyparamset,
sizeof(union ieeetypes_phyparamset));
memcpy(&cmd.bss.ds, &bss->phy.ds, sizeof(struct ieee_ie_ds_param_set));

memcpy(&cmd.bss.ssparamset, &bss->ssparamset,
sizeof(union IEEEtypes_ssparamset));
memcpy(&cmd.bss.ibss, &bss->ss.ibss,
sizeof(struct ieee_ie_ibss_param_set));

cmd.bss.capability = cpu_to_le16(bss->capability & CAPINFO_MASK);
lbs_deb_join("ADHOC_J_CMD: tmpcap=%4X CAPINFO_MASK=%4X\n",
Expand Down Expand Up @@ -260,7 +259,7 @@ static int lbs_adhoc_join(struct lbs_private *priv,
*/
lbs_set_basic_rate_flags(cmd.bss.rates, ratesize);

cmd.bss.ssparamset.ibssparamset.atimwindow = cpu_to_le16(bss->atimwindow);
cmd.bss.ibss.atimwindow = bss->atimwindow;

if (assoc_req->secinfo.wep_enabled) {
u16 tmp = le16_to_cpu(cmd.bss.capability);
Expand Down Expand Up @@ -343,14 +342,14 @@ static int lbs_adhoc_start(struct lbs_private *priv,
WARN_ON(!assoc_req->channel);

/* set Physical parameter set */
cmd.phyparamset.dsparamset.elementid = WLAN_EID_DS_PARAMS;
cmd.phyparamset.dsparamset.len = 1;
cmd.phyparamset.dsparamset.currentchan = assoc_req->channel;
cmd.ds.elementid = WLAN_EID_DS_PARAMS;
cmd.ds.len = 1;
cmd.ds.channel = assoc_req->channel;

/* set IBSS parameter set */
cmd.ssparamset.ibssparamset.elementid = WLAN_EID_IBSS_PARAMS;
cmd.ssparamset.ibssparamset.len = 2;
cmd.ssparamset.ibssparamset.atimwindow = 0;
cmd.ibss.elementid = WLAN_EID_IBSS_PARAMS;
cmd.ibss.len = 2;
cmd.ibss.atimwindow = cpu_to_le16(0);

/* set capability info */
tmpcap = WLAN_CAPABILITY_IBSS;
Expand Down Expand Up @@ -1560,8 +1559,8 @@ int lbs_cmd_80211_associate(struct lbs_private *priv,
u8 *pos;
u16 tmpcap, tmplen;
struct mrvlietypes_ssidparamset *ssid;
struct mrvlietypes_phyparamset *phy;
struct mrvlietypes_ssparamset *ss;
struct mrvlietypes_dsparamset *ds;
struct mrvlietypes_cfparamset *cf;
struct mrvlietypes_ratesparamset *rates;
struct mrvlietypes_rsnparamset *rsn;

Expand Down Expand Up @@ -1594,20 +1593,18 @@ int lbs_cmd_80211_associate(struct lbs_private *priv,
memcpy(ssid->ssid, bss->ssid, tmplen);
pos += sizeof(ssid->header) + tmplen;

phy = (struct mrvlietypes_phyparamset *) pos;
phy->header.type = cpu_to_le16(TLV_TYPE_PHY_DS);
tmplen = sizeof(phy->fh_ds.dsparamset);
phy->header.len = cpu_to_le16(tmplen);
memcpy(&phy->fh_ds.dsparamset,
&bss->phyparamset.dsparamset.currentchan,
tmplen);
pos += sizeof(phy->header) + tmplen;

ss = (struct mrvlietypes_ssparamset *) pos;
ss->header.type = cpu_to_le16(TLV_TYPE_CF);
tmplen = sizeof(ss->cf_ibss.cfparamset);
ss->header.len = cpu_to_le16(tmplen);
pos += sizeof(ss->header) + tmplen;
ds = (struct mrvlietypes_dsparamset *) pos;
ds->header.type = cpu_to_le16(TLV_TYPE_PHY_DS);
ds->header.len = cpu_to_le16(1);
ds->channel = bss->phy.ds.channel;
pos += sizeof(ds->header) + 1;

cf = (struct mrvlietypes_cfparamset *) pos;
cf->header.type = cpu_to_le16(TLV_TYPE_CF);
tmplen = sizeof(*cf) - sizeof (cf->header);
cf->header.len = cpu_to_le16(tmplen);
/* IE payload should be zeroed, firmware fills it in for us */
pos += sizeof(*cf);

rates = (struct mrvlietypes_ratesparamset *) pos;
rates->header.type = cpu_to_le16(TLV_TYPE_RATES);
Expand Down Expand Up @@ -1643,7 +1640,7 @@ int lbs_cmd_80211_associate(struct lbs_private *priv,
}

/* update curbssparams */
priv->curbssparams.channel = bss->phyparamset.dsparamset.currentchan;
priv->curbssparams.channel = bss->phy.ds.channel;

if (lbs_parse_dnld_countryinfo_11d(priv, bss)) {
ret = -1;
Expand All @@ -1669,7 +1666,7 @@ int lbs_ret_80211_associate(struct lbs_private *priv,
{
int ret = 0;
union iwreq_data wrqu;
struct ieeetypes_assocrsp *passocrsp;
struct ieee_assoc_response *passocrsp;
struct bss_descriptor *bss;
u16 status_code;

Expand All @@ -1682,7 +1679,7 @@ int lbs_ret_80211_associate(struct lbs_private *priv,
}
bss = &priv->in_progress_assoc_req->bss;

passocrsp = (struct ieeetypes_assocrsp *) &resp->params;
passocrsp = (struct ieee_assoc_response *) &resp->params;

/*
* Older FW versions map the IEEE 802.11 Status Code in the association
Expand Down
6 changes: 3 additions & 3 deletions trunk/drivers/net/wireless/libertas/dev.h
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@ struct bss_descriptor {
u32 rssi;
u32 channel;
u16 beaconperiod;
u32 atimwindow;
__le16 atimwindow;

/* IW_MODE_AUTO, IW_MODE_ADHOC, IW_MODE_INFRA */
u8 mode;
Expand All @@ -350,8 +350,8 @@ struct bss_descriptor {

unsigned long last_scanned;

union ieeetypes_phyparamset phyparamset;
union IEEEtypes_ssparamset ssparamset;
union ieee_phy_param_set phy;
union ieee_ss_param_set ss;

struct ieeetypes_countryinfofullset countryinfo;

Expand Down
16 changes: 10 additions & 6 deletions trunk/drivers/net/wireless/libertas/hostcmd.h
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ struct cmd_ds_802_11_associate {
} __attribute__ ((packed));

struct cmd_ds_802_11_associate_rsp {
struct ieeetypes_assocrsp assocRsp;
struct ieee_assoc_response response;
} __attribute__ ((packed));

struct cmd_ds_802_11_set_wep {
Expand Down Expand Up @@ -535,9 +535,11 @@ struct cmd_ds_802_11_ad_hoc_start {
u8 bsstype;
__le16 beaconperiod;
u8 dtimperiod; /* Reserved on v9 and later */
union IEEEtypes_ssparamset ssparamset;
union ieeetypes_phyparamset phyparamset;
__le16 probedelay;
struct ieee_ie_ibss_param_set ibss;
u8 reserved1[4];
struct ieee_ie_ds_param_set ds;
u8 reserved2[4];
__le16 probedelay; /* Reserved on v9 and later */
__le16 capability;
u8 rates[MAX_RATES];
u8 tlv_memory_size_pad[100];
Expand All @@ -558,8 +560,10 @@ struct adhoc_bssdesc {
u8 dtimperiod;
__le64 timestamp;
__le64 localtime;
union ieeetypes_phyparamset phyparamset;
union IEEEtypes_ssparamset ssparamset;
struct ieee_ie_ds_param_set ds;
u8 reserved1[4];
struct ieee_ie_ibss_param_set ibss;
u8 reserved2[4];
__le16 capability;
u8 rates[MAX_RATES];

Expand Down
32 changes: 14 additions & 18 deletions trunk/drivers/net/wireless/libertas/scan.c
Original file line number Diff line number Diff line change
Expand Up @@ -513,10 +513,10 @@ void lbs_scan_worker(struct work_struct *work)
static int lbs_process_bss(struct bss_descriptor *bss,
uint8_t **pbeaconinfo, int *bytesleft)
{
struct ieeetypes_fhparamset *pFH;
struct ieeetypes_dsparamset *pDS;
struct ieeetypes_cfparamset *pCF;
struct ieeetypes_ibssparamset *pibss;
struct ieee_ie_fh_param_set *fh;
struct ieee_ie_ds_param_set *ds;
struct ieee_ie_cf_param_set *cf;
struct ieee_ie_ibss_param_set *ibss;
DECLARE_SSID_BUF(ssid);
struct ieeetypes_countryinfoset *pcountryinfo;
uint8_t *pos, *end, *p;
Expand Down Expand Up @@ -616,32 +616,28 @@ static int lbs_process_bss(struct bss_descriptor *bss,
break;

case WLAN_EID_FH_PARAMS:
pFH = (struct ieeetypes_fhparamset *) pos;
memmove(&bss->phyparamset.fhparamset, pFH,
sizeof(struct ieeetypes_fhparamset));
fh = (struct ieee_ie_fh_param_set *) pos;
memcpy(&bss->phy.fh, fh, sizeof(*fh));
lbs_deb_scan("got FH IE\n");
break;

case WLAN_EID_DS_PARAMS:
pDS = (struct ieeetypes_dsparamset *) pos;
bss->channel = pDS->currentchan;
memcpy(&bss->phyparamset.dsparamset, pDS,
sizeof(struct ieeetypes_dsparamset));
ds = (struct ieee_ie_ds_param_set *) pos;
bss->channel = ds->channel;
memcpy(&bss->phy.ds, ds, sizeof(*ds));
lbs_deb_scan("got DS IE, channel %d\n", bss->channel);
break;

case WLAN_EID_CF_PARAMS:
pCF = (struct ieeetypes_cfparamset *) pos;
memcpy(&bss->ssparamset.cfparamset, pCF,
sizeof(struct ieeetypes_cfparamset));
cf = (struct ieee_ie_cf_param_set *) pos;
memcpy(&bss->ss.cf, cf, sizeof(*cf));
lbs_deb_scan("got CF IE\n");
break;

case WLAN_EID_IBSS_PARAMS:
pibss = (struct ieeetypes_ibssparamset *) pos;
bss->atimwindow = le16_to_cpu(pibss->atimwindow);
memmove(&bss->ssparamset.ibssparamset, pibss,
sizeof(struct ieeetypes_ibssparamset));
ibss = (struct ieee_ie_ibss_param_set *) pos;
bss->atimwindow = ibss->atimwindow;
memcpy(&bss->ss.ibss, ibss, sizeof(*ibss));
lbs_deb_scan("got IBSS IE\n");
break;

Expand Down
57 changes: 16 additions & 41 deletions trunk/drivers/net/wireless/libertas/types.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#include <asm/byteorder.h>
#include <linux/wireless.h>

struct ieeetypes_cfparamset {
struct ieee_ie_cf_param_set {
u8 elementid;
u8 len;
u8 cfpcnt;
Expand All @@ -18,18 +18,18 @@ struct ieeetypes_cfparamset {
} __attribute__ ((packed));


struct ieeetypes_ibssparamset {
struct ieee_ie_ibss_param_set {
u8 elementid;
u8 len;
__le16 atimwindow;
} __attribute__ ((packed));

union IEEEtypes_ssparamset {
struct ieeetypes_cfparamset cfparamset;
struct ieeetypes_ibssparamset ibssparamset;
union ieee_ss_param_set {
struct ieee_ie_cf_param_set cf;
struct ieee_ie_ibss_param_set ibss;
} __attribute__ ((packed));

struct ieeetypes_fhparamset {
struct ieee_ie_fh_param_set {
u8 elementid;
u8 len;
__le16 dwelltime;
Expand All @@ -38,18 +38,18 @@ struct ieeetypes_fhparamset {
u8 hopindex;
} __attribute__ ((packed));

struct ieeetypes_dsparamset {
struct ieee_ie_ds_param_set {
u8 elementid;
u8 len;
u8 currentchan;
u8 channel;
} __attribute__ ((packed));

union ieeetypes_phyparamset {
struct ieeetypes_fhparamset fhparamset;
struct ieeetypes_dsparamset dsparamset;
union ieee_phy_param_set {
struct ieee_ie_fh_param_set fh;
struct ieee_ie_ds_param_set ds;
} __attribute__ ((packed));

struct ieeetypes_assocrsp {
struct ieee_assoc_response {
__le16 capability;
__le16 statuscode;
__le16 aid;
Expand Down Expand Up @@ -149,42 +149,17 @@ struct mrvlietypes_chanlistparamset {
struct chanscanparamset chanscanparam[1];
} __attribute__ ((packed));

struct cfparamset {
struct mrvlietypes_cfparamset {
struct mrvlietypesheader header;
u8 cfpcnt;
u8 cfpperiod;
__le16 cfpmaxduration;
__le16 cfpdurationremaining;
} __attribute__ ((packed));

struct ibssparamset {
__le16 atimwindow;
} __attribute__ ((packed));

struct mrvlietypes_ssparamset {
struct mrvlietypesheader header;
union {
struct cfparamset cfparamset[1];
struct ibssparamset ibssparamset[1];
} cf_ibss;
} __attribute__ ((packed));

struct fhparamset {
__le16 dwelltime;
u8 hopset;
u8 hoppattern;
u8 hopindex;
} __attribute__ ((packed));

struct dsparamset {
u8 currentchan;
} __attribute__ ((packed));

struct mrvlietypes_phyparamset {
struct mrvlietypes_dsparamset {
struct mrvlietypesheader header;
union {
struct fhparamset fhparamset[1];
struct dsparamset dsparamset[1];
} fh_ds;
u8 channel;
} __attribute__ ((packed));

struct mrvlietypes_rsnparamset {
Expand Down

0 comments on commit 012d9c0

Please sign in to comment.