LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Simon Arlott <simon@arlott.org>
To: linux-kernel@vger.kernel.org
Subject: [PATCH 1/3] usbatm: Allow sub-drivers to handle calls to atm_proc_read.
Date: Tue, 30 Jan 2007 21:21:53 +0000 [thread overview]
Message-ID: <45BFB6F1.2070303@simon.arlott.org.uk> (raw)
usbatm only outputs basic information via the per-device /proc/net/atm/ file, this patch allows the device specific USB ATM drivers to replace the atm_proc_read function with their own.
Signed-off-by: Simon Arlott <simon@fire.lp0.eu>
---
drivers/usb/atm/usbatm.c | 3 +++
drivers/usb/atm/usbatm.h | 3 +++
2 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/drivers/usb/atm/usbatm.c b/drivers/usb/atm/usbatm.c
index ec63b0e..d91ed11 100644
--- a/drivers/usb/atm/usbatm.c
+++ b/drivers/usb/atm/usbatm.c
@@ -761,6 +761,9 @@ static int usbatm_atm_proc_read(struct a
return -ENODEV;
}
+ if (instance->driver->proc_read != NULL)
+ return instance->driver->proc_read(instance, atm_dev, pos, page);
+
if (!left--)
return sprintf(page, "%s\n", instance->description);
diff --git a/drivers/usb/atm/usbatm.h b/drivers/usb/atm/usbatm.h
index ff8551e..d3c0ee4 100644
--- a/drivers/usb/atm/usbatm.h
+++ b/drivers/usb/atm/usbatm.h
@@ -121,6 +121,9 @@ struct usbatm_driver {
/* cleanup ATM device ... can sleep, but can't fail */
void (*atm_stop) (struct usbatm_data *, struct atm_dev *);
+ /* called when the proc file is read */
+ int (*proc_read) (struct usbatm_data *, struct atm_dev *, loff_t * pos, char *page);
+
int bulk_in; /* bulk rx endpoint */
int isoc_in; /* isochronous rx endpoint */
int bulk_out; /* bulk tx endpoint */
--
1.4.3.1
--
Simon Arlott (subscribed to lkml, don't CC)
next reply other threads:[~2007-01-30 21:27 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-01-30 21:21 Simon Arlott [this message]
2007-01-31 14:48 ` Duncan Sands
2007-01-31 17:50 ` Simon Arlott
2007-01-31 18:04 ` Duncan Sands
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=45BFB6F1.2070303@simon.arlott.org.uk \
--to=simon@arlott.org \
--cc=601753fa5bab1585521hc0qm0003olph@thunder.lp0.eu \
--cc=linux-kernel@vger.kernel.org \
--subject='Re: [PATCH 1/3] usbatm: Allow sub-drivers to handle calls to atm_proc_read.' \
/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
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).