Mercurial > archived > louis > epitech > mq > rathaxes
annotate rathaxes_start_to_implement_the_ethernet_subsystem_in_the_lkm.patch @ 13:d00a5829811d
rathaxes: add net_dev_ops + register netdev device, but still a bug, see the diff
author | Thomas Sanchez <thomas.sanchz@gmail.com> |
---|---|
date | Fri, 06 Jan 2012 18:08:41 +0100 |
parents | 80cfe40c1136 |
children | 4aac69287060 |
rev | line source |
---|---|
12
80cfe40c1136
WIP on the LKM sample, add a patch to work on the Ethernet subsystem
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
1 # HG changeset patch |
13
d00a5829811d
rathaxes: add net_dev_ops + register netdev device, but still a bug, see the diff
Thomas Sanchez <thomas.sanchz@gmail.com>
parents:
12
diff
changeset
|
2 # Parent 6d15ec109487b733721b6dbe84c27841f441e196 |
12
80cfe40c1136
WIP on the LKM sample, add a patch to work on the Ethernet subsystem
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
3 rathaxes: start to implement the Ethernet subsystem in linux LKM sample |
80cfe40c1136
WIP on the LKM sample, add a patch to work on the Ethernet subsystem
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
4 |
13
d00a5829811d
rathaxes: add net_dev_ops + register netdev device, but still a bug, see the diff
Thomas Sanchez <thomas.sanchz@gmail.com>
parents:
12
diff
changeset
|
5 diff -r 6d15ec109487 rathaxes/samples/lkm/CMakeLists.txt |
d00a5829811d
rathaxes: add net_dev_ops + register netdev device, but still a bug, see the diff
Thomas Sanchez <thomas.sanchz@gmail.com>
parents:
12
diff
changeset
|
6 --- a/rathaxes/samples/lkm/CMakeLists.txt Fri Jan 06 17:34:47 2012 +0100 |
d00a5829811d
rathaxes: add net_dev_ops + register netdev device, but still a bug, see the diff
Thomas Sanchez <thomas.sanchz@gmail.com>
parents:
12
diff
changeset
|
7 +++ b/rathaxes/samples/lkm/CMakeLists.txt Fri Jan 06 18:06:48 2012 +0100 |
12
80cfe40c1136
WIP on the LKM sample, add a patch to work on the Ethernet subsystem
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
8 @@ -1,6 +1,6 @@ |
80cfe40c1136
WIP on the LKM sample, add a patch to work on the Ethernet subsystem
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
9 ADD_RATHAXES_SOURCES(lkm lkm.rtx |
80cfe40c1136
WIP on the LKM sample, add a patch to work on the Ethernet subsystem
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
10 - RTI log.rti lkm.rti pci.rti |
80cfe40c1136
WIP on the LKM sample, add a patch to work on the Ethernet subsystem
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
11 - BLT log.blt lkm.blt pci.blt) |
80cfe40c1136
WIP on the LKM sample, add a patch to work on the Ethernet subsystem
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
12 + RTI log.rti lkm.rti pci.rti ethernet.rti |
80cfe40c1136
WIP on the LKM sample, add a patch to work on the Ethernet subsystem
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
13 + BLT log.blt lkm.blt pci.blt ethernet.blt) |
80cfe40c1136
WIP on the LKM sample, add a patch to work on the Ethernet subsystem
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
14 |
80cfe40c1136
WIP on the LKM sample, add a patch to work on the Ethernet subsystem
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
15 # We can't name lkm since it's already used as the target name to generate the |
80cfe40c1136
WIP on the LKM sample, add a patch to work on the Ethernet subsystem
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
16 # source (with ADD_RATHAXES_SOURCES). |
13
d00a5829811d
rathaxes: add net_dev_ops + register netdev device, but still a bug, see the diff
Thomas Sanchez <thomas.sanchz@gmail.com>
parents:
12
diff
changeset
|
17 diff -r 6d15ec109487 rathaxes/samples/lkm/ethernet.blt |
d00a5829811d
rathaxes: add net_dev_ops + register netdev device, but still a bug, see the diff
Thomas Sanchez <thomas.sanchz@gmail.com>
parents:
12
diff
changeset
|
18 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 |
d00a5829811d
rathaxes: add net_dev_ops + register netdev device, but still a bug, see the diff
Thomas Sanchez <thomas.sanchz@gmail.com>
parents:
12
diff
changeset
|
19 +++ b/rathaxes/samples/lkm/ethernet.blt Fri Jan 06 18:06:48 2012 +0100 |
d00a5829811d
rathaxes: add net_dev_ops + register netdev device, but still a bug, see the diff
Thomas Sanchez <thomas.sanchz@gmail.com>
parents:
12
diff
changeset
|
20 @@ -0,0 +1,135 @@ |
12
80cfe40c1136
WIP on the LKM sample, add a patch to work on the Ethernet subsystem
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
21 +with Ethernet, PCI, LKM |
80cfe40c1136
WIP on the LKM sample, add a patch to work on the Ethernet subsystem
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
22 +{ |
80cfe40c1136
WIP on the LKM sample, add a patch to work on the Ethernet subsystem
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
23 + template type Ethernet::Device() |
80cfe40c1136
WIP on the LKM sample, add a patch to work on the Ethernet subsystem
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
24 + { |
80cfe40c1136
WIP on the LKM sample, add a patch to work on the Ethernet subsystem
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
25 + chunk LKM::includes() |
80cfe40c1136
WIP on the LKM sample, add a patch to work on the Ethernet subsystem
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
26 + { |
80cfe40c1136
WIP on the LKM sample, add a patch to work on the Ethernet subsystem
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
27 + #include <linux/netdevice.h> |
80cfe40c1136
WIP on the LKM sample, add a patch to work on the Ethernet subsystem
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
28 + #include <linux/etherdevice.h> |
80cfe40c1136
WIP on the LKM sample, add a patch to work on the Ethernet subsystem
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
29 + |
80cfe40c1136
WIP on the LKM sample, add a patch to work on the Ethernet subsystem
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
30 + typedef int include_linux_net_system_stamp; |
80cfe40c1136
WIP on the LKM sample, add a patch to work on the Ethernet subsystem
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
31 + } |
80cfe40c1136
WIP on the LKM sample, add a patch to work on the Ethernet subsystem
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
32 + |
80cfe40c1136
WIP on the LKM sample, add a patch to work on the Ethernet subsystem
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
33 + chunk ::decl() |
80cfe40c1136
WIP on the LKM sample, add a patch to work on the Ethernet subsystem
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
34 + { |
80cfe40c1136
WIP on the LKM sample, add a patch to work on the Ethernet subsystem
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
35 + struct net_device; |
80cfe40c1136
WIP on the LKM sample, add a patch to work on the Ethernet subsystem
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
36 + } |
80cfe40c1136
WIP on the LKM sample, add a patch to work on the Ethernet subsystem
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
37 + |
80cfe40c1136
WIP on the LKM sample, add a patch to work on the Ethernet subsystem
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
38 + chunk ::init(net_dev) |
80cfe40c1136
WIP on the LKM sample, add a patch to work on the Ethernet subsystem
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
39 + { |
80cfe40c1136
WIP on the LKM sample, add a patch to work on the Ethernet subsystem
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
40 + ${self} = ${net_dev}; |
80cfe40c1136
WIP on the LKM sample, add a patch to work on the Ethernet subsystem
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
41 + } |
80cfe40c1136
WIP on the LKM sample, add a patch to work on the Ethernet subsystem
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
42 + |
80cfe40c1136
WIP on the LKM sample, add a patch to work on the Ethernet subsystem
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
43 + map |
80cfe40c1136
WIP on the LKM sample, add a patch to work on the Ethernet subsystem
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
44 + { |
80cfe40c1136
WIP on the LKM sample, add a patch to work on the Ethernet subsystem
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
45 + } |
80cfe40c1136
WIP on the LKM sample, add a patch to work on the Ethernet subsystem
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
46 + } |
80cfe40c1136
WIP on the LKM sample, add a patch to work on the Ethernet subsystem
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
47 + |
80cfe40c1136
WIP on the LKM sample, add a patch to work on the Ethernet subsystem
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
48 + template sequence Ethernet::open(Ethernet::Device dev) |
80cfe40c1136
WIP on the LKM sample, add a patch to work on the Ethernet subsystem
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
49 + { |
80cfe40c1136
WIP on the LKM sample, add a patch to work on the Ethernet subsystem
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
50 + chunk LKM::prototypes() |
80cfe40c1136
WIP on the LKM sample, add a patch to work on the Ethernet subsystem
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
51 + { |
80cfe40c1136
WIP on the LKM sample, add a patch to work on the Ethernet subsystem
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
52 + static int rtx_ethernet_open(struct net_device *); |
80cfe40c1136
WIP on the LKM sample, add a patch to work on the Ethernet subsystem
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
53 + } |
80cfe40c1136
WIP on the LKM sample, add a patch to work on the Ethernet subsystem
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
54 + |
80cfe40c1136
WIP on the LKM sample, add a patch to work on the Ethernet subsystem
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
55 + chunk LKM::code() |
80cfe40c1136
WIP on the LKM sample, add a patch to work on the Ethernet subsystem
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
56 + { |
80cfe40c1136
WIP on the LKM sample, add a patch to work on the Ethernet subsystem
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
57 + static int rtx_ethernet_open(struct net_device *dev) |
80cfe40c1136
WIP on the LKM sample, add a patch to work on the Ethernet subsystem
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
58 + { |
80cfe40c1136
WIP on the LKM sample, add a patch to work on the Ethernet subsystem
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
59 + ${pointcut ::IMPLEMENTATION}; |
80cfe40c1136
WIP on the LKM sample, add a patch to work on the Ethernet subsystem
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
60 + } |
80cfe40c1136
WIP on the LKM sample, add a patch to work on the Ethernet subsystem
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
61 + } |
80cfe40c1136
WIP on the LKM sample, add a patch to work on the Ethernet subsystem
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
62 + } |
80cfe40c1136
WIP on the LKM sample, add a patch to work on the Ethernet subsystem
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
63 + |
80cfe40c1136
WIP on the LKM sample, add a patch to work on the Ethernet subsystem
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
64 + template sequence Ethernet::close(Ethernet::Device dev) |
80cfe40c1136
WIP on the LKM sample, add a patch to work on the Ethernet subsystem
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
65 + { |
80cfe40c1136
WIP on the LKM sample, add a patch to work on the Ethernet subsystem
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
66 + chunk LKM::prototypes() |
80cfe40c1136
WIP on the LKM sample, add a patch to work on the Ethernet subsystem
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
67 + { |
80cfe40c1136
WIP on the LKM sample, add a patch to work on the Ethernet subsystem
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
68 + static int rtx_ethernet_close(struct net_device ); |
80cfe40c1136
WIP on the LKM sample, add a patch to work on the Ethernet subsystem
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
69 + } |
80cfe40c1136
WIP on the LKM sample, add a patch to work on the Ethernet subsystem
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
70 + |
80cfe40c1136
WIP on the LKM sample, add a patch to work on the Ethernet subsystem
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
71 + chunk LKM::code() |
80cfe40c1136
WIP on the LKM sample, add a patch to work on the Ethernet subsystem
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
72 + { |
80cfe40c1136
WIP on the LKM sample, add a patch to work on the Ethernet subsystem
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
73 + static int rtx_ethernet_close(struct net_device dev) |
80cfe40c1136
WIP on the LKM sample, add a patch to work on the Ethernet subsystem
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
74 + { |
80cfe40c1136
WIP on the LKM sample, add a patch to work on the Ethernet subsystem
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
75 + ${pointcut ::IMPLEMENTATION}; |
80cfe40c1136
WIP on the LKM sample, add a patch to work on the Ethernet subsystem
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
76 + } |
80cfe40c1136
WIP on the LKM sample, add a patch to work on the Ethernet subsystem
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
77 + } |
80cfe40c1136
WIP on the LKM sample, add a patch to work on the Ethernet subsystem
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
78 + } |
80cfe40c1136
WIP on the LKM sample, add a patch to work on the Ethernet subsystem
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
79 + |
80cfe40c1136
WIP on the LKM sample, add a patch to work on the Ethernet subsystem
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
80 + template sequence Ethernet::interrupt_handler(Ethernet::Device dev) |
80cfe40c1136
WIP on the LKM sample, add a patch to work on the Ethernet subsystem
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
81 + { |
80cfe40c1136
WIP on the LKM sample, add a patch to work on the Ethernet subsystem
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
82 + /* |
80cfe40c1136
WIP on the LKM sample, add a patch to work on the Ethernet subsystem
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
83 + * Why we can't use irqreturn_t here? (we are forced to use enum |
80cfe40c1136
WIP on the LKM sample, add a patch to work on the Ethernet subsystem
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
84 + * irqreturn, which is the real type). |
80cfe40c1136
WIP on the LKM sample, add a patch to work on the Ethernet subsystem
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
85 + */ |
80cfe40c1136
WIP on the LKM sample, add a patch to work on the Ethernet subsystem
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
86 + |
80cfe40c1136
WIP on the LKM sample, add a patch to work on the Ethernet subsystem
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
87 + chunk LKM::prototypes() |
80cfe40c1136
WIP on the LKM sample, add a patch to work on the Ethernet subsystem
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
88 + { |
80cfe40c1136
WIP on the LKM sample, add a patch to work on the Ethernet subsystem
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
89 + static enum irqreturn rtx_ethernet_interrupt_handler(int, void *); |
80cfe40c1136
WIP on the LKM sample, add a patch to work on the Ethernet subsystem
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
90 + } |
80cfe40c1136
WIP on the LKM sample, add a patch to work on the Ethernet subsystem
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
91 + |
80cfe40c1136
WIP on the LKM sample, add a patch to work on the Ethernet subsystem
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
92 + chunk LKM::code() |
80cfe40c1136
WIP on the LKM sample, add a patch to work on the Ethernet subsystem
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
93 + { |
80cfe40c1136
WIP on the LKM sample, add a patch to work on the Ethernet subsystem
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
94 + static enum irqreturn rtx_ethernet_interrupt_handler(int irq, void *dev_id) |
80cfe40c1136
WIP on the LKM sample, add a patch to work on the Ethernet subsystem
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
95 + { |
80cfe40c1136
WIP on the LKM sample, add a patch to work on the Ethernet subsystem
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
96 + ${pointcut ::IMPLEMENTATION}; |
80cfe40c1136
WIP on the LKM sample, add a patch to work on the Ethernet subsystem
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
97 + } |
80cfe40c1136
WIP on the LKM sample, add a patch to work on the Ethernet subsystem
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
98 + } |
80cfe40c1136
WIP on the LKM sample, add a patch to work on the Ethernet subsystem
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
99 + } |
80cfe40c1136
WIP on the LKM sample, add a patch to work on the Ethernet subsystem
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
100 + |
80cfe40c1136
WIP on the LKM sample, add a patch to work on the Ethernet subsystem
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
101 + template sequence Ethernet::init(PCI::Device dev) |
80cfe40c1136
WIP on the LKM sample, add a patch to work on the Ethernet subsystem
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
102 + { |
80cfe40c1136
WIP on the LKM sample, add a patch to work on the Ethernet subsystem
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
103 + chunk LKM::data() |
80cfe40c1136
WIP on the LKM sample, add a patch to work on the Ethernet subsystem
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
104 + { |
80cfe40c1136
WIP on the LKM sample, add a patch to work on the Ethernet subsystem
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
105 + /* |
80cfe40c1136
WIP on the LKM sample, add a patch to work on the Ethernet subsystem
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
106 + * This typedef is needed to workaround a bug in CNorm __std__ |
80cfe40c1136
WIP on the LKM sample, add a patch to work on the Ethernet subsystem
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
107 + * dialect. |
80cfe40c1136
WIP on the LKM sample, add a patch to work on the Ethernet subsystem
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
108 + */ |
80cfe40c1136
WIP on the LKM sample, add a patch to work on the Ethernet subsystem
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
109 + typedef int ${Ethernet::Device}; |
80cfe40c1136
WIP on the LKM sample, add a patch to work on the Ethernet subsystem
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
110 + |
80cfe40c1136
WIP on the LKM sample, add a patch to work on the Ethernet subsystem
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
111 + static ${Ethernet::Device} *rtx_net_dev = NULL; |
13
d00a5829811d
rathaxes: add net_dev_ops + register netdev device, but still a bug, see the diff
Thomas Sanchez <thomas.sanchz@gmail.com>
parents:
12
diff
changeset
|
112 + static const struct net_device_ops rtx_ether_ops= { |
d00a5829811d
rathaxes: add net_dev_ops + register netdev device, but still a bug, see the diff
Thomas Sanchez <thomas.sanchz@gmail.com>
parents:
12
diff
changeset
|
113 + .ndo_open = rtx_ethernet_open, |
d00a5829811d
rathaxes: add net_dev_ops + register netdev device, but still a bug, see the diff
Thomas Sanchez <thomas.sanchz@gmail.com>
parents:
12
diff
changeset
|
114 + .ndo_stop = rtx_ethernet_close, |
d00a5829811d
rathaxes: add net_dev_ops + register netdev device, but still a bug, see the diff
Thomas Sanchez <thomas.sanchz@gmail.com>
parents:
12
diff
changeset
|
115 + .ndo_start_xmit = NULL, // XXX: |
d00a5829811d
rathaxes: add net_dev_ops + register netdev device, but still a bug, see the diff
Thomas Sanchez <thomas.sanchz@gmail.com>
parents:
12
diff
changeset
|
116 + }; |
d00a5829811d
rathaxes: add net_dev_ops + register netdev device, but still a bug, see the diff
Thomas Sanchez <thomas.sanchz@gmail.com>
parents:
12
diff
changeset
|
117 + |
12
80cfe40c1136
WIP on the LKM sample, add a patch to work on the Ethernet subsystem
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
118 + } |
80cfe40c1136
WIP on the LKM sample, add a patch to work on the Ethernet subsystem
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
119 + |
80cfe40c1136
WIP on the LKM sample, add a patch to work on the Ethernet subsystem
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
120 + chunk ::CALL |
80cfe40c1136
WIP on the LKM sample, add a patch to work on the Ethernet subsystem
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
121 + { |
80cfe40c1136
WIP on the LKM sample, add a patch to work on the Ethernet subsystem
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
122 + /* |
80cfe40c1136
WIP on the LKM sample, add a patch to work on the Ethernet subsystem
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
123 + * int should be replaced by the sizeof an hypothetic "context" |
80cfe40c1136
WIP on the LKM sample, add a patch to work on the Ethernet subsystem
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
124 + * structure defined in the front-end. |
80cfe40c1136
WIP on the LKM sample, add a patch to work on the Ethernet subsystem
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
125 + */ |
80cfe40c1136
WIP on the LKM sample, add a patch to work on the Ethernet subsystem
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
126 + rtx_net_dev = alloc_etherdev(sizeof(int)); |
80cfe40c1136
WIP on the LKM sample, add a patch to work on the Ethernet subsystem
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
127 + /* |
80cfe40c1136
WIP on the LKM sample, add a patch to work on the Ethernet subsystem
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
128 + * if (rtx_net_dev == NULL) |
80cfe40c1136
WIP on the LKM sample, add a patch to work on the Ethernet subsystem
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
129 + * { |
80cfe40c1136
WIP on the LKM sample, add a patch to work on the Ethernet subsystem
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
130 + * // What can we do here? |
80cfe40c1136
WIP on the LKM sample, add a patch to work on the Ethernet subsystem
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
131 + * } |
80cfe40c1136
WIP on the LKM sample, add a patch to work on the Ethernet subsystem
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
132 + */ |
13
d00a5829811d
rathaxes: add net_dev_ops + register netdev device, but still a bug, see the diff
Thomas Sanchez <thomas.sanchz@gmail.com>
parents:
12
diff
changeset
|
133 + |
d00a5829811d
rathaxes: add net_dev_ops + register netdev device, but still a bug, see the diff
Thomas Sanchez <thomas.sanchz@gmail.com>
parents:
12
diff
changeset
|
134 + /* |
d00a5829811d
rathaxes: add net_dev_ops + register netdev device, but still a bug, see the diff
Thomas Sanchez <thomas.sanchz@gmail.com>
parents:
12
diff
changeset
|
135 + * Does not work atm |
d00a5829811d
rathaxes: add net_dev_ops + register netdev device, but still a bug, see the diff
Thomas Sanchez <thomas.sanchz@gmail.com>
parents:
12
diff
changeset
|
136 + */ |
d00a5829811d
rathaxes: add net_dev_ops + register netdev device, but still a bug, see the diff
Thomas Sanchez <thomas.sanchz@gmail.com>
parents:
12
diff
changeset
|
137 + // -> this is the problem, dev cannot be resolved ${dev} = 0; |
d00a5829811d
rathaxes: add net_dev_ops + register netdev device, but still a bug, see the diff
Thomas Sanchez <thomas.sanchz@gmail.com>
parents:
12
diff
changeset
|
138 + // SET_NETDEV_DEV(rtx_net_dev, &${dev}->dev); |
d00a5829811d
rathaxes: add net_dev_ops + register netdev device, but still a bug, see the diff
Thomas Sanchez <thomas.sanchz@gmail.com>
parents:
12
diff
changeset
|
139 + rtx_net_dev->netdev_ops = rtx_ether_ops; |
d00a5829811d
rathaxes: add net_dev_ops + register netdev device, but still a bug, see the diff
Thomas Sanchez <thomas.sanchz@gmail.com>
parents:
12
diff
changeset
|
140 + |
d00a5829811d
rathaxes: add net_dev_ops + register netdev device, but still a bug, see the diff
Thomas Sanchez <thomas.sanchz@gmail.com>
parents:
12
diff
changeset
|
141 + /* if (*/register_netdev(rtx_net_dev);/*)*/ |
d00a5829811d
rathaxes: add net_dev_ops + register netdev device, but still a bug, see the diff
Thomas Sanchez <thomas.sanchz@gmail.com>
parents:
12
diff
changeset
|
142 + /* { |
d00a5829811d
rathaxes: add net_dev_ops + register netdev device, but still a bug, see the diff
Thomas Sanchez <thomas.sanchz@gmail.com>
parents:
12
diff
changeset
|
143 + * XXX: handle the error |
d00a5829811d
rathaxes: add net_dev_ops + register netdev device, but still a bug, see the diff
Thomas Sanchez <thomas.sanchz@gmail.com>
parents:
12
diff
changeset
|
144 + * } |
d00a5829811d
rathaxes: add net_dev_ops + register netdev device, but still a bug, see the diff
Thomas Sanchez <thomas.sanchz@gmail.com>
parents:
12
diff
changeset
|
145 + */ |
12
80cfe40c1136
WIP on the LKM sample, add a patch to work on the Ethernet subsystem
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
146 + } |
80cfe40c1136
WIP on the LKM sample, add a patch to work on the Ethernet subsystem
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
147 + } |
80cfe40c1136
WIP on the LKM sample, add a patch to work on the Ethernet subsystem
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
148 + |
80cfe40c1136
WIP on the LKM sample, add a patch to work on the Ethernet subsystem
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
149 + template sequence Ethernet::exit(PCI::Device dev) |
80cfe40c1136
WIP on the LKM sample, add a patch to work on the Ethernet subsystem
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
150 + { |
80cfe40c1136
WIP on the LKM sample, add a patch to work on the Ethernet subsystem
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
151 + chunk ::CALL |
80cfe40c1136
WIP on the LKM sample, add a patch to work on the Ethernet subsystem
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
152 + { |
80cfe40c1136
WIP on the LKM sample, add a patch to work on the Ethernet subsystem
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
153 + } |
80cfe40c1136
WIP on the LKM sample, add a patch to work on the Ethernet subsystem
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
154 + } |
80cfe40c1136
WIP on the LKM sample, add a patch to work on the Ethernet subsystem
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
155 +} |
13
d00a5829811d
rathaxes: add net_dev_ops + register netdev device, but still a bug, see the diff
Thomas Sanchez <thomas.sanchz@gmail.com>
parents:
12
diff
changeset
|
156 diff -r 6d15ec109487 rathaxes/samples/lkm/ethernet.rti |
d00a5829811d
rathaxes: add net_dev_ops + register netdev device, but still a bug, see the diff
Thomas Sanchez <thomas.sanchz@gmail.com>
parents:
12
diff
changeset
|
157 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 |
d00a5829811d
rathaxes: add net_dev_ops + register netdev device, but still a bug, see the diff
Thomas Sanchez <thomas.sanchz@gmail.com>
parents:
12
diff
changeset
|
158 +++ b/rathaxes/samples/lkm/ethernet.rti Fri Jan 06 18:06:48 2012 +0100 |
12
80cfe40c1136
WIP on the LKM sample, add a patch to work on the Ethernet subsystem
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
159 @@ -0,0 +1,33 @@ |
80cfe40c1136
WIP on the LKM sample, add a patch to work on the Ethernet subsystem
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
160 +interface Ethernet : PCI, LKM |
80cfe40c1136
WIP on the LKM sample, add a patch to work on the Ethernet subsystem
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
161 +{ |
80cfe40c1136
WIP on the LKM sample, add a patch to work on the Ethernet subsystem
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
162 + provided type Ethernet::Device; |
80cfe40c1136
WIP on the LKM sample, add a patch to work on the Ethernet subsystem
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
163 + |
80cfe40c1136
WIP on the LKM sample, add a patch to work on the Ethernet subsystem
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
164 + required sequence Ethernet::open(Ethernet::Device) |
80cfe40c1136
WIP on the LKM sample, add a patch to work on the Ethernet subsystem
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
165 + { |
80cfe40c1136
WIP on the LKM sample, add a patch to work on the Ethernet subsystem
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
166 + provided chunk LKM::prototypes; |
80cfe40c1136
WIP on the LKM sample, add a patch to work on the Ethernet subsystem
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
167 + provided chunk LKM::code; |
80cfe40c1136
WIP on the LKM sample, add a patch to work on the Ethernet subsystem
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
168 + } |
80cfe40c1136
WIP on the LKM sample, add a patch to work on the Ethernet subsystem
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
169 + |
80cfe40c1136
WIP on the LKM sample, add a patch to work on the Ethernet subsystem
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
170 + required sequence Ethernet::close(Ethernet::Device) |
80cfe40c1136
WIP on the LKM sample, add a patch to work on the Ethernet subsystem
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
171 + { |
80cfe40c1136
WIP on the LKM sample, add a patch to work on the Ethernet subsystem
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
172 + provided chunk LKM::prototypes; |
80cfe40c1136
WIP on the LKM sample, add a patch to work on the Ethernet subsystem
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
173 + provided chunk LKM::code; |
80cfe40c1136
WIP on the LKM sample, add a patch to work on the Ethernet subsystem
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
174 + } |
80cfe40c1136
WIP on the LKM sample, add a patch to work on the Ethernet subsystem
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
175 + |
80cfe40c1136
WIP on the LKM sample, add a patch to work on the Ethernet subsystem
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
176 + required sequence Ethernet::interrupt_handler(Ethernet::Device) |
80cfe40c1136
WIP on the LKM sample, add a patch to work on the Ethernet subsystem
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
177 + { |
80cfe40c1136
WIP on the LKM sample, add a patch to work on the Ethernet subsystem
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
178 + provided chunk LKM::prototypes; |
80cfe40c1136
WIP on the LKM sample, add a patch to work on the Ethernet subsystem
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
179 + provided chunk LKM::code; |
80cfe40c1136
WIP on the LKM sample, add a patch to work on the Ethernet subsystem
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
180 + } |
80cfe40c1136
WIP on the LKM sample, add a patch to work on the Ethernet subsystem
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
181 + |
80cfe40c1136
WIP on the LKM sample, add a patch to work on the Ethernet subsystem
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
182 + provided sequence Ethernet::init(PCI::Device) |
80cfe40c1136
WIP on the LKM sample, add a patch to work on the Ethernet subsystem
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
183 + { |
80cfe40c1136
WIP on the LKM sample, add a patch to work on the Ethernet subsystem
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
184 + provided chunk LKM::data; |
80cfe40c1136
WIP on the LKM sample, add a patch to work on the Ethernet subsystem
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
185 + provided chunk ::CALL; |
80cfe40c1136
WIP on the LKM sample, add a patch to work on the Ethernet subsystem
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
186 + } |
80cfe40c1136
WIP on the LKM sample, add a patch to work on the Ethernet subsystem
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
187 + |
80cfe40c1136
WIP on the LKM sample, add a patch to work on the Ethernet subsystem
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
188 + provided sequence Ethernet::exit(PCI::Device) |
80cfe40c1136
WIP on the LKM sample, add a patch to work on the Ethernet subsystem
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
189 + { |
80cfe40c1136
WIP on the LKM sample, add a patch to work on the Ethernet subsystem
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
190 + provided chunk ::CALL; |
80cfe40c1136
WIP on the LKM sample, add a patch to work on the Ethernet subsystem
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
191 + } |
80cfe40c1136
WIP on the LKM sample, add a patch to work on the Ethernet subsystem
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
192 +} |
13
d00a5829811d
rathaxes: add net_dev_ops + register netdev device, but still a bug, see the diff
Thomas Sanchez <thomas.sanchz@gmail.com>
parents:
12
diff
changeset
|
193 diff -r 6d15ec109487 rathaxes/samples/lkm/lkm.rtx |
d00a5829811d
rathaxes: add net_dev_ops + register netdev device, but still a bug, see the diff
Thomas Sanchez <thomas.sanchz@gmail.com>
parents:
12
diff
changeset
|
194 --- a/rathaxes/samples/lkm/lkm.rtx Fri Jan 06 17:34:47 2012 +0100 |
d00a5829811d
rathaxes: add net_dev_ops + register netdev device, but still a bug, see the diff
Thomas Sanchez <thomas.sanchz@gmail.com>
parents:
12
diff
changeset
|
195 +++ b/rathaxes/samples/lkm/lkm.rtx Fri Jan 06 18:06:48 2012 +0100 |
12
80cfe40c1136
WIP on the LKM sample, add a patch to work on the Ethernet subsystem
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
196 @@ -1,13 +1,24 @@ |
80cfe40c1136
WIP on the LKM sample, add a patch to work on the Ethernet subsystem
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
197 device LKM use LKM, PCI, Log |
80cfe40c1136
WIP on the LKM sample, add a patch to work on the Ethernet subsystem
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
198 { |
80cfe40c1136
WIP on the LKM sample, add a patch to work on the Ethernet subsystem
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
199 + Ethernet::open(Ethernet::Device dev) |
80cfe40c1136
WIP on the LKM sample, add a patch to work on the Ethernet subsystem
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
200 + { |
80cfe40c1136
WIP on the LKM sample, add a patch to work on the Ethernet subsystem
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
201 + } |
80cfe40c1136
WIP on the LKM sample, add a patch to work on the Ethernet subsystem
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
202 + |
80cfe40c1136
WIP on the LKM sample, add a patch to work on the Ethernet subsystem
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
203 + Ethernet::close(Ethernet::Device dev) |
80cfe40c1136
WIP on the LKM sample, add a patch to work on the Ethernet subsystem
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
204 + { |
80cfe40c1136
WIP on the LKM sample, add a patch to work on the Ethernet subsystem
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
205 + } |
80cfe40c1136
WIP on the LKM sample, add a patch to work on the Ethernet subsystem
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
206 + |
80cfe40c1136
WIP on the LKM sample, add a patch to work on the Ethernet subsystem
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
207 + Ethernet::interrupt_handler(Ethernet::Device dev) |
80cfe40c1136
WIP on the LKM sample, add a patch to work on the Ethernet subsystem
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
208 + { |
80cfe40c1136
WIP on the LKM sample, add a patch to work on the Ethernet subsystem
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
209 + } |
80cfe40c1136
WIP on the LKM sample, add a patch to work on the Ethernet subsystem
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
210 + |
80cfe40c1136
WIP on the LKM sample, add a patch to work on the Ethernet subsystem
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
211 PCI::probe(PCI::Device dev) |
80cfe40c1136
WIP on the LKM sample, add a patch to work on the Ethernet subsystem
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
212 { |
80cfe40c1136
WIP on the LKM sample, add a patch to work on the Ethernet subsystem
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
213 - |
80cfe40c1136
WIP on the LKM sample, add a patch to work on the Ethernet subsystem
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
214 + Ethernet::init(dev); |
80cfe40c1136
WIP on the LKM sample, add a patch to work on the Ethernet subsystem
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
215 } |
80cfe40c1136
WIP on the LKM sample, add a patch to work on the Ethernet subsystem
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
216 |
80cfe40c1136
WIP on the LKM sample, add a patch to work on the Ethernet subsystem
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
217 PCI::remove(PCI::Device dev) |
80cfe40c1136
WIP on the LKM sample, add a patch to work on the Ethernet subsystem
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
218 { |
80cfe40c1136
WIP on the LKM sample, add a patch to work on the Ethernet subsystem
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
219 - |
80cfe40c1136
WIP on the LKM sample, add a patch to work on the Ethernet subsystem
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
220 } |
80cfe40c1136
WIP on the LKM sample, add a patch to work on the Ethernet subsystem
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
221 |
80cfe40c1136
WIP on the LKM sample, add a patch to work on the Ethernet subsystem
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
222 LKM::init() |
13
d00a5829811d
rathaxes: add net_dev_ops + register netdev device, but still a bug, see the diff
Thomas Sanchez <thomas.sanchz@gmail.com>
parents:
12
diff
changeset
|
223 diff -r 6d15ec109487 rathaxes/samples/lkm/pci.blt |
d00a5829811d
rathaxes: add net_dev_ops + register netdev device, but still a bug, see the diff
Thomas Sanchez <thomas.sanchz@gmail.com>
parents:
12
diff
changeset
|
224 --- a/rathaxes/samples/lkm/pci.blt Fri Jan 06 17:34:47 2012 +0100 |
d00a5829811d
rathaxes: add net_dev_ops + register netdev device, but still a bug, see the diff
Thomas Sanchez <thomas.sanchz@gmail.com>
parents:
12
diff
changeset
|
225 +++ b/rathaxes/samples/lkm/pci.blt Fri Jan 06 18:06:48 2012 +0100 |
12
80cfe40c1136
WIP on the LKM sample, add a patch to work on the Ethernet subsystem
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
226 @@ -11,15 +11,12 @@ |
80cfe40c1136
WIP on the LKM sample, add a patch to work on the Ethernet subsystem
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
227 |
80cfe40c1136
WIP on the LKM sample, add a patch to work on the Ethernet subsystem
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
228 chunk ::decl() |
80cfe40c1136
WIP on the LKM sample, add a patch to work on the Ethernet subsystem
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
229 { |
80cfe40c1136
WIP on the LKM sample, add a patch to work on the Ethernet subsystem
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
230 - struct rtx_pci_device |
80cfe40c1136
WIP on the LKM sample, add a patch to work on the Ethernet subsystem
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
231 - { |
80cfe40c1136
WIP on the LKM sample, add a patch to work on the Ethernet subsystem
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
232 - struct pci_dev *pci_dev; |
80cfe40c1136
WIP on the LKM sample, add a patch to work on the Ethernet subsystem
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
233 - }; |
80cfe40c1136
WIP on the LKM sample, add a patch to work on the Ethernet subsystem
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
234 + struct pci_dev; |
80cfe40c1136
WIP on the LKM sample, add a patch to work on the Ethernet subsystem
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
235 } |
80cfe40c1136
WIP on the LKM sample, add a patch to work on the Ethernet subsystem
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
236 |
80cfe40c1136
WIP on the LKM sample, add a patch to work on the Ethernet subsystem
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
237 chunk ::init(pci_dev) |
80cfe40c1136
WIP on the LKM sample, add a patch to work on the Ethernet subsystem
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
238 { |
80cfe40c1136
WIP on the LKM sample, add a patch to work on the Ethernet subsystem
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
239 - ${self}.pci_dev = pci_dev; |
80cfe40c1136
WIP on the LKM sample, add a patch to work on the Ethernet subsystem
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
240 + ${self} = ${pci_dev}; |
80cfe40c1136
WIP on the LKM sample, add a patch to work on the Ethernet subsystem
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
241 } |
80cfe40c1136
WIP on the LKM sample, add a patch to work on the Ethernet subsystem
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
242 |
80cfe40c1136
WIP on the LKM sample, add a patch to work on the Ethernet subsystem
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
243 map |
80cfe40c1136
WIP on the LKM sample, add a patch to work on the Ethernet subsystem
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
244 @@ -40,11 +37,7 @@ |
80cfe40c1136
WIP on the LKM sample, add a patch to work on the Ethernet subsystem
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
245 static int /* __devinit */ rtx_pci_probe(struct pci_dev *pdev, |
80cfe40c1136
WIP on the LKM sample, add a patch to work on the Ethernet subsystem
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
246 const struct pci_device_id *pdev_id) |
80cfe40c1136
WIP on the LKM sample, add a patch to work on the Ethernet subsystem
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
247 { |
80cfe40c1136
WIP on the LKM sample, add a patch to work on the Ethernet subsystem
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
248 - /* workaround for CNorm __std__ dialect, shouldn't be here */ |
80cfe40c1136
WIP on the LKM sample, add a patch to work on the Ethernet subsystem
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
249 - typedef int ${PCI::Device}; |
80cfe40c1136
WIP on the LKM sample, add a patch to work on the Ethernet subsystem
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
250 - |
80cfe40c1136
WIP on the LKM sample, add a patch to work on the Ethernet subsystem
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
251 int err; |
80cfe40c1136
WIP on the LKM sample, add a patch to work on the Ethernet subsystem
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
252 - ${PCI::Device} *dev = NULL; |
80cfe40c1136
WIP on the LKM sample, add a patch to work on the Ethernet subsystem
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
253 |
80cfe40c1136
WIP on the LKM sample, add a patch to work on the Ethernet subsystem
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
254 err = pci_enable_device(pdev); |
80cfe40c1136
WIP on the LKM sample, add a patch to work on the Ethernet subsystem
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
255 // if (err < 0) /* `if' doesn't work */ |
80cfe40c1136
WIP on the LKM sample, add a patch to work on the Ethernet subsystem
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
256 @@ -52,8 +45,6 @@ |
80cfe40c1136
WIP on the LKM sample, add a patch to work on the Ethernet subsystem
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
257 |
80cfe40c1136
WIP on the LKM sample, add a patch to work on the Ethernet subsystem
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
258 ${pointcut ::IMPLEMENTATION}; |
80cfe40c1136
WIP on the LKM sample, add a patch to work on the Ethernet subsystem
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
259 |
80cfe40c1136
WIP on the LKM sample, add a patch to work on the Ethernet subsystem
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
260 - pci_set_drvdata(pdev, dev); |
80cfe40c1136
WIP on the LKM sample, add a patch to work on the Ethernet subsystem
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
261 - |
80cfe40c1136
WIP on the LKM sample, add a patch to work on the Ethernet subsystem
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
262 return 0; |
80cfe40c1136
WIP on the LKM sample, add a patch to work on the Ethernet subsystem
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
263 |
80cfe40c1136
WIP on the LKM sample, add a patch to work on the Ethernet subsystem
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
264 fail: |