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 3/7] acxsm: Create struct acx_ops
Date: Tue, 28 Feb 2006 17:30:14 +0100 [thread overview]
Message-ID: <11411442144096-git-send-email-carlos@cmartin.tk> (raw)
In-Reply-To: <1141144213577-git-send-email-carlos@cmartin.tk>
struct acx_ops is where the device-specific functions go. This allows
us to call these functions from the acx-common.ko module without
creating recursive dependencies.
Signed-off-by: Carlos Martin <carlos@cmartin.tk>
---
acx_struct.h | 32 ++++++++++++++++++++++++++++----
1 files changed, 28 insertions(+), 4 deletions(-)
fe7e63091292e78cb523c8060b267c0faeb3b898
diff --git a/acx_struct.h b/acx_struct.h
index 93495e0..227b6e3 100644
--- a/acx_struct.h
+++ b/acx_struct.h
@@ -87,6 +87,31 @@ enum { acx_debug = 0 };
#define SCHEDULE_WORK schedule_work
#define FLUSH_SCHEDULED_WORK flush_scheduled_work
+/***********************************************************************
+** Chip-specific functions get set here.
+*/
+
+struct acx_ops {
+ int (*create_dma_regions)(acx_device_t *);
+ void (*delete_dma_regions)(acx_device_t *);
+
+#if ACX_DEBUG
+ int (*issue_cmd)(acx_device_t *adev, unsigned cmd, void *param,
+ unsigned len, unsigned cmd_timeout, const char *cmdstr);
+#else
+ int (*issue_cmd)(acx_device_t *adev, unsigned cmd, void *param,
+ unsigned len, unsigned cmd_timeout);
+#endif /* ACX_DEBUG */
+ tx_t* (*alloc_tx)(acx_device_t *adev);
+ void (*dealloc_tx)(tx_t *tx_opaque);
+
+ void* (*get_txbuf)(acx_device_t *adev, tx_t *tx_opaque);
+ void (*tx_data)(acx_device_t *adev, tx_t *tx_opaque, int len);
+
+ int (*write_phy_reg)(acx_device_t *adev, u32 reg, u8 value);
+ int (*read_phy_reg)(acx_device_t *adev, u32 reg, u8 *charbuf);
+};
+
/***********************************************************************
** Constants
@@ -105,10 +130,6 @@ enum { acx_debug = 0 };
#define DEVTYPE_PCI 0
#define DEVTYPE_USB 1
-#if !defined(CONFIG_ACX_PCI) && !defined(CONFIG_ACX_USB)
-#error Driver must include PCI and/or USB support. You selected neither.
-#endif
-
#if defined(CONFIG_ACX_PCI)
#if !defined(CONFIG_ACX_USB)
#define IS_PCI(adev) 1
@@ -1198,6 +1219,9 @@ struct acx_device {
/*** Linux network device ***/
struct net_device *ndev; /* pointer to linux netdevice */
+ /* Chip-specific functions */
+ struct acx_ops ops;
+
/*** Device statistics ***/
struct net_device_stats stats; /* net device statistics */
#ifdef WIRELESS_EXT
--
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
next 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 ` Carlos Martin [this message]
2006-02-28 16:30 ` [PATCH 2/7] acxsm: Move module init/exit to the modules Carlos Martin
2006-02-28 16:30 ` [PATCH 6/7] acxsm: Assign chip-specific ops in the probe functions Carlos Martin
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=11411442144096-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).