Skip to content

Commit

Permalink
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/gi…
Browse files Browse the repository at this point in the history
…t/linville/wireless-next-2.6
  • Loading branch information
David S. Miller committed Feb 4, 2010
2 parents 90c3033 + 5ffaf8a commit 10be7eb
Show file tree
Hide file tree
Showing 125 changed files with 3,770 additions and 2,018 deletions.
1 change: 0 additions & 1 deletion arch/powerpc/configs/ppc64_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -1000,7 +1000,6 @@ CONFIG_TIGON3=y
CONFIG_SPIDER_NET=m
CONFIG_GELIC_NET=m
CONFIG_GELIC_WIRELESS=y
# CONFIG_GELIC_WIRELESS_OLD_PSK_INTERFACE is not set
# CONFIG_QLA3XXX is not set
# CONFIG_ATL1 is not set
# CONFIG_ATL1E is not set
Expand Down
1 change: 0 additions & 1 deletion arch/powerpc/configs/ps3_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -593,7 +593,6 @@ CONFIG_MII=m
CONFIG_NETDEV_1000=y
CONFIG_GELIC_NET=y
CONFIG_GELIC_WIRELESS=y
# CONFIG_GELIC_WIRELESS_OLD_PSK_INTERFACE is not set
# CONFIG_NETDEV_10000 is not set

#
Expand Down
14 changes: 0 additions & 14 deletions drivers/net/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -2368,20 +2368,6 @@ config GELIC_WIRELESS
the driver automatically distinguishes the models, you can
safely enable this option even if you have a wireless-less model.

config GELIC_WIRELESS_OLD_PSK_INTERFACE
bool "PS3 Wireless private PSK interface (OBSOLETE)"
depends on GELIC_WIRELESS
select WEXT_PRIV
help
This option retains the obsolete private interface to pass
the PSK from user space programs to the driver. The PSK
stands for 'Pre Shared Key' and is used for WPA[2]-PSK
(WPA-Personal) environment.
If WPA[2]-PSK is used and you need to use old programs that
support only this old interface, say Y. Otherwise N.

If unsure, say N.

config FSL_PQ_MDIO
tristate "Freescale PQ MDIO"
depends on FSL_SOC
Expand Down
149 changes: 7 additions & 142 deletions drivers/net/ps3_gelic_wireless.c
Original file line number Diff line number Diff line change
Expand Up @@ -1389,113 +1389,6 @@ static int gelic_wl_get_mode(struct net_device *netdev,
return 0;
}

#ifdef CONFIG_GELIC_WIRELESS_OLD_PSK_INTERFACE
/* SIOCIWFIRSTPRIV */
static int hex2bin(u8 *str, u8 *bin, unsigned int len)
{
unsigned int i;
static unsigned char *hex = "0123456789ABCDEF";
unsigned char *p, *q;
u8 tmp;

if (len != WPA_PSK_LEN * 2)
return -EINVAL;

for (i = 0; i < WPA_PSK_LEN * 2; i += 2) {
p = strchr(hex, toupper(str[i]));
q = strchr(hex, toupper(str[i + 1]));
if (!p || !q) {
pr_info("%s: unconvertible PSK digit=%d\n",
__func__, i);
return -EINVAL;
}
tmp = ((p - hex) << 4) + (q - hex);
*bin++ = tmp;
}
return 0;
};

static int gelic_wl_priv_set_psk(struct net_device *net_dev,
struct iw_request_info *info,
union iwreq_data *data, char *extra)
{
struct gelic_wl_info *wl = port_wl(netdev_priv(net_dev));
unsigned int len;
unsigned long irqflag;
int ret = 0;

pr_debug("%s:<- len=%d\n", __func__, data->data.length);
len = data->data.length - 1;
if (len <= 2)
return -EINVAL;

spin_lock_irqsave(&wl->lock, irqflag);
if (extra[0] == '"' && extra[len - 1] == '"') {
pr_debug("%s: passphrase mode\n", __func__);
/* pass phrase */
if (GELIC_WL_EURUS_PSK_MAX_LEN < (len - 2)) {
pr_info("%s: passphrase too long\n", __func__);
ret = -E2BIG;
goto out;
}
memset(wl->psk, 0, sizeof(wl->psk));
wl->psk_len = len - 2;
memcpy(wl->psk, &(extra[1]), wl->psk_len);
wl->psk_type = GELIC_EURUS_WPA_PSK_PASSPHRASE;
} else {
ret = hex2bin(extra, wl->psk, len);
if (ret)
goto out;
wl->psk_len = WPA_PSK_LEN;
wl->psk_type = GELIC_EURUS_WPA_PSK_BIN;
}
set_bit(GELIC_WL_STAT_WPA_PSK_SET, &wl->stat);
out:
spin_unlock_irqrestore(&wl->lock, irqflag);
pr_debug("%s:->\n", __func__);
return ret;
}

