Add a new structure, udsl_control. It will live in the sk_buff cb field,
so check there is room for it and bail out during module init if not.
speedtouch.c | 18 ++++++++++++++++++
1 files changed, 18 insertions(+)
diff -Nru a/drivers/usb/misc/speedtouch.c b/drivers/usb/misc/speedtouch.c
--- a/drivers/usb/misc/speedtouch.c Wed Feb 5 16:23:17 2003
+++ b/drivers/usb/misc/speedtouch.c Wed Feb 5 16:23:17 2003
@@ -141,6 +141,17 @@
struct udsl_instance_data *instance;
};
+struct udsl_control {
+ struct atm_skb_data atm_data;
+ unsigned int num_cells;
+ unsigned int num_entire;
+ unsigned char cell_header [ATM_CELL_HEADER];
+ unsigned int pdu_padding;
+ unsigned char aal5_trailer [ATM_AAL5_TRAILER];
+};
+
+#define UDSL_SKB(x) ((struct udsl_control *)(x)->cb)
+
/*
* UDSL main driver data
*/
@@ -1064,7 +1075,14 @@
static int __init udsl_usb_init (void)
{
+ struct sk_buff *skb; /* dummy for sizeof */
+
PDEBUG ("udsl_usb_init: driver version " DRIVER_VERSION "\n");
+
+ if (sizeof (struct udsl_control) > sizeof (skb->cb)) {
+ printk (KERN_ERR __FILE__ ": unusable with this kernel!\n");
+ return -EIO;
+ }
return usb_register (&udsl_usb_driver);
}
-------------------------------------------------------
This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel