[PATCH 6/7] acxsm: Assign chip-specific ops in the probe functions
From: Carlos Martin <hidden>
Date: 2006-02-28 16:30:14
Subsystem:
the rest · Maintainer:
Linus Torvalds
Assign the chip-specific ops in the probe functions. Add extern and dummy functions where needed. Signed-off-by: Carlos Martin <redacted> --- acx_func.h | 1 + pci.c | 24 ++++++++++++++++++++++++ usb.c | 19 +++++++++++++++++++ 3 files changed, 44 insertions(+), 0 deletions(-) 1a6bb060d33906c12c6ef161b851cc1fab91d3a9
diff --git a/acx_func.h b/acx_func.h
index 0823aec..238c633 100644
--- a/acx_func.h
+++ b/acx_func.h@@ -534,6 +534,7 @@ acx_l_alloc_tx(acx_device_t *adev) } void acxusb_l_dealloc_tx(tx_t *tx_opaque); +void acxpci_l_dealloc_tx(tx_t *tx_opaque); static inline void acx_l_dealloc_tx(acx_device_t *adev, tx_t *tx_opaque) {
diff --git a/pci.c b/pci.c
index 24224b9..23abb96 100644
--- a/pci.c
+++ b/pci.c@@ -105,6 +105,9 @@ static int acxpci_e_close(struct net_dev static void acxpci_s_up(struct net_device *ndev); static void acxpci_s_down(struct net_device *ndev); +extern int acx100_s_create_dma_regions(acx_device_t *); +extern int acx111_s_create_dma_regions(acx_device_t *); + #ifdef MODULE_LICENSE MODULE_LICENSE("Dual MPL/GPL"); #endif
@@ -1599,6 +1602,22 @@ acxpci_e_probe(struct pci_dev *pdev, con adev->ieee->sec.enabled = 0; adev->ieee->sec.auth_mode = WLAN_AUTH_OPEN; +#if ACX_DEBUG + adev->ops.issue_cmd = acxpci_s_issue_cmd_timeo_debug; +#else + adev->ops.issue_cmd = acxpci_s_issue_cmd_timeo; +#endif /* ACX_DEBUG */ + adev->ops.alloc_tx = acxpci_l_alloc_tx; + adev->ops.dealloc_tx = acxpci_l_dealloc_tx; + adev->ops.delete_dma_regions = acxpci_s_delete_dma_regions; + adev->ops.write_phy_reg = acxpci_s_write_phy_reg; + adev->ops.read_phy_reg = acxpci_s_read_phy_reg; + + if (IS_ACX100(adev)) { + adev->ops.create_dma_regions = acx100_s_create_dma_regions; + } else { + adev->ops.create_dma_regions = acx111_s_create_dma_regions; + } #ifdef NONESSENTIAL_FEATURES acx_show_card_eeprom_id(adev); #endif /* NONESSENTIAL_FEATURES */
@@ -3058,6 +3077,11 @@ end: return (tx_t*)txdesc; } +/* Dummy function. */ +static void +acxpci_l_dealloc_tx(tx_t *tx_opaque) +{ +} /*********************************************************************** */
diff --git a/usb.c b/usb.c
index 6b0b578..5833d04 100644
--- a/usb.c
+++ b/usb.c@@ -123,6 +123,8 @@ static void acxusb_l_poll_rx(acx_device_ static void acxusb_i_tx_timeout(struct net_device *); +extern int acx100_s_create_dma_regions(acx_device_t *); + /* static void dump_device(struct usb_device *); */ /* static void dump_device_descriptor(struct usb_device_descriptor *); */ /* static void dump_config_descriptor(struct usb_config_descriptor *); */
@@ -763,6 +765,11 @@ acxusb_s_fill_configoption(acx_device_t return OK; } +/* Dummy function. */ +static void +acxusb_s_delete_dma_regions(acx_device_t *adev) +{ +} /*********************************************************************** ** acxusb_e_probe()
@@ -891,6 +898,18 @@ acxusb_e_probe(struct usb_interface *int adev->ieee->sec.encrypt = 0; adev->ieee->sec.auth_mode = WLAN_AUTH_OPEN; +#if ACX_DEBUG + adev->ops.issue_cmd = acxusb_s_issue_cmd_timeo_debug; +#else + adev->ops.issue_cmd = acxusb_s_issue_cmd_timeo; +#endif /* ACX_DEBUG */ + adev->ops.alloc_tx = acxusb_l_alloc_tx; + adev->ops.dealloc_tx = acxusb_l_dealloc_tx; + adev->ops.delete_dma_regions = acxusb_s_delete_dma_regions; + adev->ops.write_phy_reg = acxusb_s_write_phy_reg; + adev->ops.read_phy_reg = acxusb_s_read_phy_reg; + adev->ops.create_dma_regions = acx100_s_create_dma_regions; + /* Check that this is really the hardware we know about. ** If not sure, at least notify the user that he ** may be in trouble...
--
1.2.1.g62a4
-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid0944&bid$1720&dat1642