aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorHamish Guthrie <hamish.guthrie@sonycom.com>2010-01-28 06:54:09 -0500
committerJohn W. Linville <linville@tuxdriver.com>2010-01-28 15:21:56 -0500
commitc1596b75c29eb5b32c65ef1e186c8b08c289bf05 (patch)
tree9380202d85d49bd114c6535ac56a1a116b8154c5 /drivers/net
parent54233261d5aa2926f080b67ac22f508c9f15e690 (diff)
ps3_gelic_wireless: Remove PS3 gelic legacy wpa support
The current PS3 gelic wireless driver has support for wireless extensions. The original PS3 gelic wireless driver exposed a dedicated API for a dedicated wpa_supplicant driver. This old API could be enabled with CONFIG_GELIC_WIRELESS_OLD_PSK_INTERFACE, however, as this is not being used by any distros, and it is being removed from the driver and from wpa_supplicant. Signed-off-by: Hamish Guthrie <hamish.guthrie@sonycom.com> Acked-by: Geoff Levand <geoffrey.levand@am.sony.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/Kconfig14
-rw-r--r--drivers/net/ps3_gelic_wireless.c137
2 files changed, 0 insertions, 151 deletions
diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig
index 18ff622703be..6460505ab24c 100644
--- a/drivers/net/Kconfig
+++ b/drivers/net/Kconfig
@@ -2354,20 +2354,6 @@ config GELIC_WIRELESS
2354 the driver automatically distinguishes the models, you can 2354 the driver automatically distinguishes the models, you can
2355 safely enable this option even if you have a wireless-less model. 2355 safely enable this option even if you have a wireless-less model.
2356 2356
2357config GELIC_WIRELESS_OLD_PSK_INTERFACE
2358 bool "PS3 Wireless private PSK interface (OBSOLETE)"
2359 depends on GELIC_WIRELESS
2360 select WEXT_PRIV
2361 help
2362 This option retains the obsolete private interface to pass
2363 the PSK from user space programs to the driver. The PSK
2364 stands for 'Pre Shared Key' and is used for WPA[2]-PSK
2365 (WPA-Personal) environment.
2366 If WPA[2]-PSK is used and you need to use old programs that
2367 support only this old interface, say Y. Otherwise N.
2368
2369 If unsure, say N.
2370
2371config FSL_PQ_MDIO 2357config FSL_PQ_MDIO
2372 tristate "Freescale PQ MDIO" 2358 tristate "Freescale PQ MDIO"
2373 depends on FSL_SOC 2359 depends on FSL_SOC
diff --git a/drivers/net/ps3_gelic_wireless.c b/drivers/net/ps3_gelic_wireless.c
index 227b141c4fbd..7571dbba6a0a 100644
--- a/drivers/net/ps3_gelic_wireless.c
+++ b/drivers/net/ps3_gelic_wireless.c
@@ -1389,113 +1389,6 @@ static int gelic_wl_get_mode(struct net_device *netdev,
1389 return 0; 1389 return 0;
1390} 1390}
1391 1391
1392#ifdef CONFIG_GELIC_WIRELESS_OLD_PSK_INTERFACE
1393/* SIOCIWFIRSTPRIV */
1394static int hex2bin(u8 *str, u8 *bin, unsigned int len)
1395{
1396 unsigned int i;
1397 static unsigned char *hex = "0123456789ABCDEF";
1398 unsigned char *p, *q;
1399 u8 tmp;
1400
1401 if (len != WPA_PSK_LEN * 2)
1402 return -EINVAL;
1403
1404 for (i = 0; i < WPA_PSK_LEN * 2; i += 2) {
1405 p = strchr(hex, toupper(str[i]));
1406 q = strchr(hex, toupper(str[i + 1]));
1407 if (!p || !q) {
1408 pr_info("%s: unconvertible PSK digit=%d\n",
1409 __func__, i);
1410 return -EINVAL;
1411 }
1412 tmp = ((p - hex) << 4) + (q - hex);
1413 *bin++ = tmp;
1414 }
1415 return 0;
1416};
1417
1418static int gelic_wl_priv_set_psk(struct net_device *net_dev,
1419 struct iw_request_info *info,
1420 union iwreq_data *data, char *extra)
1421{
1422 struct gelic_wl_info *wl = port_wl(netdev_priv(net_dev));
1423 unsigned int len;
1424 unsigned long irqflag;
1425 int ret = 0;
1426
1427 pr_debug("%s:<- len=%d\n", __func__, data->data.length);
1428 len = data->data.length - 1;
1429 if (len <= 2)
1430 return -EINVAL;
1431
1432 spin_lock_irqsave(&wl->lock, irqflag);
1433 if (extra[0] == '"' && extra[len - 1] == '"') {
1434 pr_debug("%s: passphrase mode\n", __func__);
1435 /* pass phrase */
1436 if (GELIC_WL_EURUS_PSK_MAX_LEN < (len - 2)) {
1437 pr_info("%s: passphrase too long\n", __func__);
1438 ret = -E2BIG;
1439 goto out;
1440 }
1441 memset(wl->psk, 0, sizeof(wl->psk));
1442 wl->psk_len = len - 2;
1443 memcpy(wl->psk, &(extra[1]), wl->psk_len);
1444 wl->psk_type = GELIC_EURUS_WPA_PSK_PASSPHRASE;
1445 } else {
1446 ret = hex2bin(extra, wl->psk, len);
1447 if (ret)
1448 goto out;
1449 wl->psk_len = WPA_PSK_LEN;
1450 wl->psk_type = GELIC_EURUS_WPA_PSK_BIN;
1451 }
1452 set_bit(GELIC_WL_STAT_WPA_PSK_SET, &wl->stat);
1453out:
1454 spin_unlock_irqrestore(&wl->lock, irqflag);
1455 pr_debug("%s:->\n", __func__);
1456 return ret;
1457}
1458
1459static int gelic_wl_priv_get_psk(struct net_device *net_dev,
1460 struct iw_request_info *info,
1461 union iwreq_data *data, char *extra)
1462{
1463 struct gelic_wl_info *wl = port_wl(netdev_priv(net_dev));
1464 char *p;
1465 unsigned long irqflag;
1466 unsigned int i;
1467
1468 pr_debug("%s:<-\n", __func__);
1469 if (!capable(CAP_NET_ADMIN))
1470 return -EPERM;
1471
1472 spin_lock_irqsave(&wl->lock, irqflag);
1473 p = extra;
1474 if (test_bit(GELIC_WL_STAT_WPA_PSK_SET, &wl->stat)) {
1475 if (wl->psk_type == GELIC_EURUS_WPA_PSK_BIN) {
1476 for (i = 0; i < wl->psk_len; i++) {
1477 sprintf(p, "%02xu", wl->psk[i]);
1478 p += 2;
1479 }
1480 *p = '\0';
1481 data->data.length = wl->psk_len * 2;
1482 } else {
1483 *p++ = '"';
1484 memcpy(p, wl->psk, wl->psk_len);
1485 p += wl->psk_len;
1486 *p++ = '"';
1487 *p = '\0';
1488 data->data.length = wl->psk_len + 2;
1489 }
1490 } else
1491 /* no psk set */
1492 data->data.length = 0;
1493 spin_unlock_irqrestore(&wl->lock, irqflag);
1494 pr_debug("%s:-> %d\n", __func__, data->data.length);
1495 return 0;
1496}
1497#endif
1498
1499/* SIOCGIWNICKN */ 1392/* SIOCGIWNICKN */
1500static int gelic_wl_get_nick(struct net_device *net_dev, 1393static int gelic_wl_get_nick(struct net_device *net_dev,
1501 struct iw_request_info *info, 1394 struct iw_request_info *info,
@@ -2406,40 +2299,10 @@ static const iw_handler gelic_wl_wext_handler[] =
2406 IW_IOCTL(SIOCGIWNICKN) = gelic_wl_get_nick, 2299 IW_IOCTL(SIOCGIWNICKN) = gelic_wl_get_nick,
2407}; 2300};
2408 2301
2409#ifdef CONFIG_GELIC_WIRELESS_OLD_PSK_INTERFACE
2410static struct iw_priv_args gelic_wl_private_args[] =
2411{
2412 {
2413 .cmd = GELIC_WL_PRIV_SET_PSK,
2414 .set_args = IW_PRIV_TYPE_CHAR |
2415 (GELIC_WL_EURUS_PSK_MAX_LEN + 2),
2416 .name = "set_psk"
2417 },
2418 {
2419 .cmd = GELIC_WL_PRIV_GET_PSK,
2420 .get_args = IW_PRIV_TYPE_CHAR |
2421 (GELIC_WL_EURUS_PSK_MAX_LEN + 2),
2422 .name = "get_psk"
2423 }
2424};
2425
2426static const iw_handler gelic_wl_private_handler[] =
2427{
2428 gelic_wl_priv_set_psk,
2429 gelic_wl_priv_get_psk,
2430};
2431#endif
2432
2433static const struct iw_handler_def gelic_wl_wext_handler_def = { 2302static const struct iw_handler_def gelic_wl_wext_handler_def = {
2434 .num_standard = ARRAY_SIZE(gelic_wl_wext_handler), 2303 .num_standard = ARRAY_SIZE(gelic_wl_wext_handler),
2435 .standard = gelic_wl_wext_handler, 2304 .standard = gelic_wl_wext_handler,
2436 .get_wireless_stats = gelic_wl_get_wireless_stats, 2305 .get_wireless_stats = gelic_wl_get_wireless_stats,
2437#ifdef CONFIG_GELIC_WIRELESS_OLD_PSK_INTERFACE
2438 .num_private = ARRAY_SIZE(gelic_wl_private_handler),
2439 .num_private_args = ARRAY_SIZE(gelic_wl_private_args),
2440 .private = gelic_wl_private_handler,
2441 .private_args = gelic_wl_private_args,
2442#endif
2443}; 2306};
2444 2307
2445static struct net_device * __devinit gelic_wl_alloc(struct gelic_card *card) 2308static struct net_device * __devinit gelic_wl_alloc(struct gelic_card *card)