Skip to content

Commit

Permalink
Merge branch 'upstream-jgarzik' of git://git.kernel.org/pub/scm/linux…
Browse files Browse the repository at this point in the history
…/kernel/git/linville/wireless-2.6 into upstream
  • Loading branch information
Jeff Garzik committed Jul 16, 2007
2 parents 8910b49 + 4cf92a3 commit 5be8084
Show file tree
Hide file tree
Showing 22 changed files with 280 additions and 269 deletions.
208 changes: 105 additions & 103 deletions drivers/net/wireless/airo.c

Large diffs are not rendered by default.

11 changes: 7 additions & 4 deletions drivers/net/wireless/ipw2100.c
Original file line number Diff line number Diff line change
Expand Up @@ -1768,7 +1768,8 @@ static int ipw2100_up(struct ipw2100_priv *priv, int deferred)

if (priv->stop_rf_kill) {
priv->stop_rf_kill = 0;
queue_delayed_work(priv->workqueue, &priv->rf_kill, HZ);
queue_delayed_work(priv->workqueue, &priv->rf_kill,
round_jiffies(HZ));
}

deferred = 1;
Expand Down Expand Up @@ -2098,7 +2099,7 @@ static void isr_indicate_rf_kill(struct ipw2100_priv *priv, u32 status)
/* Make sure the RF Kill check timer is running */
priv->stop_rf_kill = 0;
cancel_delayed_work(&priv->rf_kill);
queue_delayed_work(priv->workqueue, &priv->rf_kill, HZ);
queue_delayed_work(priv->workqueue, &priv->rf_kill, round_jiffies(HZ));
}

static void isr_scan_complete(struct ipw2100_priv *priv, u32 status)
Expand Down Expand Up @@ -4233,7 +4234,8 @@ static int ipw_radio_kill_sw(struct ipw2100_priv *priv, int disable_radio)
/* Make sure the RF_KILL check timer is running */
priv->stop_rf_kill = 0;
cancel_delayed_work(&priv->rf_kill);
queue_delayed_work(priv->workqueue, &priv->rf_kill, HZ);
queue_delayed_work(priv->workqueue, &priv->rf_kill,
round_jiffies(HZ));
} else
schedule_reset(priv);
}
Expand Down Expand Up @@ -5969,7 +5971,8 @@ static void ipw2100_rf_kill(struct work_struct *work)
if (rf_kill_active(priv)) {
IPW_DEBUG_RF_KILL("RF Kill active, rescheduling GPIO check\n");
if (!priv->stop_rf_kill)
queue_delayed_work(priv->workqueue, &priv->rf_kill, HZ);
queue_delayed_work(priv->workqueue, &priv->rf_kill,
round_jiffies(HZ));
goto exit_unlock;
}

Expand Down
5 changes: 3 additions & 2 deletions drivers/net/wireless/ipw2200.c
Original file line number Diff line number Diff line change
Expand Up @@ -1751,7 +1751,7 @@ static int ipw_radio_kill_sw(struct ipw_priv *priv, int disable_radio)
/* Make sure the RF_KILL check timer is running */
cancel_delayed_work(&priv->rf_kill);
queue_delayed_work(priv->workqueue, &priv->rf_kill,
2 * HZ);
round_jiffies(2 * HZ));
} else
queue_work(priv->workqueue, &priv->up);
}
Expand Down Expand Up @@ -4690,7 +4690,8 @@ static void ipw_rx_notification(struct ipw_priv *priv,
else if (priv->config & CFG_BACKGROUND_SCAN
&& priv->status & STATUS_ASSOCIATED)
queue_delayed_work(priv->workqueue,
&priv->request_scan, HZ);
&priv->request_scan,
round_jiffies(HZ));

/* Send an empty event to user space.
* We don't send the received data on the event because
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/wireless/libertas/cmd.c
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ static int wlan_cmd_802_11_enable_rsn(wlan_private * priv,
if (*enable)
penableRSN->enable = cpu_to_le16(cmd_enable_rsn);
else
penableRSN->enable = cpu_to_le16(cmd_enable_rsn);
penableRSN->enable = cpu_to_le16(cmd_disable_rsn);
}

lbs_deb_leave(LBS_DEB_CMD);
Expand Down
1 change: 0 additions & 1 deletion drivers/net/wireless/libertas/rx.c
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,6 @@ static int process_rxed_802_11_packet(wlan_private * priv, struct sk_buff *skb)
ret = 0;

done:
skb->protocol = __constant_htons(0x0019); /* ETH_P_80211_RAW */
lbs_deb_leave_args(LBS_DEB_RX, "ret %d", ret);
return ret;
}
1 change: 0 additions & 1 deletion drivers/net/wireless/libertas/version.h

This file was deleted.

3 changes: 0 additions & 3 deletions drivers/net/wireless/libertas/wext.c
Original file line number Diff line number Diff line change
Expand Up @@ -1719,9 +1719,6 @@ static int wlan_set_encodeext(struct net_device *dev,
pkey->type = KEY_TYPE_ID_TKIP;
} else if (alg == IW_ENCODE_ALG_CCMP) {
pkey->type = KEY_TYPE_ID_AES;
} else {
ret = -EINVAL;
goto out;
}

/* If WPA isn't enabled yet, do that now */
Expand Down
22 changes: 6 additions & 16 deletions drivers/net/wireless/prism54/isl_ioctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -1853,19 +1853,16 @@ prism54_del_mac(struct net_device *ndev, struct iw_request_info *info,
islpci_private *priv = netdev_priv(ndev);
struct islpci_acl *acl = &priv->acl;
struct mac_entry *entry;
struct list_head *ptr;
struct sockaddr *addr = (struct sockaddr *) extra;

if (addr->sa_family != ARPHRD_ETHER)
return -EOPNOTSUPP;

if (down_interruptible(&acl->sem))
return -ERESTARTSYS;
for (ptr = acl->mac_list.next; ptr != &acl->mac_list; ptr = ptr->next) {
entry = list_entry(ptr, struct mac_entry, _list);

list_for_each_entry(entry, &acl->mac_list, _list) {
if (memcmp(entry->addr, addr->sa_data, ETH_ALEN) == 0) {
list_del(ptr);
list_del(&entry->_list);
acl->size--;
kfree(entry);
up(&acl->sem);
Expand All @@ -1883,17 +1880,14 @@ prism54_get_mac(struct net_device *ndev, struct iw_request_info *info,
islpci_private *priv = netdev_priv(ndev);
struct islpci_acl *acl = &priv->acl;
struct mac_entry *entry;
struct list_head *ptr;
struct sockaddr *dst = (struct sockaddr *) extra;

dwrq->length = 0;

if (down_interruptible(&acl->sem))
return -ERESTARTSYS;

for (ptr = acl->mac_list.next; ptr != &acl->mac_list; ptr = ptr->next) {
entry = list_entry(ptr, struct mac_entry, _list);

list_for_each_entry(entry, &acl->mac_list, _list) {
memcpy(dst->sa_data, entry->addr, ETH_ALEN);
dst->sa_family = ARPHRD_ETHER;
dwrq->length++;
Expand Down Expand Up @@ -1960,7 +1954,6 @@ prism54_get_policy(struct net_device *ndev, struct iw_request_info *info,
static int
prism54_mac_accept(struct islpci_acl *acl, char *mac)
{
struct list_head *ptr;
struct mac_entry *entry;
int res = 0;

Expand All @@ -1972,8 +1965,7 @@ prism54_mac_accept(struct islpci_acl *acl, char *mac)
return 1;
}

for (ptr = acl->mac_list.next; ptr != &acl->mac_list; ptr = ptr->next) {
entry = list_entry(ptr, struct mac_entry, _list);
list_for_each_entry(entry, &acl->mac_list, _list) {
if (memcmp(entry->addr, mac, ETH_ALEN) == 0) {
res = 1;
break;
Expand Down Expand Up @@ -2216,11 +2208,9 @@ prism54_wpa_bss_ie_init(islpci_private *priv)
void
prism54_wpa_bss_ie_clean(islpci_private *priv)
{
struct list_head *ptr, *n;
struct islpci_bss_wpa_ie *bss, *n;

list_for_each_safe(ptr, n, &priv->bss_wpa_list) {
struct islpci_bss_wpa_ie *bss;
bss = list_entry(ptr, struct islpci_bss_wpa_ie, list);
list_for_each_entry_safe(bss, n, &priv->bss_wpa_list, list) {
kfree(bss);
}
}
Expand Down
4 changes: 2 additions & 2 deletions drivers/net/wireless/rtl8187_rtl8225.c
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ static void rtl8225_write_bitbang(struct ieee80211_hw *dev, u8 addr, u16 data)
msleep(2);
}

static void rtl8225_write_8051(struct ieee80211_hw *dev, u8 addr, u16 data)
static void rtl8225_write_8051(struct ieee80211_hw *dev, u8 addr, __le16 data)
{
struct rtl8187_priv *priv = dev->priv;
u16 reg80, reg82, reg84;
Expand Down Expand Up @@ -106,7 +106,7 @@ void rtl8225_write(struct ieee80211_hw *dev, u8 addr, u16 data)
struct rtl8187_priv *priv = dev->priv;

if (priv->asic_rev)
rtl8225_write_8051(dev, addr, data);
rtl8225_write_8051(dev, addr, cpu_to_le16(data));
else
rtl8225_write_bitbang(dev, addr, data);
}
Expand Down
88 changes: 15 additions & 73 deletions drivers/net/wireless/zd1211rw/zd_chip.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,9 @@ void zd_chip_clear(struct zd_chip *chip)
ZD_MEMCLEAR(chip, sizeof(*chip));
}

static int scnprint_mac_oui(const u8 *addr, char *buffer, size_t size)
static int scnprint_mac_oui(struct zd_chip *chip, char *buffer, size_t size)
{
u8 *addr = zd_usb_to_netdev(&chip->usb)->dev_addr;
return scnprintf(buffer, size, "%02x-%02x-%02x",
addr[0], addr[1], addr[2]);
}
Expand All @@ -61,10 +62,10 @@ static int scnprint_id(struct zd_chip *chip, char *buffer, size_t size)
int i = 0;

i = scnprintf(buffer, size, "zd1211%s chip ",
chip->is_zd1211b ? "b" : "");
zd_chip_is_zd1211b(chip) ? "b" : "");
i += zd_usb_scnprint_id(&chip->usb, buffer+i, size-i);
i += scnprintf(buffer+i, size-i, " ");
i += scnprint_mac_oui(chip->e2p_mac, buffer+i, size-i);
i += scnprint_mac_oui(chip, buffer+i, size-i);
i += scnprintf(buffer+i, size-i, " ");
i += zd_rf_scnprint_id(&chip->rf, buffer+i, size-i);
i += scnprintf(buffer+i, size-i, " pa%1x %c%c%c%c%c", chip->pa_type,
Expand Down Expand Up @@ -366,64 +367,9 @@ static int read_pod(struct zd_chip *chip, u8 *rf_type)
return r;
}

static int _read_mac_addr(struct zd_chip *chip, u8 *mac_addr,
const zd_addr_t *addr)
{
int r;
u32 parts[2];

r = zd_ioread32v_locked(chip, parts, (const zd_addr_t *)addr, 2);
if (r) {
dev_dbg_f(zd_chip_dev(chip),
"error: couldn't read e2p macs. Error number %d\n", r);
return r;
}

mac_addr[0] = parts[0];
mac_addr[1] = parts[0] >> 8;
mac_addr[2] = parts[0] >> 16;
mac_addr[3] = parts[0] >> 24;
mac_addr[4] = parts[1];
mac_addr[5] = parts[1] >> 8;

return 0;
}

static int read_e2p_mac_addr(struct zd_chip *chip)
{
static const zd_addr_t addr[2] = { E2P_MAC_ADDR_P1, E2P_MAC_ADDR_P2 };

ZD_ASSERT(mutex_is_locked(&chip->mutex));
return _read_mac_addr(chip, chip->e2p_mac, (const zd_addr_t *)addr);
}

/* MAC address: if custom mac addresses are to to be used CR_MAC_ADDR_P1 and
* CR_MAC_ADDR_P2 must be overwritten
*/
void zd_get_e2p_mac_addr(struct zd_chip *chip, u8 *mac_addr)
{
mutex_lock(&chip->mutex);
memcpy(mac_addr, chip->e2p_mac, ETH_ALEN);
mutex_unlock(&chip->mutex);
}

static int read_mac_addr(struct zd_chip *chip, u8 *mac_addr)
{
static const zd_addr_t addr[2] = { CR_MAC_ADDR_P1, CR_MAC_ADDR_P2 };
return _read_mac_addr(chip, mac_addr, (const zd_addr_t *)addr);
}

int zd_read_mac_addr(struct zd_chip *chip, u8 *mac_addr)
{
int r;

dev_dbg_f(zd_chip_dev(chip), "\n");
mutex_lock(&chip->mutex);
r = read_mac_addr(chip, mac_addr);
mutex_unlock(&chip->mutex);
return r;
}

int zd_write_mac_addr(struct zd_chip *chip, const u8 *mac_addr)
{
int r;
Expand All @@ -444,12 +390,6 @@ int zd_write_mac_addr(struct zd_chip *chip, const u8 *mac_addr)

mutex_lock(&chip->mutex);
r = zd_iowrite32a_locked(chip, reqs, ARRAY_SIZE(reqs));
#ifdef DEBUG
{
u8 tmp[ETH_ALEN];
read_mac_addr(chip, tmp);
}
#endif /* DEBUG */
mutex_unlock(&chip->mutex);
return r;
}
Expand Down Expand Up @@ -809,7 +749,7 @@ static int zd1211b_hw_reset_phy(struct zd_chip *chip)

static int hw_reset_phy(struct zd_chip *chip)
{
return chip->is_zd1211b ? zd1211b_hw_reset_phy(chip) :
return zd_chip_is_zd1211b(chip) ? zd1211b_hw_reset_phy(chip) :
zd1211_hw_reset_phy(chip);
}

Expand Down Expand Up @@ -874,7 +814,7 @@ static int hw_init_hmac(struct zd_chip *chip)
if (r)
return r;

return chip->is_zd1211b ?
return zd_chip_is_zd1211b(chip) ?
zd1211b_hw_init_hmac(chip) : zd1211_hw_init_hmac(chip);
}

Expand Down Expand Up @@ -1136,16 +1076,22 @@ static int read_fw_regs_offset(struct zd_chip *chip)
return 0;
}

/* Read mac address using pre-firmware interface */
int zd_chip_read_mac_addr_fw(struct zd_chip *chip, u8 *addr)
{
dev_dbg_f(zd_chip_dev(chip), "\n");
return zd_usb_read_fw(&chip->usb, E2P_MAC_ADDR_P1, addr,
ETH_ALEN);
}

int zd_chip_init_hw(struct zd_chip *chip, u8 device_type)
int zd_chip_init_hw(struct zd_chip *chip)
{
int r;
u8 rf_type;

dev_dbg_f(zd_chip_dev(chip), "\n");

mutex_lock(&chip->mutex);
chip->is_zd1211b = (device_type == DEVICE_ZD1211B) != 0;

#ifdef DEBUG
r = test_init(chip);
Expand Down Expand Up @@ -1201,10 +1147,6 @@ int zd_chip_init_hw(struct zd_chip *chip, u8 device_type)
goto out;
#endif /* DEBUG */

r = read_e2p_mac_addr(chip);
if (r)
goto out;

r = read_cal_int_tables(chip);
if (r)
goto out;
Expand Down Expand Up @@ -1259,7 +1201,7 @@ static int update_channel_integration_and_calibration(struct zd_chip *chip,
r = update_pwr_int(chip, channel);
if (r)
return r;
if (chip->is_zd1211b) {
if (zd_chip_is_zd1211b(chip)) {
static const struct zd_ioreq16 ioreqs[] = {
{ CR69, 0x28 },
{},
Expand Down
13 changes: 8 additions & 5 deletions drivers/net/wireless/zd1211rw/zd_chip.h
Original file line number Diff line number Diff line change
Expand Up @@ -704,7 +704,6 @@ struct zd_chip {
struct mutex mutex;
/* Base address of FW_REG_ registers */
zd_addr_t fw_regs_base;
u8 e2p_mac[ETH_ALEN];
/* EepSetPoint in the vendor driver */
u8 pwr_cal_values[E2P_CHANNEL_COUNT];
/* integration values in the vendor driver */
Expand All @@ -715,7 +714,7 @@ struct zd_chip {
unsigned int pa_type:4,
patch_cck_gain:1, patch_cr157:1, patch_6m_band_edge:1,
new_phy_layout:1, al2230s_bit:1,
is_zd1211b:1, supports_tx_led:1;
supports_tx_led:1;
};

static inline struct zd_chip *zd_usb_to_chip(struct zd_usb *usb)
Expand All @@ -734,9 +733,15 @@ void zd_chip_init(struct zd_chip *chip,
struct net_device *netdev,
struct usb_interface *intf);
void zd_chip_clear(struct zd_chip *chip);
int zd_chip_init_hw(struct zd_chip *chip, u8 device_type);
int zd_chip_read_mac_addr_fw(struct zd_chip *chip, u8 *addr);
int zd_chip_init_hw(struct zd_chip *chip);
int zd_chip_reset(struct zd_chip *chip);

static inline int zd_chip_is_zd1211b(struct zd_chip *chip)
{
return chip->usb.is_zd1211b;
}

static inline int zd_ioread16v_locked(struct zd_chip *chip, u16 *values,
const zd_addr_t *addresses,
unsigned int count)
Expand Down Expand Up @@ -825,8 +830,6 @@ static inline u8 _zd_chip_get_channel(struct zd_chip *chip)
}
u8 zd_chip_get_channel(struct zd_chip *chip);
int zd_read_regdomain(struct zd_chip *chip, u8 *regdomain);
void zd_get_e2p_mac_addr(struct zd_chip *chip, u8 *mac_addr);
int zd_read_mac_addr(struct zd_chip *chip, u8 *mac_addr);
int zd_write_mac_addr(struct zd_chip *chip, const u8 *mac_addr);
int zd_chip_switch_radio_on(struct zd_chip *chip);
int zd_chip_switch_radio_off(struct zd_chip *chip);
Expand Down
Loading

0 comments on commit 5be8084

Please sign in to comment.