Hi,
here's a patch to make the zd1211 driver work with current kernel versions
(applies on top of svn rev. 84).
(Yes, I know I should fix zd1211rw to work on my hardware instead... But
sometimes the quicker thing to do wins ;) ).
Best regards,
bero
--
Get your own Linux distribution -- http://www.yold.org/
--- zd1211/src/zd1211.h.zd1211-2.6.20~ 2006-08-02 15:47:22.000000000 +0200
+++ zd1211/src/zd1211.h 2007-02-24 00:45:00.000000000 +0100
@@ -203,7 +203,7 @@
int zd1211_USB_SET_RF_REG(u16 *InputValue, int bIs3683A);
int zd1211_submit_rx_urb(struct zd1205_private *macp);
int zd1211_submit_tx_urb(struct zd1205_private *macp,BOOLEAN LastFrag);
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0))
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)) || (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,19))
void zd1211_tx_comp_cb(struct urb *urb);
void zd1211_rx_comp_cb(struct urb *urb);
void zd1211_intr_cb(struct urb *urb);
@@ -221,7 +221,12 @@
int zd1211_GetUSBSpecData(struct zd1205_private *macp, u8 *pBuffer, u32 uImgLength, u16 uCodeOfst);
int zd1211_DownLoadUSBCode(struct zd1205_private *macp, u8* FileName, void *ptr, u16 uCodeOfst);
int zd1211_WriteMultiRegister(u16 *Address, u16 *Value, u16 RegCount, u8 bAddUSBCSRAddress);
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20))
void kevent(void *data);
+#else
+void kevent(struct work_struct *work);
+void scan_tout_event(struct work_struct *work);
+#endif
void defer_kevent(struct zd1205_private *macp, int flag);
void zd1211_rx_isr(unsigned long parm);
void zd1211_tx_isr(unsigned long parm);
--- zd1211/src/zd1211.c.zd1211-2.6.20~ 2006-08-02 15:47:22.000000000 +0200
+++ zd1211/src/zd1211.c 2007-02-24 00:45:18.000000000 +0100
@@ -1801,8 +1801,13 @@
spin_lock_init(&(macp->q_lock));
spin_lock_init(&(macp->cs_lock));
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20))
INIT_WORK(&macp->kevent, kevent, macp);
INIT_WORK(&macp->scan_tout_event, kevent, macp);
+#else
+ INIT_WORK(&macp->kevent, kevent);
+ INIT_WORK(&macp->scan_tout_event, scan_tout_event);
+#endif
macp->numTcb = NUM_TCB;
macp->numTbd = NUM_TBD;
@@ -2291,7 +2291,7 @@
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0))
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)) || (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,19))
void zd1211_rx_comp_cb(struct urb *urb)
#else
void zd1211_rx_comp_cb(struct urb *urb, struct pt_regs *regs)
@@ -2371,7 +2371,7 @@
//callback function for interrupt or response
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0))
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)) || (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,19))
void zd1211_intr_cb(struct urb *urb)
#else
void zd1211_intr_cb(struct urb *urb, struct pt_regs *regs)
@@ -2528,7 +2528,7 @@
//callback function for register get/set
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0))
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)) || (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,19))
void zd1211_reg_cb(struct urb *urb)
#else
void zd1211_reg_cb(struct urb *urb, struct pt_regs *regs)
@@ -2698,7 +2698,7 @@
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0))
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)) || (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,19))
void zd1211_tx_comp_cb(struct urb *urb)
#else
void zd1211_tx_comp_cb(struct urb *urb, struct pt_regs *regs)
@@ -3296,9 +3296,15 @@
}
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20))
void kevent(void *data)
+#else
+static void process_event(struct zd1205_private *macp)
+#endif
{
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20))
struct zd1205_private *macp = (struct zd1205_private *) data;
+#endif
if (!macp->bUSBDeveiceAttached) {
return;
}
@@ -3448,6 +3417,20 @@
}
}
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20))
+void scan_tout_event(struct work_struct *work)
+{
+ struct zd1205_private *macp = container_of(work, struct zd1205_private, scan_tout_event);
+ process_event(macp);
+}
+
+void kevent(struct work_struct *work)
+{
+ struct zd1205_private *macp = container_of(work, struct zd1205_private, kevent);
+ process_event(macp);
+}
+#endif
+
void zd1211_alloc_rx(unsigned long parm)
{
struct zd1205_private *macp = (struct zd1205_private *) parm;
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Zd1211-devs mailing list - http://zd1211.ath.cx/
Unsubscribe: https://lists.sourceforge.net/lists/listinfo/zd1211-devs