forked from ~ljy/RK356X_SDK_RELEASE

hc
2023-12-11 072de836f53be56a70cecf70b43ae43b7ce17376
kernel/drivers/net/wireless/wl3501_cs.c
....@@ -1,3 +1,4 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * WL3501 Wireless LAN PCMCIA Card Driver for Linux
34 * Written originally for Linux 2.0.30 by Fox Chen, mhchen@golf.ccl.itri.org.tw
....@@ -133,8 +134,8 @@
133134
134135 /**
135136 * iw_valid_channel - validate channel in regulatory domain
136
- * @reg_comain - regulatory domain
137
- * @channel - channel to validate
137
+ * @reg_comain: regulatory domain
138
+ * @channel: channel to validate
138139 *
139140 * Returns 0 if invalid in the specified regulatory domain, non-zero if valid.
140141 */
....@@ -153,7 +154,7 @@
153154
154155 /**
155156 * iw_default_channel - get default channel for a regulatory domain
156
- * @reg_comain - regulatory domain
157
+ * @reg_domain: regulatory domain
157158 *
158159 * Returns the default channel for a regulatory domain
159160 */
....@@ -236,6 +237,7 @@
236237
237238 /**
238239 * wl3501_set_to_wla - Move 'size' bytes from PC to card
240
+ * @this: Card
239241 * @dest: Card addressing space
240242 * @src: PC addressing space
241243 * @size: Bytes to move
....@@ -258,6 +260,7 @@
258260
259261 /**
260262 * wl3501_get_from_wla - Move 'size' bytes from card to PC
263
+ * @this: Card
261264 * @src: Card addressing space
262265 * @dest: PC addressing space
263266 * @size: Bytes to move
....@@ -454,7 +457,7 @@
454457
455458 /**
456459 * wl3501_send_pkt - Send a packet.
457
- * @this - card
460
+ * @this: Card
458461 *
459462 * Send a packet.
460463 *
....@@ -722,7 +725,7 @@
722725
723726 /**
724727 * wl3501_block_interrupt - Mask interrupt from SUTRO
725
- * @this - card
728
+ * @this: Card
726729 *
727730 * Mask interrupt from SUTRO. (i.e. SUTRO cannot interrupt the HOST)
728731 * Return: 1 if interrupt is originally enabled
....@@ -739,7 +742,7 @@
739742
740743 /**
741744 * wl3501_unblock_interrupt - Enable interrupt from SUTRO
742
- * @this - card
745
+ * @this: Card
743746 *
744747 * Enable interrupt from SUTRO. (i.e. SUTRO can interrupt the HOST)
745748 * Return: 1 if interrupt is originally enabled
....@@ -1113,8 +1116,8 @@
11131116
11141117 /**
11151118 * wl3501_interrupt - Hardware interrupt from card.
1116
- * @irq - Interrupt number
1117
- * @dev_id - net_device
1119
+ * @irq: Interrupt number
1120
+ * @dev_id: net_device
11181121 *
11191122 * We must acknowledge the interrupt as soon as possible, and block the
11201123 * interrupt from the same card immediately to prevent re-entry.
....@@ -1229,7 +1232,6 @@
12291232 static int wl3501_close(struct net_device *dev)
12301233 {
12311234 struct wl3501_card *this = netdev_priv(dev);
1232
- int rc = -ENODEV;
12331235 unsigned long flags;
12341236 struct pcmcia_device *link;
12351237 link = this->p_dev;
....@@ -1244,15 +1246,14 @@
12441246 /* Mask interrupts from the SUTRO */
12451247 wl3501_block_interrupt(this);
12461248
1247
- rc = 0;
12481249 printk(KERN_INFO "%s: WL3501 closed\n", dev->name);
12491250 spin_unlock_irqrestore(&this->lock, flags);
1250
- return rc;
1251
+ return 0;
12511252 }
12521253
12531254 /**
12541255 * wl3501_reset - Reset the SUTRO.
1255
- * @dev - network device
1256
+ * @dev: network device
12561257 *
12571258 * It is almost the same as wl3501_open(). In fact, we may just wl3501_close()
12581259 * and wl3501_open() again, but I wouldn't like to free_irq() when the driver
....@@ -1290,7 +1291,7 @@
12901291 return rc;
12911292 }
12921293
1293
-static void wl3501_tx_timeout(struct net_device *dev)
1294
+static void wl3501_tx_timeout(struct net_device *dev, unsigned int txqueue)
12941295 {
12951296 struct net_device_stats *stats = &dev->stats;
12961297 int rc;
....@@ -1415,7 +1416,7 @@
14151416
14161417 /**
14171418 * wl3501_detach - deletes a driver "instance"
1418
- * @link - FILL_IN
1419
+ * @link: FILL_IN
14191420 *
14201421 * This deletes a driver "instance". The device is de-registered with Card
14211422 * Services. If it has been released, all local data structures are freed.
....@@ -1436,9 +1437,7 @@
14361437 wl3501_release(link);
14371438
14381439 unregister_netdev(dev);
1439
-
1440
- if (link->priv)
1441
- free_netdev(link->priv);
1440
+ free_netdev(dev);
14421441 }
14431442
14441443 static int wl3501_get_name(struct net_device *dev, struct iw_request_info *info,