On 9/2/07, Ludovic Rousseau <[EMAIL PROTECTED]> wrote:
> 2007/9/2, Kaido Kert <[EMAIL PROTECTED]>:
> > hey
>
> Hello,
>
> > SCM supplies their linux drivers in part-source, part binary form. I
> > have a PCMCIA SCR241 reader, and their scr24x_v4.2.3_Release driver
> > worked on previous Ubuntu versions.
> > However, due to some kernel API changes ( workqueues ) it didnt
> > compile with newer kernels , namely 2.6.20.
> > So i did a few modifications using http://lwn.net/Articles/211279 as a
> > guide ( i am no kernel hacker ) and got it to compile and load, seems
> > to work so far too.
> >
> > where should i post the patch ?
>
> You should send it to the driver author, i.e. SCM.
>
> You can also post it here so it is stored in the mailing list archive
> and indexed by google and friends.
>
> bye
>
> --
> Dr. Ludovic Rousseau
attaching the patch, dont know if the list accepts patches ..
-kert
diff -rubw scr24x_v4.2.3_Release/scr24x_2.6.x_v4.2.3/src/def.h scr24x_2.6.x_v4.2.3_modified/src/def.h
--- scr24x_v4.2.3_Release/scr24x_2.6.x_v4.2.3/src/def.h 2006-10-05 11:33:30.000000000 +0300
+++ scr24x_2.6.x_v4.2.3_modified/src/def.h 2007-09-02 13:26:16.000000000 +0300
@@ -229,7 +229,7 @@
typedef unsigned short USHORT;
typedef short BOOLEAN;
typedef short BOOL;
-typedef BOOLEAN bool;
+//typedef BOOLEAN bool;
typedef UCHAR *PBYTE;
typedef char* STR;
typedef ULONG NTSTATUS;
diff -rubw scr24x_v4.2.3_Release/scr24x_2.6.x_v4.2.3/src/includes.h scr24x_2.6.x_v4.2.3_modified/src/includes.h
--- scr24x_v4.2.3_Release/scr24x_2.6.x_v4.2.3/src/includes.h 2006-10-05 11:33:30.000000000 +0300
+++ scr24x_2.6.x_v4.2.3_modified/src/includes.h 2007-09-02 17:33:01.000000000 +0300
@@ -83,6 +83,7 @@
#include <linux/unistd.h>
#include <linux/interrupt.h>
#include <linux/syscalls.h>
+#include <linux/workqueue.h>
//#include <boot/kernel.h>
@@ -116,4 +117,9 @@
#include "protos.h"
#include "debuglog.h"
+struct worker_with_param {
+ struct work_struct worker;
+ void *worker_data;
+};
+
#endif
diff -rubw scr24x_v4.2.3_Release/scr24x_2.6.x_v4.2.3/src/PcdmHdlr.c scr24x_2.6.x_v4.2.3_modified/src/PcdmHdlr.c
--- scr24x_v4.2.3_Release/scr24x_2.6.x_v4.2.3/src/PcdmHdlr.c 2006-10-05 11:33:22.000000000 +0300
+++ scr24x_2.6.x_v4.2.3_modified/src/PcdmHdlr.c 2007-09-02 17:40:25.000000000 +0300
@@ -46,7 +46,10 @@
// extern struct work_struct stWorkQueue;s
-DECLARE_WORK(stWorkQueue, NULL, NULL);
+struct worker_with_param stWorkQueue = {
+ __WORK_INITIALIZER_NAR(stWorkQueue.worker,NULL),
+ NULL
+ };
DECLARE_WAIT_QUEUE_HEAD(qWaitforDeviceReady);
NTSTATUS IFDGetCardStatus( PDEVICE_EXTENSION pDeviceExtension )
@@ -324,8 +327,11 @@
{
outb( DummyReg6, (unsigned) &IoBase->DummyReg6 );
pDeviceExtension->bIsQueueSet = TRUE;
- PREPARE_WORK(&stWorkQueue, tqGetCardStatus, pDeviceExtension);
- schedule_work(&stWorkQueue);
+
+
+ stWorkQueue.worker_data = pDeviceExtension;
+ PREPARE_WORK(&stWorkQueue.worker, tqGetCardStatus);
+ schedule_work(&stWorkQueue.worker);
}
}
} while (FALSE);
diff -rubw scr24x_v4.2.3_Release/scr24x_2.6.x_v4.2.3/src/protos.h scr24x_2.6.x_v4.2.3_modified/src/protos.h
--- scr24x_v4.2.3_Release/scr24x_2.6.x_v4.2.3/src/protos.h 2006-10-05 11:33:30.000000000 +0300
+++ scr24x_2.6.x_v4.2.3_modified/src/protos.h 2007-09-02 16:17:14.000000000 +0300
@@ -152,7 +152,7 @@
PDEVICE_EXTENSION pDeviceExtension
);
-void tqGetCardStatus( void *arg);
+void tqGetCardStatus( struct work_struct *work);
void SetEventWait( void *arg );
diff -rubw scr24x_v4.2.3_Release/scr24x_2.6.x_v4.2.3/src/scr241_main.c scr24x_2.6.x_v4.2.3_modified/src/scr241_main.c
--- scr24x_v4.2.3_Release/scr24x_2.6.x_v4.2.3/src/scr241_main.c 2006-10-06 09:50:10.000000000 +0300
+++ scr24x_2.6.x_v4.2.3_modified/src/scr241_main.c 2007-09-02 17:38:04.000000000 +0300
@@ -2597,14 +2597,16 @@
// This is a dummy function to override the debug data
}
-void tqGetCardStatus( void *arg)
+void tqGetCardStatus( struct work_struct *work)
{
/*==========================================================
This is a scheduler queue used to trigger the card status
function if the interrupt got is from our device
===========================================================*/
PDEVICE_EXTENSION pDeviceExtension;
- pDeviceExtension = (PDEVICE_EXTENSION) arg;
+ struct worker_with_param *container = container_of(work, struct worker_with_param, worker);
+ pDeviceExtension = (PDEVICE_EXTENSION) container->worker_data;
+ work_release(work);
DebugLog ("\n tqGetCardStatus Entry\n");
_______________________________________________
Muscle mailing list
[email protected]
http://lists.drizzle.com/mailman/listinfo/muscle