get rid of circular list of adev's
Subsystems (2)
PATCH 1/1 get rid of circular list of adev's
Hi folks,
If someone has cardbus acx, please test this one.
Basically, in acxpci_e_remove() we will check the presence of the card by reading a register and if it is not all ones, we will command device to shut down.
Previously it was done in acxpci_e_cleanup_module().
+INLINE_IO int
+adev_present(acx_device_t *adev)
+{
+ /* fast version (accesses the first register, IO_ACX_SOFT_RESET,
+ * which should be safe): */
+ return readl(adev->iobase) != 0xffffffff;
+}
@@ -1785,6 +1725,43 @@ acxpci_e_remove(struct pci_dev *pdev)
adev = ndev2adev(ndev);
+ /* If device wasn't hot unplugged... */
+ if (adev_present(adev)) {
+
+ acx_sem_lock(adev);
+
+ /* disable both Tx and Rx to shut radio down properly */ + acx_s_issue_cmd(adev, ACX1xx_CMD_DISABLE_TX, NULL, 0); + acx_s_issue_cmd(adev, ACX1xx_CMD_DISABLE_RX, NULL, 0);
...
--
vda
acx_struct.h +1 -6
@@ -1220,14 +1220,9 @@ struct acx_device {unsigned long lock_time;#endif -/*** Device chain ***/ -struct acx_device *next;/* link for list of devices */ -/*** Linux network device ***/ struct net_device *ndev;/* pointer to linux netdevice */ -struct net_device *prev_nd;/* FIXME: We should not chain via our -* private struct acx_device _and_ -* the struct net_device */ +/*** Device statistics ***/ struct net_device_stats stats;/* net device statistics */ #ifdef WIRELESS_EXT
pci.c +60 -149
290 lines not on this page · raw message