From: Carlos Martin <carlos@cmartin.tk>
To: netdev@vger.kernel.org
Cc: Denis Vlasenko <vda@ilport.com.ua>,
acx100-devel@lists.sourceforge.net,
Christoph Hellwig <hch@infradead.org>,
Carlos Martin <carlos@kiopa. (none)>,
Carlos Martin <carlos@cmartin.tk>
Subject: [PATCH 6/7] acxsm: Assign chip-specific ops in the probe functions
Date: Tue, 28 Feb 2006 17:30:14 +0100 [thread overview]
Message-ID: <11411442141984-git-send-email-carlos@cmartin.tk> (raw)
In-Reply-To: <1141144213577-git-send-email-carlos@cmartin.tk>
Assign the chip-specific ops in the probe functions. Add extern and
dummy functions where needed.
Signed-off-by: Carlos Martin <carlos@cmartin.tk>
---
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&kid\x110944&bid$1720&dat\x121642
prev parent reply other threads:[~2006-02-28 16:30 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-02-28 16:30 [PATCH 0/7] acxsm: Make acxsm modular again (2nd try) Carlos Martin
2006-02-28 16:30 ` [PATCH 1/7] acxsm: Change Kconfig and Makefile to be modular Carlos Martin
2006-02-28 16:30 ` [PATCH 3/7] acxsm: Create struct acx_ops Carlos Martin
2006-02-28 16:30 ` [PATCH 2/7] acxsm: Move module init/exit to the modules Carlos Martin
2006-02-28 16:30 ` Carlos Martin [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=11411442141984-git-send-email-carlos@cmartin.tk \
--to=carlos@cmartin.tk \
--cc=acx100-devel@lists.sourceforge.net \
--cc=carlos@kiopa. \
--cc=hch@infradead.org \
--cc=netdev@vger.kernel.org \
--cc=vda@ilport.com.ua \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).