Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 121588
b: refs/heads/master
c: f828831
h: refs/heads/master
v: v3
  • Loading branch information
Herton Ronaldo Krzesinski authored and John W. Linville committed Oct 31, 2008
1 parent 96b3537 commit 71c40c5
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 13 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: 64761077f815660276f69b497edb9842d880df9a
refs/heads/master: f8288317b5076fde0bb4e91cd4754379c850be7a
45 changes: 41 additions & 4 deletions trunk/drivers/net/wireless/rtl8187_dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -911,9 +911,45 @@ static int rtl8187_config_interface(struct ieee80211_hw *dev,
return 0;
}

static void rtl8187_conf_erp(struct rtl8187_priv *priv, bool use_short_slot)
static void rtl8187_conf_erp(struct rtl8187_priv *priv, bool use_short_slot,
bool use_short_preamble)
{
if (!priv->is_rtl8187b) {
if (priv->is_rtl8187b) {
u8 difs, eifs, slot_time;
u16 ack_timeout;

if (use_short_slot) {
slot_time = 0x9;
difs = 0x1c;
eifs = 0x53;
} else {
slot_time = 0x14;
difs = 0x32;
eifs = 0x5b;
}
rtl818x_iowrite8(priv, &priv->map->SIFS, 0xa);
rtl818x_iowrite8(priv, &priv->map->SLOT, slot_time);
rtl818x_iowrite8(priv, &priv->map->DIFS, difs);

/*
* BRSR+1 on 8187B is in fact EIFS register
* Value in units of 4 us
*/
rtl818x_iowrite8(priv, (u8 *)&priv->map->BRSR + 1, eifs);

/*
* For 8187B, CARRIER_SENSE_COUNTER is in fact ack timeout
* register. In units of 4 us like eifs register
* ack_timeout = ack duration + plcp + difs + preamble
*/
ack_timeout = 112 + 48 + difs;
if (use_short_preamble)
ack_timeout += 72;
else
ack_timeout += 144;
rtl818x_iowrite8(priv, &priv->map->CARRIER_SENSE_COUNTER,
DIV_ROUND_UP(ack_timeout, 4));
} else {
rtl818x_iowrite8(priv, &priv->map->SIFS, 0x22);
if (use_short_slot) {
rtl818x_iowrite8(priv, &priv->map->SLOT, 0x9);
Expand All @@ -936,8 +972,9 @@ static void rtl8187_bss_info_changed(struct ieee80211_hw *dev,
{
struct rtl8187_priv *priv = dev->priv;

if (changed & BSS_CHANGED_ERP_SLOT)
rtl8187_conf_erp(priv, info->use_short_slot);
if (changed & (BSS_CHANGED_ERP_SLOT | BSS_CHANGED_ERP_PREAMBLE))
rtl8187_conf_erp(priv, info->use_short_slot,
info->use_short_preamble);
}

static void rtl8187_configure_filter(struct ieee80211_hw *dev,
Expand Down
8 changes: 0 additions & 8 deletions trunk/drivers/net/wireless/rtl8187_rtl8225.c
Original file line number Diff line number Diff line change
Expand Up @@ -885,14 +885,6 @@ static void rtl8225z2_b_rf_init(struct ieee80211_hw *dev)
for (i = 0; i < ARRAY_SIZE(rtl8225z2_ofdm); i++)
rtl8225_write_phy_ofdm(dev, i, rtl8225z2_ofdm[i]);

rtl818x_iowrite8(priv, &priv->map->SIFS, 0x22);
rtl818x_iowrite8(priv, &priv->map->SLOT, 9);
rtl818x_iowrite8(priv, (u8 *)0xFFF0, 28);
rtl818x_iowrite8(priv, (u8 *)0xFFF4, 28);
rtl818x_iowrite8(priv, (u8 *)0xFFF8, 28);
rtl818x_iowrite8(priv, (u8 *)0xFFFC, 28);
rtl818x_iowrite8(priv, (u8 *)0xFF2D, 0x5B);
rtl818x_iowrite8(priv, (u8 *)0xFF79, 0x5B);
rtl818x_iowrite32(priv, (__le32 *)0xFFF0, (7 << 12) | (3 << 8) | 28);
rtl818x_iowrite32(priv, (__le32 *)0xFFF4, (7 << 12) | (3 << 8) | 28);
rtl818x_iowrite32(priv, (__le32 *)0xFFF8, (7 << 12) | (3 << 8) | 28);
Expand Down

0 comments on commit 71c40c5

Please sign in to comment.