Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 255868
b: refs/heads/master
c: dde4673
h: refs/heads/master
v: v3
  • Loading branch information
Jussi Kivilinna authored and John W. Linville committed Jun 22, 2011
1 parent 7c4cc60 commit 912b37f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 8 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: c900eff30a14ecf209ee7a17a7c3c54890694ce6
refs/heads/master: dde4673b8d73dd873e1a62774728e4b7f972facd
19 changes: 12 additions & 7 deletions trunk/drivers/net/wireless/zd1211rw/zd_mac.c
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ static void beacon_enable(struct zd_mac *mac);
static void beacon_disable(struct zd_mac *mac);
static void set_rts_cts(struct zd_mac *mac, unsigned int short_preamble);
static int zd_mac_config_beacon(struct ieee80211_hw *hw,
struct sk_buff *beacon);
struct sk_buff *beacon, bool in_intr);

static int zd_reg2alpha2(u8 regdomain, char *alpha2)
{
Expand Down Expand Up @@ -404,7 +404,7 @@ int zd_restore_settings(struct zd_mac *mac)
if (mac->vif != NULL) {
beacon = ieee80211_beacon_get(mac->hw, mac->vif);
if (beacon)
zd_mac_config_beacon(mac->hw, beacon);
zd_mac_config_beacon(mac->hw, beacon, false);
}

zd_set_beacon_interval(&mac->chip, beacon_interval,
Expand Down Expand Up @@ -704,7 +704,8 @@ static void zd_mac_free_cur_beacon(struct zd_mac *mac)
mutex_unlock(&mac->chip.mutex);
}

static int zd_mac_config_beacon(struct ieee80211_hw *hw, struct sk_buff *beacon)
static int zd_mac_config_beacon(struct ieee80211_hw *hw, struct sk_buff *beacon,
bool in_intr)
{
struct zd_mac *mac = zd_hw_mac(hw);
int r, ret, num_cmds, req_pos = 0;
Expand Down Expand Up @@ -736,6 +737,10 @@ static int zd_mac_config_beacon(struct ieee80211_hw *hw, struct sk_buff *beacon)
r = zd_ioread32_locked(&mac->chip, &tmp, CR_BCN_FIFO_SEMAPHORE);
if (r < 0)
goto release_sema;
if (in_intr && tmp & 0x2) {
r = -EBUSY;
goto release_sema;
}

end_jiffies = jiffies + HZ / 2; /*~500ms*/
message_jiffies = jiffies + HZ / 10; /*~100ms*/
Expand Down Expand Up @@ -790,7 +795,7 @@ static int zd_mac_config_beacon(struct ieee80211_hw *hw, struct sk_buff *beacon)
end_jiffies = jiffies + HZ / 2; /*~500ms*/
ret = zd_iowrite32_locked(&mac->chip, 1, CR_BCN_FIFO_SEMAPHORE);
while (ret < 0) {
if (time_is_before_eq_jiffies(end_jiffies)) {
if (in_intr || time_is_before_eq_jiffies(end_jiffies)) {
ret = -ETIMEDOUT;
break;
}
Expand Down Expand Up @@ -1161,7 +1166,7 @@ static void zd_beacon_done(struct zd_mac *mac)
*/
beacon = ieee80211_beacon_get(mac->hw, mac->vif);
if (beacon)
zd_mac_config_beacon(mac->hw, beacon);
zd_mac_config_beacon(mac->hw, beacon, true);

spin_lock_irq(&mac->lock);
mac->beacon.last_update = jiffies;
Expand Down Expand Up @@ -1286,7 +1291,7 @@ static void zd_op_bss_info_changed(struct ieee80211_hw *hw,

if (beacon) {
zd_chip_disable_hwint(&mac->chip);
zd_mac_config_beacon(hw, beacon);
zd_mac_config_beacon(hw, beacon, false);
zd_chip_enable_hwint(&mac->chip);
}
}
Expand Down Expand Up @@ -1439,7 +1444,7 @@ static void beacon_watchdog_handler(struct work_struct *work)
if (beacon) {
zd_mac_free_cur_beacon(mac);

zd_mac_config_beacon(mac->hw, beacon);
zd_mac_config_beacon(mac->hw, beacon, false);
}

zd_set_beacon_interval(&mac->chip, interval, period, mac->type);
Expand Down

0 comments on commit 912b37f

Please sign in to comment.