static int gelic_wl_priv_get_psk(struct net_device *net_dev,
struct iw_request_info *info,
union iwreq_data *data, char *extra)
{
struct gelic_wl_info *wl = port_wl(netdev_priv(net_dev));
char *p;
unsigned long irqflag;
unsigned int i;

pr_debug("%s:<-\n", __func__);
if (!capable(CAP_NET_ADMIN))
return -EPERM;

spin_lock_irqsave(&wl->lock, irqflag);
p = extra;
if (test_bit(GELIC_WL_STAT_WPA_PSK_SET, &wl->stat)) {
if (wl->psk_type == GELIC_EURUS_WPA_PSK_BIN) {
for (i = 0; i < wl->psk_len; i++) {
sprintf(p, "%02xu", wl->psk[i]);
p += 2;
}
*p = '\0';
data->data.length = wl->psk_len * 2;
} else {
*p++ = '"';
memcpy(p, wl->psk, wl->psk_len);
p += wl->psk_len;
*p++ = '"';
*p = '\0';
data->data.length = wl->psk_len + 2;
}
} else
/* no psk set */
data->data.length = 0;
spin_unlock_irqrestore(&wl->lock, irqflag);
pr_debug("%s:-> %d\n", __func__, data->data.length);
return 0;
}
#endif

