aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/libertas/main.c
diff options
context:
space:
mode:
authorHolger Schurig <hs4233@mail.mn-solutions.de>2007-11-23 09:43:44 -0500
committerDavid S. Miller <davem@davemloft.net>2008-01-28 18:04:54 -0500
commit69f9032d9dfeb763b467fdbe8cf5938f5457083a (patch)
tree613598938e17e1a7514e0da3817f3cfebbe346a9 /drivers/net/wireless/libertas/main.c
parent96287ac4f7b387acbe17e24b5e1bcbf3bc0e75cd (diff)
libertas: remove arbitrary typedefs
New typedefs are usually frowned upon. This patch changes libertas_adapter -> struct libertas_adapter libertas_priv -> struct libertas_priv While passing, make everything checkpatch.pl-clean that gets touches. Signed-off-by: Holger Schurig <hs4233@mail.mn-solutions.de> Acked-by: Dan Williams <dcbw@redhat.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/libertas/main.c')
-rw-r--r--drivers/net/wireless/libertas/main.c122
1 files changed, 63 insertions, 59 deletions
diff --git a/drivers/net/wireless/libertas/main.c b/drivers/net/wireless/libertas/main.c
index 769117916fb3..a3957698edbd 100644
--- a/drivers/net/wireless/libertas/main.c
+++ b/drivers/net/wireless/libertas/main.c
@@ -247,8 +247,8 @@ static ssize_t lbs_anycast_set(struct device *dev,
247 return strlen(buf); 247 return strlen(buf);
248} 248}
249 249
250int lbs_add_rtap(lbs_private *priv); 250int lbs_add_rtap(struct lbs_private *priv);
251void lbs_remove_rtap(lbs_private *priv); 251void lbs_remove_rtap(struct lbs_private *priv);
252 252
253/** 253/**
254 * Get function for sysfs attribute rtap 254 * Get function for sysfs attribute rtap
@@ -256,8 +256,9 @@ void lbs_remove_rtap(lbs_private *priv);
256static ssize_t lbs_rtap_get(struct device *dev, 256static ssize_t lbs_rtap_get(struct device *dev,
257 struct device_attribute *attr, char * buf) 257 struct device_attribute *attr, char * buf)
258{ 258{
259 lbs_private *priv = (lbs_private *) (to_net_dev(dev))->priv; 259 struct lbs_private *priv = (struct lbs_private *)
260 lbs_adapter *adapter = priv->adapter; 260 (to_net_dev(dev))->priv;
261 struct lbs_adapter *adapter = priv->adapter;
261 return snprintf(buf, 5, "0x%X\n", adapter->monitormode); 262 return snprintf(buf, 5, "0x%X\n", adapter->monitormode);
262} 263}
263 264
@@ -268,8 +269,9 @@ static ssize_t lbs_rtap_set(struct device *dev,
268 struct device_attribute *attr, const char * buf, size_t count) 269 struct device_attribute *attr, const char * buf, size_t count)
269{ 270{
270 int monitor_mode; 271 int monitor_mode;
271 lbs_private *priv = (lbs_private *) (to_net_dev(dev))->priv; 272 struct lbs_private *priv = (struct lbs_private *)
272 lbs_adapter *adapter = priv->adapter; 273 (to_net_dev(dev))->priv;
274 struct lbs_adapter *adapter = priv->adapter;
273 275
274 sscanf(buf, "%x", &monitor_mode); 276 sscanf(buf, "%x", &monitor_mode);
275 if (monitor_mode != LBS_MONITOR_OFF) { 277 if (monitor_mode != LBS_MONITOR_OFF) {
@@ -332,7 +334,7 @@ static ssize_t lbs_autostart_enabled_set(struct device *dev,
332{ 334{
333 struct cmd_ds_mesh_access mesh_access; 335 struct cmd_ds_mesh_access mesh_access;
334 uint32_t datum; 336 uint32_t datum;
335 lbs_private *priv = (to_net_dev(dev))->priv; 337 struct lbs_private *priv = (to_net_dev(dev))->priv;
336 int ret; 338 int ret;
337 339
338 memset(&mesh_access, 0, sizeof(mesh_access)); 340 memset(&mesh_access, 0, sizeof(mesh_access));
@@ -375,8 +377,8 @@ static struct attribute_group lbs_mesh_attr_group = {
375 */ 377 */
376static int pre_open_check(struct net_device *dev) 378static int pre_open_check(struct net_device *dev)
377{ 379{
378 lbs_private *priv = (lbs_private *) dev->priv; 380 struct lbs_private *priv = (struct lbs_private *) dev->priv;
379 lbs_adapter *adapter = priv->adapter; 381 struct lbs_adapter *adapter = priv->adapter;
380 int i = 0; 382 int i = 0;
381 383
382 while (!adapter->fw_ready && i < 20) { 384 while (!adapter->fw_ready && i < 20) {
@@ -399,8 +401,8 @@ static int pre_open_check(struct net_device *dev)
399 */ 401 */
400static int lbs_dev_open(struct net_device *dev) 402static int lbs_dev_open(struct net_device *dev)
401{ 403{
402 lbs_private *priv = (lbs_private *) dev->priv; 404 struct lbs_private *priv = (struct lbs_private *) dev->priv;
403 lbs_adapter *adapter = priv->adapter; 405 struct lbs_adapter *adapter = priv->adapter;
404 406
405 lbs_deb_enter(LBS_DEB_NET); 407 lbs_deb_enter(LBS_DEB_NET);
406 408
@@ -429,7 +431,7 @@ static int lbs_dev_open(struct net_device *dev)
429 */ 431 */
430static int lbs_mesh_open(struct net_device *dev) 432static int lbs_mesh_open(struct net_device *dev)
431{ 433{
432 lbs_private *priv = (lbs_private *) dev->priv ; 434 struct lbs_private *priv = (struct lbs_private *) dev->priv ;
433 435
434 if (pre_open_check(dev) == -1) 436 if (pre_open_check(dev) == -1)
435 return -1; 437 return -1;
@@ -453,7 +455,7 @@ static int lbs_mesh_open(struct net_device *dev)
453 */ 455 */
454static int lbs_open(struct net_device *dev) 456static int lbs_open(struct net_device *dev)
455{ 457{
456 lbs_private *priv = (lbs_private *) dev->priv ; 458 struct lbs_private *priv = (struct lbs_private *) dev->priv ;
457 459
458 if(pre_open_check(dev) == -1) 460 if(pre_open_check(dev) == -1)
459 return -1; 461 return -1;
@@ -466,7 +468,7 @@ static int lbs_open(struct net_device *dev)
466 468
467static int lbs_dev_close(struct net_device *dev) 469static int lbs_dev_close(struct net_device *dev)
468{ 470{
469 lbs_private *priv = dev->priv; 471 struct lbs_private *priv = dev->priv;
470 472
471 lbs_deb_enter(LBS_DEB_NET); 473 lbs_deb_enter(LBS_DEB_NET);
472 474
@@ -485,7 +487,7 @@ static int lbs_dev_close(struct net_device *dev)
485 */ 487 */
486static int lbs_mesh_close(struct net_device *dev) 488static int lbs_mesh_close(struct net_device *dev)
487{ 489{
488 lbs_private *priv = (lbs_private *) (dev->priv); 490 struct lbs_private *priv = (struct lbs_private *) (dev->priv);
489 491
490 priv->mesh_open = 0; 492 priv->mesh_open = 0;
491 netif_stop_queue(priv->mesh_dev); 493 netif_stop_queue(priv->mesh_dev);
@@ -503,7 +505,7 @@ static int lbs_mesh_close(struct net_device *dev)
503 */ 505 */
504static int lbs_close(struct net_device *dev) 506static int lbs_close(struct net_device *dev)
505{ 507{
506 lbs_private *priv = (lbs_private *) dev->priv; 508 struct lbs_private *priv = (struct lbs_private *) dev->priv;
507 509
508 netif_stop_queue(dev); 510 netif_stop_queue(dev);
509 priv->infra_open = 0; 511 priv->infra_open = 0;
@@ -517,7 +519,7 @@ static int lbs_close(struct net_device *dev)
517static int lbs_hard_start_xmit(struct sk_buff *skb, struct net_device *dev) 519static int lbs_hard_start_xmit(struct sk_buff *skb, struct net_device *dev)
518{ 520{
519 int ret = 0; 521 int ret = 0;
520 lbs_private *priv = dev->priv; 522 struct lbs_private *priv = dev->priv;
521 523
522 lbs_deb_enter(LBS_DEB_NET); 524 lbs_deb_enter(LBS_DEB_NET);
523 525
@@ -544,7 +546,7 @@ done:
544static int lbs_mesh_pre_start_xmit(struct sk_buff *skb, 546static int lbs_mesh_pre_start_xmit(struct sk_buff *skb,
545 struct net_device *dev) 547 struct net_device *dev)
546{ 548{
547 lbs_private *priv = dev->priv; 549 struct lbs_private *priv = dev->priv;
548 int ret; 550 int ret;
549 551
550 lbs_deb_enter(LBS_DEB_MESH); 552 lbs_deb_enter(LBS_DEB_MESH);
@@ -566,7 +568,7 @@ static int lbs_mesh_pre_start_xmit(struct sk_buff *skb,
566 */ 568 */
567static int lbs_pre_start_xmit(struct sk_buff *skb, struct net_device *dev) 569static int lbs_pre_start_xmit(struct sk_buff *skb, struct net_device *dev)
568{ 570{
569 lbs_private *priv = dev->priv; 571 struct lbs_private *priv = dev->priv;
570 int ret; 572 int ret;
571 573
572 lbs_deb_enter(LBS_DEB_NET); 574 lbs_deb_enter(LBS_DEB_NET);
@@ -585,7 +587,7 @@ static int lbs_pre_start_xmit(struct sk_buff *skb, struct net_device *dev)
585 587
586static void lbs_tx_timeout(struct net_device *dev) 588static void lbs_tx_timeout(struct net_device *dev)
587{ 589{
588 lbs_private *priv = (lbs_private *) dev->priv; 590 struct lbs_private *priv = (struct lbs_private *) dev->priv;
589 591
590 lbs_deb_enter(LBS_DEB_TX); 592 lbs_deb_enter(LBS_DEB_TX);
591 593
@@ -617,12 +619,12 @@ static void lbs_tx_timeout(struct net_device *dev)
617/** 619/**
618 * @brief This function returns the network statistics 620 * @brief This function returns the network statistics
619 * 621 *
620 * @param dev A pointer to lbs_private structure 622 * @param dev A pointer to struct lbs_private structure
621 * @return A pointer to net_device_stats structure 623 * @return A pointer to net_device_stats structure
622 */ 624 */
623static struct net_device_stats *lbs_get_stats(struct net_device *dev) 625static struct net_device_stats *lbs_get_stats(struct net_device *dev)
624{ 626{
625 lbs_private *priv = (lbs_private *) dev->priv; 627 struct lbs_private *priv = (struct lbs_private *) dev->priv;
626 628
627 return &priv->stats; 629 return &priv->stats;
628} 630}
@@ -630,8 +632,8 @@ static struct net_device_stats *lbs_get_stats(struct net_device *dev)
630static int lbs_set_mac_address(struct net_device *dev, void *addr) 632static int lbs_set_mac_address(struct net_device *dev, void *addr)
631{ 633{
632 int ret = 0; 634 int ret = 0;
633 lbs_private *priv = (lbs_private *) dev->priv; 635 struct lbs_private *priv = (struct lbs_private *) dev->priv;
634 lbs_adapter *adapter = priv->adapter; 636 struct lbs_adapter *adapter = priv->adapter;
635 struct sockaddr *phwaddr = addr; 637 struct sockaddr *phwaddr = addr;
636 638
637 lbs_deb_enter(LBS_DEB_NET); 639 lbs_deb_enter(LBS_DEB_NET);
@@ -667,7 +669,7 @@ done:
667 return ret; 669 return ret;
668} 670}
669 671
670static int lbs_copy_multicast_address(lbs_adapter *adapter, 672static int lbs_copy_multicast_address(struct lbs_adapter *adapter,
671 struct net_device *dev) 673 struct net_device *dev)
672{ 674{
673 int i = 0; 675 int i = 0;
@@ -684,8 +686,8 @@ static int lbs_copy_multicast_address(lbs_adapter *adapter,
684 686
685static void lbs_set_multicast_list(struct net_device *dev) 687static void lbs_set_multicast_list(struct net_device *dev)
686{ 688{
687 lbs_private *priv = dev->priv; 689 struct lbs_private *priv = dev->priv;
688 lbs_adapter *adapter = priv->adapter; 690 struct lbs_adapter *adapter = priv->adapter;
689 int oldpacketfilter; 691 int oldpacketfilter;
690 DECLARE_MAC_BUF(mac); 692 DECLARE_MAC_BUF(mac);
691 693
@@ -765,8 +767,8 @@ static void lbs_set_multicast_list(struct net_device *dev)
765static int lbs_thread(void *data) 767static int lbs_thread(void *data)
766{ 768{
767 struct net_device *dev = data; 769 struct net_device *dev = data;
768 lbs_private *priv = dev->priv; 770 struct lbs_private *priv = dev->priv;
769 lbs_adapter *adapter = priv->adapter; 771 struct lbs_adapter *adapter = priv->adapter;
770 wait_queue_t wait; 772 wait_queue_t wait;
771 u8 ireg = 0; 773 u8 ireg = 0;
772 774
@@ -928,13 +930,13 @@ static int lbs_thread(void *data)
928 * HW spec from firmware and set basic parameters to 930 * HW spec from firmware and set basic parameters to
929 * firmware. 931 * firmware.
930 * 932 *
931 * @param priv A pointer to lbs_private structure 933 * @param priv A pointer to struct lbs_private structure
932 * @return 0 or -1 934 * @return 0 or -1
933 */ 935 */
934static int lbs_setup_firmware(lbs_private *priv) 936static int lbs_setup_firmware(struct lbs_private *priv)
935{ 937{
936 int ret = -1; 938 int ret = -1;
937 lbs_adapter *adapter = priv->adapter; 939 struct lbs_adapter *adapter = priv->adapter;
938 struct cmd_ds_mesh_access mesh_access; 940 struct cmd_ds_mesh_access mesh_access;
939 941
940 lbs_deb_enter(LBS_DEB_FW); 942 lbs_deb_enter(LBS_DEB_FW);
@@ -995,8 +997,8 @@ done:
995 */ 997 */
996static void command_timer_fn(unsigned long data) 998static void command_timer_fn(unsigned long data)
997{ 999{
998 lbs_private *priv = (lbs_private *)data; 1000 struct lbs_private *priv = (struct lbs_private *)data;
999 lbs_adapter *adapter = priv->adapter; 1001 struct lbs_adapter *adapter = priv->adapter;
1000 struct cmd_ctrl_node *ptempnode; 1002 struct cmd_ctrl_node *ptempnode;
1001 struct cmd_ds_command *cmd; 1003 struct cmd_ds_command *cmd;
1002 unsigned long flags; 1004 unsigned long flags;
@@ -1030,9 +1032,9 @@ static void command_timer_fn(unsigned long data)
1030 return; 1032 return;
1031} 1033}
1032 1034
1033static int lbs_init_adapter(lbs_private *priv) 1035static int lbs_init_adapter(struct lbs_private *priv)
1034{ 1036{
1035 lbs_adapter *adapter = priv->adapter; 1037 struct lbs_adapter *adapter = priv->adapter;
1036 size_t bufsize; 1038 size_t bufsize;
1037 int i, ret = 0; 1039 int i, ret = 0;
1038 1040
@@ -1101,9 +1103,9 @@ out:
1101 return ret; 1103 return ret;
1102} 1104}
1103 1105
1104static void lbs_free_adapter(lbs_private *priv) 1106static void lbs_free_adapter(struct lbs_private *priv)
1105{ 1107{
1106 lbs_adapter *adapter = priv->adapter; 1108 struct lbs_adapter *adapter = priv->adapter;
1107 1109
1108 if (!adapter) { 1110 if (!adapter) {
1109 lbs_deb_fw("why double free adapter?\n"); 1111 lbs_deb_fw("why double free adapter?\n");
@@ -1131,25 +1133,27 @@ static void lbs_free_adapter(lbs_private *priv)
1131 * card, allocate the lbs_priv and initialize the device. 1133 * card, allocate the lbs_priv and initialize the device.
1132 * 1134 *
1133 * @param card A pointer to card 1135 * @param card A pointer to card
1134 * @return A pointer to lbs_private structure 1136 * @return A pointer to struct lbs_private structure
1135 */ 1137 */
1136lbs_private *lbs_add_card(void *card, struct device *dmdev) 1138struct lbs_private *lbs_add_card(void *card, struct device *dmdev)
1137{ 1139{
1138 struct net_device *dev = NULL; 1140 struct net_device *dev = NULL;
1139 lbs_private *priv = NULL; 1141 struct lbs_private *priv = NULL;
1140 1142
1141 lbs_deb_enter(LBS_DEB_NET); 1143 lbs_deb_enter(LBS_DEB_NET);
1142 1144
1143 /* Allocate an Ethernet device and register it */ 1145 /* Allocate an Ethernet device and register it */
1144 if (!(dev = alloc_etherdev(sizeof(lbs_private)))) { 1146 dev = alloc_etherdev(sizeof(struct lbs_private));
1147 if (!dev) {
1145 lbs_pr_err("init ethX device failed\n"); 1148 lbs_pr_err("init ethX device failed\n");
1146 goto done; 1149 goto done;
1147 } 1150 }
1148 priv = dev->priv; 1151 priv = dev->priv;
1149 1152
1150 /* allocate buffer for lbs_adapter */ 1153 /* allocate buffer for struct lbs_adapter */
1151 if (!(priv->adapter = kzalloc(sizeof(lbs_adapter), GFP_KERNEL))) { 1154 priv->adapter = kzalloc(sizeof(struct lbs_adapter), GFP_KERNEL);
1152 lbs_pr_err("allocate buffer for lbs_adapter failed\n"); 1155 if (!priv->adapter) {
1156 lbs_pr_err("allocate buffer for struct lbs_adapter failed\n");
1153 goto err_kzalloc; 1157 goto err_kzalloc;
1154 } 1158 }
1155 1159
@@ -1217,9 +1221,9 @@ done:
1217EXPORT_SYMBOL_GPL(lbs_add_card); 1221EXPORT_SYMBOL_GPL(lbs_add_card);
1218 1222
1219 1223
1220int lbs_remove_card(lbs_private *priv) 1224int lbs_remove_card(struct lbs_private *priv)
1221{ 1225{
1222 lbs_adapter *adapter = priv->adapter; 1226 struct lbs_adapter *adapter = priv->adapter;
1223 struct net_device *dev = priv->dev; 1227 struct net_device *dev = priv->dev;
1224 union iwreq_data wrqu; 1228 union iwreq_data wrqu;
1225 1229
@@ -1258,7 +1262,7 @@ int lbs_remove_card(lbs_private *priv)
1258EXPORT_SYMBOL_GPL(lbs_remove_card); 1262EXPORT_SYMBOL_GPL(lbs_remove_card);
1259 1263
1260 1264
1261int lbs_start_card(lbs_private *priv) 1265int lbs_start_card(struct lbs_private *priv)
1262{ 1266{
1263 struct net_device *dev = priv->dev; 1267 struct net_device *dev = priv->dev;
1264 int ret = -1; 1268 int ret = -1;
@@ -1291,7 +1295,7 @@ done:
1291EXPORT_SYMBOL_GPL(lbs_start_card); 1295EXPORT_SYMBOL_GPL(lbs_start_card);
1292 1296
1293 1297
1294int lbs_stop_card(lbs_private *priv) 1298int lbs_stop_card(struct lbs_private *priv)
1295{ 1299{
1296 struct net_device *dev = priv->dev; 1300 struct net_device *dev = priv->dev;
1297 int ret = -1; 1301 int ret = -1;
@@ -1324,10 +1328,10 @@ EXPORT_SYMBOL_GPL(lbs_stop_card);
1324/** 1328/**
1325 * @brief This function adds mshX interface 1329 * @brief This function adds mshX interface
1326 * 1330 *
1327 * @param priv A pointer to the lbs_private structure 1331 * @param priv A pointer to the struct lbs_private structure
1328 * @return 0 if successful, -X otherwise 1332 * @return 0 if successful, -X otherwise
1329 */ 1333 */
1330int lbs_add_mesh(lbs_private *priv, struct device *dev) 1334int lbs_add_mesh(struct lbs_private *priv, struct device *dev)
1331{ 1335{
1332 struct net_device *mesh_dev = NULL; 1336 struct net_device *mesh_dev = NULL;
1333 int ret = 0; 1337 int ret = 0;
@@ -1385,7 +1389,7 @@ done:
1385EXPORT_SYMBOL_GPL(lbs_add_mesh); 1389EXPORT_SYMBOL_GPL(lbs_add_mesh);
1386 1390
1387 1391
1388void lbs_remove_mesh(lbs_private *priv) 1392void lbs_remove_mesh(struct lbs_private *priv)
1389{ 1393{
1390 struct net_device *mesh_dev; 1394 struct net_device *mesh_dev;
1391 1395
@@ -1441,9 +1445,9 @@ struct chan_freq_power *lbs_get_region_cfp_table(u8 region, u8 band, int *cfp_no
1441 return NULL; 1445 return NULL;
1442} 1446}
1443 1447
1444int lbs_set_regiontable(lbs_private *priv, u8 region, u8 band) 1448int lbs_set_regiontable(struct lbs_private *priv, u8 region, u8 band)
1445{ 1449{
1446 lbs_adapter *adapter = priv->adapter; 1450 struct lbs_adapter *adapter = priv->adapter;
1447 int ret = 0; 1451 int ret = 0;
1448 int i = 0; 1452 int i = 0;
1449 1453
@@ -1485,7 +1489,7 @@ out:
1485 */ 1489 */
1486void lbs_interrupt(struct net_device *dev) 1490void lbs_interrupt(struct net_device *dev)
1487{ 1491{
1488 lbs_private *priv = dev->priv; 1492 struct lbs_private *priv = dev->priv;
1489 1493
1490 lbs_deb_enter(LBS_DEB_THREAD); 1494 lbs_deb_enter(LBS_DEB_THREAD);
1491 1495
@@ -1507,7 +1511,7 @@ void lbs_interrupt(struct net_device *dev)
1507} 1511}
1508EXPORT_SYMBOL_GPL(lbs_interrupt); 1512EXPORT_SYMBOL_GPL(lbs_interrupt);
1509 1513
1510int lbs_reset_device(lbs_private *priv) 1514int lbs_reset_device(struct lbs_private *priv)
1511{ 1515{
1512 int ret; 1516 int ret;
1513 1517
@@ -1562,12 +1566,12 @@ static int lbs_rtap_hard_start_xmit(struct sk_buff *skb, struct net_device *dev)
1562 1566
1563static struct net_device_stats *lbs_rtap_get_stats(struct net_device *dev) 1567static struct net_device_stats *lbs_rtap_get_stats(struct net_device *dev)
1564{ 1568{
1565 lbs_private *priv = dev->priv; 1569 struct lbs_private *priv = dev->priv;
1566 return &priv->ieee->stats; 1570 return &priv->ieee->stats;
1567} 1571}
1568 1572
1569 1573
1570void lbs_remove_rtap(lbs_private *priv) 1574void lbs_remove_rtap(struct lbs_private *priv)
1571{ 1575{
1572 if (priv->rtap_net_dev == NULL) 1576 if (priv->rtap_net_dev == NULL)
1573 return; 1577 return;
@@ -1576,7 +1580,7 @@ void lbs_remove_rtap(lbs_private *priv)
1576 priv->rtap_net_dev = NULL; 1580 priv->rtap_net_dev = NULL;
1577} 1581}
1578 1582
1579int lbs_add_rtap(lbs_private *priv) 1583int lbs_add_rtap(struct lbs_private *priv)
1580{ 1584{
1581 int rc = 0; 1585 int rc = 0;
1582 1586