diff options
author | Christian Lamparter <chunkeey@googlemail.com> | 2011-02-24 08:12:20 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2011-02-25 15:32:33 -0500 |
commit | 3083e83c86e604ac7005c100b7d7242389407ba5 (patch) | |
tree | eda332de50da769ea0d4fddec5530a6c6edf0c21 /drivers/net | |
parent | 41cae2d01385af4199666db57274c0df3283b065 (diff) |
p54: implement set_coverage_class
The callback sets slot time as specified in IEEE 802.11-2007
section 17.3.8.6 and raises round trip delay accordingly.
Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/wireless/p54/fwio.c | 9 | ||||
-rw-r--r-- | drivers/net/wireless/p54/main.c | 12 | ||||
-rw-r--r-- | drivers/net/wireless/p54/p54.h | 1 |
3 files changed, 21 insertions, 1 deletions
diff --git a/drivers/net/wireless/p54/fwio.c b/drivers/net/wireless/p54/fwio.c index 0d3d108f6fe2..2fab7d20ffc2 100644 --- a/drivers/net/wireless/p54/fwio.c +++ b/drivers/net/wireless/p54/fwio.c | |||
@@ -559,6 +559,7 @@ int p54_set_edcf(struct p54_common *priv) | |||
559 | { | 559 | { |
560 | struct sk_buff *skb; | 560 | struct sk_buff *skb; |
561 | struct p54_edcf *edcf; | 561 | struct p54_edcf *edcf; |
562 | u8 rtd; | ||
562 | 563 | ||
563 | skb = p54_alloc_skb(priv, P54_HDR_FLAG_CONTROL_OPSET, sizeof(*edcf), | 564 | skb = p54_alloc_skb(priv, P54_HDR_FLAG_CONTROL_OPSET, sizeof(*edcf), |
564 | P54_CONTROL_TYPE_DCFINIT, GFP_ATOMIC); | 565 | P54_CONTROL_TYPE_DCFINIT, GFP_ATOMIC); |
@@ -575,9 +576,15 @@ int p54_set_edcf(struct p54_common *priv) | |||
575 | edcf->sifs = 0x0a; | 576 | edcf->sifs = 0x0a; |
576 | edcf->eofpad = 0x06; | 577 | edcf->eofpad = 0x06; |
577 | } | 578 | } |
579 | /* | ||
580 | * calculate the extra round trip delay according to the | ||
581 | * formula from 802.11-2007 17.3.8.6. | ||
582 | */ | ||
583 | rtd = 3 * priv->coverage_class; | ||
584 | edcf->slottime += rtd; | ||
585 | edcf->round_trip_delay = cpu_to_le16(rtd); | ||
578 | /* (see prism54/isl_oid.h for further details) */ | 586 | /* (see prism54/isl_oid.h for further details) */ |
579 | edcf->frameburst = cpu_to_le16(0); | 587 | edcf->frameburst = cpu_to_le16(0); |
580 | edcf->round_trip_delay = cpu_to_le16(0); | ||
581 | edcf->flags = 0; | 588 | edcf->flags = 0; |
582 | memset(edcf->mapping, 0, sizeof(edcf->mapping)); | 589 | memset(edcf->mapping, 0, sizeof(edcf->mapping)); |
583 | memcpy(edcf->queue, priv->qos_params, sizeof(edcf->queue)); | 590 | memcpy(edcf->queue, priv->qos_params, sizeof(edcf->queue)); |
diff --git a/drivers/net/wireless/p54/main.c b/drivers/net/wireless/p54/main.c index e14a05bbc485..d7a92af24dd5 100644 --- a/drivers/net/wireless/p54/main.c +++ b/drivers/net/wireless/p54/main.c | |||
@@ -566,6 +566,17 @@ static void p54_flush(struct ieee80211_hw *dev, bool drop) | |||
566 | WARN(total, "tx flush timeout, unresponsive firmware"); | 566 | WARN(total, "tx flush timeout, unresponsive firmware"); |
567 | } | 567 | } |
568 | 568 | ||
569 | static void p54_set_coverage_class(struct ieee80211_hw *dev, u8 coverage_class) | ||
570 | { | ||
571 | struct p54_common *priv = dev->priv; | ||
572 | |||
573 | mutex_lock(&priv->conf_mutex); | ||
574 | /* support all coverage class values as in 802.11-2007 Table 7-27 */ | ||
575 | priv->coverage_class = clamp_t(u8, coverage_class, 0, 31); | ||
576 | p54_set_edcf(priv); | ||
577 | mutex_unlock(&priv->conf_mutex); | ||
578 | } | ||
579 | |||
569 | static const struct ieee80211_ops p54_ops = { | 580 | static const struct ieee80211_ops p54_ops = { |
570 | .tx = p54_tx_80211, | 581 | .tx = p54_tx_80211, |
571 | .start = p54_start, | 582 | .start = p54_start, |
@@ -584,6 +595,7 @@ static const struct ieee80211_ops p54_ops = { | |||
584 | .conf_tx = p54_conf_tx, | 595 | .conf_tx = p54_conf_tx, |
585 | .get_stats = p54_get_stats, | 596 | .get_stats = p54_get_stats, |
586 | .get_survey = p54_get_survey, | 597 | .get_survey = p54_get_survey, |
598 | .set_coverage_class = p54_set_coverage_class, | ||
587 | }; | 599 | }; |
588 | 600 | ||
589 | struct ieee80211_hw *p54_init_common(size_t priv_data_len) | 601 | struct ieee80211_hw *p54_init_common(size_t priv_data_len) |
diff --git a/drivers/net/wireless/p54/p54.h b/drivers/net/wireless/p54/p54.h index f951c8f31863..50730fc23fe5 100644 --- a/drivers/net/wireless/p54/p54.h +++ b/drivers/net/wireless/p54/p54.h | |||
@@ -217,6 +217,7 @@ struct p54_common { | |||
217 | u32 tsf_low32, tsf_high32; | 217 | u32 tsf_low32, tsf_high32; |
218 | u32 basic_rate_mask; | 218 | u32 basic_rate_mask; |
219 | u16 aid; | 219 | u16 aid; |
220 | u8 coverage_class; | ||
220 | bool powersave_override; | 221 | bool powersave_override; |
221 | __le32 beacon_req_id; | 222 | __le32 beacon_req_id; |
222 | struct completion beacon_comp; | 223 | struct completion beacon_comp; |