/* SIOCGIWNICKN */
static int gelic_wl_get_nick(struct net_device *net_dev,
struct iw_request_info *info,
Expand Down Expand Up @@ -1571,8 +1464,10 @@ static int gelic_wl_start_scan(struct gelic_wl_info *wl, int always_scan,
init_completion(&wl->scan_done);
/*
* If we have already a bss list, don't try to get new
* unless we are doing an ESSID scan
*/
if (!always_scan && wl->scan_stat == GELIC_WL_SCAN_STAT_GOT_LIST) {
if ((!essid_len && !always_scan)
&& wl->scan_stat == GELIC_WL_SCAN_STAT_GOT_LIST) {
pr_debug("%s: already has the list\n", __func__);
complete(&wl->scan_done);
goto out;
Expand Down Expand Up @@ -1673,7 +1568,7 @@ static void gelic_wl_scan_complete_event(struct gelic_wl_info *wl)
}
}

/* put them in the newtork_list */
/* put them in the network_list */
for (i = 0, scan_info_size = 0, scan_info = buf;
scan_info_size < data_len;
i++, scan_info_size += be16_to_cpu(scan_info->size),
Expand Down Expand Up @@ -2009,7 +1904,7 @@ static int gelic_wl_do_wpa_setup(struct gelic_wl_info *wl)
/* PSK type */
wpa->psk_type = cpu_to_be16(wl->psk_type);
#ifdef DEBUG
pr_debug("%s: sec=%s psktype=%s\nn", __func__,
pr_debug("%s: sec=%s psktype=%s\n", __func__,
wpasecstr(wpa->security),
(wpa->psk_type == GELIC_EURUS_WPA_PSK_BIN) ?
"BIN" : "passphrase");
Expand All @@ -2019,9 +1914,9 @@ static int gelic_wl_do_wpa_setup(struct gelic_wl_info *wl)
* the debug log because this dumps your precious
* passphrase/key.
*/
pr_debug("%s: psk=%s\n",
pr_debug("%s: psk=%s\n", __func__,
(wpa->psk_type == GELIC_EURUS_WPA_PSK_BIN) ?
(char *)"N/A" : (char *)wpa->psk);
"N/A" : wpa->psk);
#endif
#endif
/* issue wpa setup */
Expand Down Expand Up @@ -2406,40 +2301,10 @@ static const iw_handler gelic_wl_wext_handler[] =
IW_IOCTL(SIOCGIWNICKN) = gelic_wl_get_nick,
};

#ifdef CONFIG_GELIC_WIRELESS_OLD_PSK_INTERFACE
static struct iw_priv_args gelic_wl_private_args[] =
{
{
.cmd = GELIC_WL_PRIV_SET_PSK,
.set_args = IW_PRIV_TYPE_CHAR |
(GELIC_WL_EURUS_PSK_MAX_LEN + 2),
.name = "set_psk"
},
{
.cmd = GELIC_WL_PRIV_GET_PSK,
.get_args = IW_PRIV_TYPE_CHAR |
(GELIC_WL_EURUS_PSK_MAX_LEN + 2),
.name = "get_psk"
}
};

static const iw_handler gelic_wl_private_handler[] =
{
gelic_wl_priv_set_psk,
gelic_wl_priv_get_psk,
};
#endif

static const struct iw_handler_def gelic_wl_wext_handler_def = {
.num_standard = ARRAY_SIZE(gelic_wl_wext_handler),
.standard = gelic_wl_wext_handler,
.get_wireless_stats = gelic_wl_get_wireless_stats,
#ifdef CONFIG_GELIC_WIRELESS_OLD_PSK_INTERFACE
.num_private = ARRAY_SIZE(gelic_wl_private_handler),
.num_private_args = ARRAY_SIZE(gelic_wl_private_args),
.private = gelic_wl_private_handler,
.private_args = gelic_wl_private_args,
#endif
};

static struct net_device * __devinit gelic_wl_alloc(struct gelic_card *card)
Expand Down
34 changes: 18 additions & 16 deletions drivers/net/wireless/airo.c
Original file line number Diff line number Diff line change
Expand Up @@ -5254,11 +5254,7 @@ static int set_wep_key(struct airo_info *ai, u16 index, const char *key,
WepKeyRid wkr;
int rc;

if (keylen == 0) {
airo_print_err(ai->dev->name, "%s: key length to set was zero",
__func__);
return -1;
}
WARN_ON(keylen == 0);

memset(&wkr, 0, sizeof(wkr));
wkr.len = cpu_to_le16(sizeof(wkr));
Expand Down Expand Up @@ -6405,11 +6401,7 @@ static int airo_set_encode(struct net_device *dev,
if (dwrq->length > MIN_KEY_SIZE)
key.len = MAX_KEY_SIZE;
else
if (dwrq->length > 0)
key.len = MIN_KEY_SIZE;
else
/* Disable the key */
key.len = 0;
key.len = MIN_KEY_SIZE;
/* Check if the key is not marked as invalid */
if(!(dwrq->flags & IW_ENCODE_NOKEY)) {
/* Cleanup */
Expand Down Expand Up @@ -6590,12 +6582,22 @@ static int airo_set_encodeext(struct net_device *dev,
default:
return -EINVAL;
}
/* Send the key to the card */
rc = set_wep_key(local, idx, key.key, key.len, perm, 1);
if (rc < 0) {
airo_print_err(local->dev->name, "failed to set WEP key"
" at index %d: %d.", idx, rc);
return rc;
if (key.len == 0) {
rc = set_wep_tx_idx(local, idx, perm, 1);
if (rc < 0) {
airo_print_err(local->dev->name,
"failed to set WEP transmit index to %d: %d.",
idx, rc);
return rc;
}
} else {
rc = set_wep_key(local, idx, key.key, key.len, perm, 1);
if (rc < 0) {
airo_print_err(local->dev->name,
"failed to set WEP key at index %d: %d.",
idx, rc);
return rc;
}
}
}

Expand Down
1 change: 0 additions & 1 deletion drivers/net/wireless/ath/ath.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ struct ath_common;

struct ath_bus_ops {
void (*read_cachesize)(struct ath_common *common, int *csz);
void (*cleanup)(struct ath_common *common);
bool (*eeprom_read)(struct ath_common *common, u32 off, u16 *data);
void (*bt_coex_prep)(struct ath_common *common);
};
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/wireless/ath/ath5k/ath5k.h
Original file line number Diff line number Diff line change
Expand Up @@ -535,7 +535,7 @@ struct ath5k_txq_info {
u32 tqi_cbr_period; /* Constant bit rate period */
u32 tqi_cbr_overflow_limit;
u32 tqi_burst_time;
u32 tqi_ready_time; /* Not used */
u32 tqi_ready_time; /* Time queue waits after an event */
};

/*
Expand Down
22 changes: 19 additions & 3 deletions drivers/net/wireless/ath/ath5k/base.c
Original file line number Diff line number Diff line change
Expand Up @@ -1516,7 +1516,8 @@ ath5k_beaconq_config(struct ath5k_softc *sc)

ret = ath5k_hw_get_tx_queueprops(ah, sc->bhalq, &qi);
if (ret)
return ret;
goto err;

if (sc->opmode == NL80211_IFTYPE_AP ||
sc->opmode == NL80211_IFTYPE_MESH_POINT) {
/*
Expand All @@ -1543,10 +1544,25 @@ ath5k_beaconq_config(struct ath5k_softc *sc)
if (ret) {
ATH5K_ERR(sc, "%s: unable to update parameters for beacon "
"hardware queue!\n", __func__);
return ret;
goto err;
}
ret = ath5k_hw_reset_tx_queue(ah, sc->bhalq); /* push to h/w */
if (ret)
goto err;

return ath5k_hw_reset_tx_queue(ah, sc->bhalq); /* push to h/w */;
/* reconfigure cabq with ready time to 80% of beacon_interval */
ret = ath5k_hw_get_tx_queueprops(ah, AR5K_TX_QUEUE_ID_CAB, &qi);
if (ret)
goto err;

qi.tqi_ready_time = (sc->bintval * 80) / 100;
ret = ath5k_hw_set_tx_queueprops(ah, AR5K_TX_QUEUE_ID_CAB, &qi);
if (ret)
goto err;

ret = ath5k_hw_reset_tx_queue(ah, AR5K_TX_QUEUE_ID_CAB);
err:
return ret;
}

static void
Expand Down
2 changes: 2 additions & 0 deletions drivers/net/wireless/ath/ath5k/led.c
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@ static const struct pci_device_id ath5k_led_devices[] = {
{ ATH_SDEVICE(PCI_VENDOR_ID_HP, 0x0137a), ATH_LED(3, 1) },
/* HP Compaq C700 (nitrousnrg@gmail.com) */
{ ATH_SDEVICE(PCI_VENDOR_ID_HP, 0x0137b), ATH_LED(3, 1) },
/* LiteOn AR5BXB63 (magooz@salug.it) */
{ ATH_SDEVICE(PCI_VENDOR_ID_ATHEROS, 0x3067), ATH_LED(3, 0) },
/* IBM-specific AR5212 (all others) */
{ PCI_VDEVICE(ATHEROS, PCI_DEVICE_ID_ATHEROS_AR5212_IBM), ATH_LED(0, 0) },
/* Dell Vostro A860 (shahar@shahar-or.co.il) */
Expand Down
5 changes: 3 additions & 2 deletions drivers/net/wireless/ath/ath5k/qcu.c
Original file line number Diff line number Diff line change
Expand Up @@ -408,12 +408,13 @@ int ath5k_hw_reset_tx_queue(struct ath5k_hw *ah, unsigned int queue)
break;

case AR5K_TX_QUEUE_CAB:
/* XXX: use BCN_SENT_GT, if we can figure out how */
AR5K_REG_ENABLE_BITS(ah, AR5K_QUEUE_MISC(queue),
AR5K_QCU_MISC_FRSHED_BCN_SENT_GT |
AR5K_QCU_MISC_FRSHED_DBA_GT |
AR5K_QCU_MISC_CBREXP_DIS |
AR5K_QCU_MISC_CBREXP_BCN_DIS);

ath5k_hw_reg_write(ah, ((AR5K_TUNE_BEACON_INTERVAL -
ath5k_hw_reg_write(ah, ((tq->tqi_ready_time -
(AR5K_TUNE_SW_BEACON_RESP -
AR5K_TUNE_DMA_BEACON_RESP) -
AR5K_TUNE_ADDITIONAL_SWBA_BACKOFF) * 1024) |
Expand Down
5 changes: 3 additions & 2 deletions drivers/net/wireless/ath/ath5k/reset.c
Original file line number Diff line number Diff line change
Expand Up @@ -1374,8 +1374,9 @@ int ath5k_hw_reset(struct ath5k_hw *ah, enum nl80211_iftype op_mode,
* Set clocks to 32KHz operation and use an
* external 32KHz crystal when sleeping if one
* exists */
if (ah->ah_version == AR5K_AR5212)
ath5k_hw_set_sleep_clock(ah, true);
if (ah->ah_version == AR5K_AR5212 &&
ah->ah_op_mode != NL80211_IFTYPE_AP)
ath5k_hw_set_sleep_clock(ah, true);

/*
* Disable beacons and reset the register
Expand Down
Loading

0 comments on commit 10be7eb

Please sign in to comment.