Mercurial > archived > louis > epitech > mq > rathaxes
annotate rathaxes_cleanups_in_ethernet_rti_blt.patch @ 98:147519512c3d
Commit before pulling Joa's changes
author | Louis Opter <louis@lse.epita.fr> |
---|---|
date | Thu, 22 Nov 2012 16:41:18 -0800 |
parents | 2cc8fda4c4e3 |
children | e2c237d6c37b |
rev | line source |
---|---|
93
2cc8fda4c4e3
Add a patch with some wip on the ethernet part of the e1000 sample
Louis Opter <louis@lse.epita.fr>
parents:
diff
changeset
|
1 # HG changeset patch |
98
147519512c3d
Commit before pulling Joa's changes
Louis Opter <louis@lse.epita.fr>
parents:
93
diff
changeset
|
2 # Parent 6cc56c206e65a31121a9e9745003fed8276b0b60 |
93
2cc8fda4c4e3
Add a patch with some wip on the ethernet part of the e1000 sample
Louis Opter <louis@lse.epita.fr>
parents:
diff
changeset
|
3 rathaxes: tidy up ethernet.{rti,blt} in the e1000 sample |
2cc8fda4c4e3
Add a patch with some wip on the ethernet part of the e1000 sample
Louis Opter <louis@lse.epita.fr>
parents:
diff
changeset
|
4 |
2cc8fda4c4e3
Add a patch with some wip on the ethernet part of the e1000 sample
Louis Opter <louis@lse.epita.fr>
parents:
diff
changeset
|
5 - Remove typedefs; |
2cc8fda4c4e3
Add a patch with some wip on the ethernet part of the e1000 sample
Louis Opter <louis@lse.epita.fr>
parents:
diff
changeset
|
6 - Rename Ethernet::SubContext in Ethernet::HardwareContext: I think this |
2cc8fda4c4e3
Add a patch with some wip on the ethernet part of the e1000 sample
Louis Opter <louis@lse.epita.fr>
parents:
diff
changeset
|
7 is more clear. This pointcut is here to allow the underlying real |
2cc8fda4c4e3
Add a patch with some wip on the ethernet part of the e1000 sample
Louis Opter <louis@lse.epita.fr>
parents:
diff
changeset
|
8 device to store its private data structure within the context of the |
2cc8fda4c4e3
Add a patch with some wip on the ethernet part of the e1000 sample
Louis Opter <louis@lse.epita.fr>
parents:
diff
changeset
|
9 Ethernet subsystem. |
2cc8fda4c4e3
Add a patch with some wip on the ethernet part of the e1000 sample
Louis Opter <louis@lse.epita.fr>
parents:
diff
changeset
|
10 |
2cc8fda4c4e3
Add a patch with some wip on the ethernet part of the e1000 sample
Louis Opter <louis@lse.epita.fr>
parents:
diff
changeset
|
11 diff --git a/rathaxes/samples/e1000/e1000.blt b/rathaxes/samples/e1000/e1000.blt |
2cc8fda4c4e3
Add a patch with some wip on the ethernet part of the e1000 sample
Louis Opter <louis@lse.epita.fr>
parents:
diff
changeset
|
12 --- a/rathaxes/samples/e1000/e1000.blt |
2cc8fda4c4e3
Add a patch with some wip on the ethernet part of the e1000 sample
Louis Opter <louis@lse.epita.fr>
parents:
diff
changeset
|
13 +++ b/rathaxes/samples/e1000/e1000.blt |
98
147519512c3d
Commit before pulling Joa's changes
Louis Opter <louis@lse.epita.fr>
parents:
93
diff
changeset
|
14 @@ -284,7 +284,7 @@ |
147519512c3d
Commit before pulling Joa's changes
Louis Opter <louis@lse.epita.fr>
parents:
93
diff
changeset
|
15 }; |
147519512c3d
Commit before pulling Joa's changes
Louis Opter <louis@lse.epita.fr>
parents:
93
diff
changeset
|
16 } |
93
2cc8fda4c4e3
Add a patch with some wip on the ethernet part of the e1000 sample
Louis Opter <louis@lse.epita.fr>
parents:
diff
changeset
|
17 |
2cc8fda4c4e3
Add a patch with some wip on the ethernet part of the e1000 sample
Louis Opter <louis@lse.epita.fr>
parents:
diff
changeset
|
18 - chunk Ethernet::SubContext() |
2cc8fda4c4e3
Add a patch with some wip on the ethernet part of the e1000 sample
Louis Opter <louis@lse.epita.fr>
parents:
diff
changeset
|
19 + chunk Ethernet::HardwareContext() |
2cc8fda4c4e3
Add a patch with some wip on the ethernet part of the e1000 sample
Louis Opter <louis@lse.epita.fr>
parents:
diff
changeset
|
20 { |
2cc8fda4c4e3
Add a patch with some wip on the ethernet part of the e1000 sample
Louis Opter <louis@lse.epita.fr>
parents:
diff
changeset
|
21 /* |
2cc8fda4c4e3
Add a patch with some wip on the ethernet part of the e1000 sample
Louis Opter <louis@lse.epita.fr>
parents:
diff
changeset
|
22 * Force the generation of the structure in the "headers" part, we |
2cc8fda4c4e3
Add a patch with some wip on the ethernet part of the e1000 sample
Louis Opter <louis@lse.epita.fr>
parents:
diff
changeset
|
23 diff --git a/rathaxes/samples/e1000/e1000.rti b/rathaxes/samples/e1000/e1000.rti |
2cc8fda4c4e3
Add a patch with some wip on the ethernet part of the e1000 sample
Louis Opter <louis@lse.epita.fr>
parents:
diff
changeset
|
24 --- a/rathaxes/samples/e1000/e1000.rti |
2cc8fda4c4e3
Add a patch with some wip on the ethernet part of the e1000 sample
Louis Opter <louis@lse.epita.fr>
parents:
diff
changeset
|
25 +++ b/rathaxes/samples/e1000/e1000.rti |
98
147519512c3d
Commit before pulling Joa's changes
Louis Opter <louis@lse.epita.fr>
parents:
93
diff
changeset
|
26 @@ -9,7 +9,7 @@ |
147519512c3d
Commit before pulling Joa's changes
Louis Opter <louis@lse.epita.fr>
parents:
93
diff
changeset
|
27 { |
147519512c3d
Commit before pulling Joa's changes
Louis Opter <louis@lse.epita.fr>
parents:
93
diff
changeset
|
28 method decl(); |
93
2cc8fda4c4e3
Add a patch with some wip on the ethernet part of the e1000 sample
Louis Opter <louis@lse.epita.fr>
parents:
diff
changeset
|
29 |
2cc8fda4c4e3
Add a patch with some wip on the ethernet part of the e1000 sample
Louis Opter <louis@lse.epita.fr>
parents:
diff
changeset
|
30 - chunk Ethernet::SubContext(); |
2cc8fda4c4e3
Add a patch with some wip on the ethernet part of the e1000 sample
Louis Opter <louis@lse.epita.fr>
parents:
diff
changeset
|
31 + chunk Ethernet::HardwareContext(); |
98
147519512c3d
Commit before pulling Joa's changes
Louis Opter <louis@lse.epita.fr>
parents:
93
diff
changeset
|
32 |
147519512c3d
Commit before pulling Joa's changes
Louis Opter <louis@lse.epita.fr>
parents:
93
diff
changeset
|
33 /* Callbacks/Hooks which should probably be in the front-end: */ |
147519512c3d
Commit before pulling Joa's changes
Louis Opter <louis@lse.epita.fr>
parents:
93
diff
changeset
|
34 chunk Ethernet::adapter_init_context(Ethernet::Device, |
93
2cc8fda4c4e3
Add a patch with some wip on the ethernet part of the e1000 sample
Louis Opter <louis@lse.epita.fr>
parents:
diff
changeset
|
35 diff --git a/rathaxes/samples/e1000/ethernet.blt b/rathaxes/samples/e1000/ethernet.blt |
2cc8fda4c4e3
Add a patch with some wip on the ethernet part of the e1000 sample
Louis Opter <louis@lse.epita.fr>
parents:
diff
changeset
|
36 --- a/rathaxes/samples/e1000/ethernet.blt |
2cc8fda4c4e3
Add a patch with some wip on the ethernet part of the e1000 sample
Louis Opter <louis@lse.epita.fr>
parents:
diff
changeset
|
37 +++ b/rathaxes/samples/e1000/ethernet.blt |
2cc8fda4c4e3
Add a patch with some wip on the ethernet part of the e1000 sample
Louis Opter <louis@lse.epita.fr>
parents:
diff
changeset
|
38 @@ -59,7 +59,7 @@ |
2cc8fda4c4e3
Add a patch with some wip on the ethernet part of the e1000 sample
Louis Opter <louis@lse.epita.fr>
parents:
diff
changeset
|
39 |
2cc8fda4c4e3
Add a patch with some wip on the ethernet part of the e1000 sample
Louis Opter <louis@lse.epita.fr>
parents:
diff
changeset
|
40 chunk ::decl() |
2cc8fda4c4e3
Add a patch with some wip on the ethernet part of the e1000 sample
Louis Opter <louis@lse.epita.fr>
parents:
diff
changeset
|
41 { |
2cc8fda4c4e3
Add a patch with some wip on the ethernet part of the e1000 sample
Louis Opter <louis@lse.epita.fr>
parents:
diff
changeset
|
42 - typedef struct net_device *net_devp; |
2cc8fda4c4e3
Add a patch with some wip on the ethernet part of the e1000 sample
Louis Opter <louis@lse.epita.fr>
parents:
diff
changeset
|
43 + struct net_device; |
2cc8fda4c4e3
Add a patch with some wip on the ethernet part of the e1000 sample
Louis Opter <louis@lse.epita.fr>
parents:
diff
changeset
|
44 } |
2cc8fda4c4e3
Add a patch with some wip on the ethernet part of the e1000 sample
Louis Opter <louis@lse.epita.fr>
parents:
diff
changeset
|
45 |
2cc8fda4c4e3
Add a patch with some wip on the ethernet part of the e1000 sample
Louis Opter <louis@lse.epita.fr>
parents:
diff
changeset
|
46 map |
2cc8fda4c4e3
Add a patch with some wip on the ethernet part of the e1000 sample
Louis Opter <louis@lse.epita.fr>
parents:
diff
changeset
|
47 @@ -76,14 +76,7 @@ |
2cc8fda4c4e3
Add a patch with some wip on the ethernet part of the e1000 sample
Louis Opter <louis@lse.epita.fr>
parents:
diff
changeset
|
48 |
2cc8fda4c4e3
Add a patch with some wip on the ethernet part of the e1000 sample
Louis Opter <louis@lse.epita.fr>
parents:
diff
changeset
|
49 chunk ::decl() |
2cc8fda4c4e3
Add a patch with some wip on the ethernet part of the e1000 sample
Louis Opter <louis@lse.epita.fr>
parents:
diff
changeset
|
50 { |
2cc8fda4c4e3
Add a patch with some wip on the ethernet part of the e1000 sample
Louis Opter <louis@lse.epita.fr>
parents:
diff
changeset
|
51 - /* |
2cc8fda4c4e3
Add a patch with some wip on the ethernet part of the e1000 sample
Louis Opter <louis@lse.epita.fr>
parents:
diff
changeset
|
52 - * So, at first sight, it sucks to typedef it as pointer but (for |
2cc8fda4c4e3
Add a patch with some wip on the ethernet part of the e1000 sample
Louis Opter <louis@lse.epita.fr>
parents:
diff
changeset
|
53 - * now) it makes sense for two reasons: |
2cc8fda4c4e3
Add a patch with some wip on the ethernet part of the e1000 sample
Louis Opter <louis@lse.epita.fr>
parents:
diff
changeset
|
54 - * - This structure will always be used through a pointer; |
2cc8fda4c4e3
Add a patch with some wip on the ethernet part of the e1000 sample
Louis Opter <louis@lse.epita.fr>
parents:
diff
changeset
|
55 - * - This remove the ambiguity of pointer/not-pointer in the |
2cc8fda4c4e3
Add a patch with some wip on the ethernet part of the e1000 sample
Louis Opter <louis@lse.epita.fr>
parents:
diff
changeset
|
56 - * ::init() chunk. |
2cc8fda4c4e3
Add a patch with some wip on the ethernet part of the e1000 sample
Louis Opter <louis@lse.epita.fr>
parents:
diff
changeset
|
57 - */ |
2cc8fda4c4e3
Add a patch with some wip on the ethernet part of the e1000 sample
Louis Opter <louis@lse.epita.fr>
parents:
diff
changeset
|
58 - typedef struct rtx_ethernet_dev |
2cc8fda4c4e3
Add a patch with some wip on the ethernet part of the e1000 sample
Louis Opter <louis@lse.epita.fr>
parents:
diff
changeset
|
59 + struct rtx_ethernet_dev |
2cc8fda4c4e3
Add a patch with some wip on the ethernet part of the e1000 sample
Louis Opter <louis@lse.epita.fr>
parents:
diff
changeset
|
60 { |
2cc8fda4c4e3
Add a patch with some wip on the ethernet part of the e1000 sample
Louis Opter <louis@lse.epita.fr>
parents:
diff
changeset
|
61 /* |
98
147519512c3d
Commit before pulling Joa's changes
Louis Opter <louis@lse.epita.fr>
parents:
93
diff
changeset
|
62 * I think it's useless to use the ${PCI::AbstractDevice} "abstraction" |
93
2cc8fda4c4e3
Add a patch with some wip on the ethernet part of the e1000 sample
Louis Opter <louis@lse.epita.fr>
parents:
diff
changeset
|
63 @@ -96,8 +89,8 @@ |
2cc8fda4c4e3
Add a patch with some wip on the ethernet part of the e1000 sample
Louis Opter <louis@lse.epita.fr>
parents:
diff
changeset
|
64 * In the long-term, this may disappear for a new concept allowing |
2cc8fda4c4e3
Add a patch with some wip on the ethernet part of the e1000 sample
Louis Opter <louis@lse.epita.fr>
parents:
diff
changeset
|
65 * to embbed a descriptor defined and manipulated by the front-end |
2cc8fda4c4e3
Add a patch with some wip on the ethernet part of the e1000 sample
Louis Opter <louis@lse.epita.fr>
parents:
diff
changeset
|
66 */ |
2cc8fda4c4e3
Add a patch with some wip on the ethernet part of the e1000 sample
Louis Opter <louis@lse.epita.fr>
parents:
diff
changeset
|
67 - ${pointcut Ethernet::SubContext()}; |
2cc8fda4c4e3
Add a patch with some wip on the ethernet part of the e1000 sample
Louis Opter <louis@lse.epita.fr>
parents:
diff
changeset
|
68 - } *rtx_ethernet_dev_p; |
2cc8fda4c4e3
Add a patch with some wip on the ethernet part of the e1000 sample
Louis Opter <louis@lse.epita.fr>
parents:
diff
changeset
|
69 + ${pointcut Ethernet::HardwareContext()}; |
2cc8fda4c4e3
Add a patch with some wip on the ethernet part of the e1000 sample
Louis Opter <louis@lse.epita.fr>
parents:
diff
changeset
|
70 + }; |
2cc8fda4c4e3
Add a patch with some wip on the ethernet part of the e1000 sample
Louis Opter <louis@lse.epita.fr>
parents:
diff
changeset
|
71 } |
2cc8fda4c4e3
Add a patch with some wip on the ethernet part of the e1000 sample
Louis Opter <louis@lse.epita.fr>
parents:
diff
changeset
|
72 |
98
147519512c3d
Commit before pulling Joa's changes
Louis Opter <louis@lse.epita.fr>
parents:
93
diff
changeset
|
73 chunk ::init(Ethernet::AbstractDevice net_dev, PCI::AbstractDevice pci_dev) |
93
2cc8fda4c4e3
Add a patch with some wip on the ethernet part of the e1000 sample
Louis Opter <louis@lse.epita.fr>
parents:
diff
changeset
|
74 @@ -105,7 +98,7 @@ |
2cc8fda4c4e3
Add a patch with some wip on the ethernet part of the e1000 sample
Louis Opter <louis@lse.epita.fr>
parents:
diff
changeset
|
75 ${self} = netdev_priv(${net_dev}); |
2cc8fda4c4e3
Add a patch with some wip on the ethernet part of the e1000 sample
Louis Opter <louis@lse.epita.fr>
parents:
diff
changeset
|
76 /* |
2cc8fda4c4e3
Add a patch with some wip on the ethernet part of the e1000 sample
Louis Opter <louis@lse.epita.fr>
parents:
diff
changeset
|
77 * We can use -> because we know that ${self} will be always a |
2cc8fda4c4e3
Add a patch with some wip on the ethernet part of the e1000 sample
Louis Opter <louis@lse.epita.fr>
parents:
diff
changeset
|
78 - * pointer ("thanks" to the typedef) |
2cc8fda4c4e3
Add a patch with some wip on the ethernet part of the e1000 sample
Louis Opter <louis@lse.epita.fr>
parents:
diff
changeset
|
79 + * pointer, but the ambiguity sucks. |
2cc8fda4c4e3
Add a patch with some wip on the ethernet part of the e1000 sample
Louis Opter <louis@lse.epita.fr>
parents:
diff
changeset
|
80 */ |
2cc8fda4c4e3
Add a patch with some wip on the ethernet part of the e1000 sample
Louis Opter <louis@lse.epita.fr>
parents:
diff
changeset
|
81 ${self}->pci_dev = ${pci_dev}; |
2cc8fda4c4e3
Add a patch with some wip on the ethernet part of the e1000 sample
Louis Opter <louis@lse.epita.fr>
parents:
diff
changeset
|
82 ${self}->net_dev = ${net_dev}; |
98
147519512c3d
Commit before pulling Joa's changes
Louis Opter <louis@lse.epita.fr>
parents:
93
diff
changeset
|
83 @@ -129,8 +122,9 @@ |
147519512c3d
Commit before pulling Joa's changes
Louis Opter <louis@lse.epita.fr>
parents:
93
diff
changeset
|
84 { |
147519512c3d
Commit before pulling Joa's changes
Louis Opter <louis@lse.epita.fr>
parents:
93
diff
changeset
|
85 static int rtx_ethernet_open(struct net_device *dev) |
147519512c3d
Commit before pulling Joa's changes
Louis Opter <louis@lse.epita.fr>
parents:
93
diff
changeset
|
86 { |
147519512c3d
Commit before pulling Joa's changes
Louis Opter <louis@lse.epita.fr>
parents:
93
diff
changeset
|
87 - ${Ethernet::Device} rtx_ether_dev = netdev_priv(dev); |
147519512c3d
Commit before pulling Joa's changes
Louis Opter <louis@lse.epita.fr>
parents:
93
diff
changeset
|
88 + ${Ethernet::Device} *rtx_ether_dev = netdev_priv(dev); |
147519512c3d
Commit before pulling Joa's changes
Louis Opter <louis@lse.epita.fr>
parents:
93
diff
changeset
|
89 |
147519512c3d
Commit before pulling Joa's changes
Louis Opter <louis@lse.epita.fr>
parents:
93
diff
changeset
|
90 + ${cast local.rtx_ether_dev as Ethernet::Device}; |
147519512c3d
Commit before pulling Joa's changes
Louis Opter <louis@lse.epita.fr>
parents:
93
diff
changeset
|
91 ${pointcut ::IMPLEMENTATION(local.rtx_ether_dev)}; |
147519512c3d
Commit before pulling Joa's changes
Louis Opter <louis@lse.epita.fr>
parents:
93
diff
changeset
|
92 |
147519512c3d
Commit before pulling Joa's changes
Louis Opter <louis@lse.epita.fr>
parents:
93
diff
changeset
|
93 return 0; |
147519512c3d
Commit before pulling Joa's changes
Louis Opter <louis@lse.epita.fr>
parents:
93
diff
changeset
|
94 @@ -149,8 +143,10 @@ |
147519512c3d
Commit before pulling Joa's changes
Louis Opter <louis@lse.epita.fr>
parents:
93
diff
changeset
|
95 { |
147519512c3d
Commit before pulling Joa's changes
Louis Opter <louis@lse.epita.fr>
parents:
93
diff
changeset
|
96 static int rtx_ethernet_xmit(struct sk_buff* kernel_skb, struct net_device *net_dev) |
147519512c3d
Commit before pulling Joa's changes
Louis Opter <louis@lse.epita.fr>
parents:
93
diff
changeset
|
97 { |
147519512c3d
Commit before pulling Joa's changes
Louis Opter <louis@lse.epita.fr>
parents:
93
diff
changeset
|
98 - ${Ethernet::Device} rtx_ethernet_dev = netdev_priv(net_dev); |
147519512c3d
Commit before pulling Joa's changes
Louis Opter <louis@lse.epita.fr>
parents:
93
diff
changeset
|
99 + ${Ethernet::Device} *rtx_ethernet_dev = netdev_priv(net_dev); |
147519512c3d
Commit before pulling Joa's changes
Louis Opter <louis@lse.epita.fr>
parents:
93
diff
changeset
|
100 ${cast local.kernel_skb as Socket::AbstractSKBuff}; |
147519512c3d
Commit before pulling Joa's changes
Louis Opter <louis@lse.epita.fr>
parents:
93
diff
changeset
|
101 + |
147519512c3d
Commit before pulling Joa's changes
Louis Opter <louis@lse.epita.fr>
parents:
93
diff
changeset
|
102 + ${cast local.rtx_ethernet_dev as Ethernet::Device}; |
147519512c3d
Commit before pulling Joa's changes
Louis Opter <louis@lse.epita.fr>
parents:
93
diff
changeset
|
103 ${pointcut ::IMPLEMENTATION(local.rtx_ethernet_dev, local.kernel_skb)}; |
147519512c3d
Commit before pulling Joa's changes
Louis Opter <louis@lse.epita.fr>
parents:
93
diff
changeset
|
104 } |
147519512c3d
Commit before pulling Joa's changes
Louis Opter <louis@lse.epita.fr>
parents:
93
diff
changeset
|
105 } |
147519512c3d
Commit before pulling Joa's changes
Louis Opter <louis@lse.epita.fr>
parents:
93
diff
changeset
|
106 @@ -167,8 +163,9 @@ |
147519512c3d
Commit before pulling Joa's changes
Louis Opter <louis@lse.epita.fr>
parents:
93
diff
changeset
|
107 { |
147519512c3d
Commit before pulling Joa's changes
Louis Opter <louis@lse.epita.fr>
parents:
93
diff
changeset
|
108 static int rtx_ethernet_close(struct net_device *dev) |
147519512c3d
Commit before pulling Joa's changes
Louis Opter <louis@lse.epita.fr>
parents:
93
diff
changeset
|
109 { |
147519512c3d
Commit before pulling Joa's changes
Louis Opter <louis@lse.epita.fr>
parents:
93
diff
changeset
|
110 - ${Ethernet::Device} rtx_ether_dev = netdev_priv(dev); |
147519512c3d
Commit before pulling Joa's changes
Louis Opter <louis@lse.epita.fr>
parents:
93
diff
changeset
|
111 + ${Ethernet::Device} *rtx_ether_dev = netdev_priv(dev); |
147519512c3d
Commit before pulling Joa's changes
Louis Opter <louis@lse.epita.fr>
parents:
93
diff
changeset
|
112 |
147519512c3d
Commit before pulling Joa's changes
Louis Opter <louis@lse.epita.fr>
parents:
93
diff
changeset
|
113 + ${cast local.rtx_ether_dev as Ethernet::Device}; |
147519512c3d
Commit before pulling Joa's changes
Louis Opter <louis@lse.epita.fr>
parents:
93
diff
changeset
|
114 ${pointcut ::IMPLEMENTATION(local.rtx_ether_dev)}; |
147519512c3d
Commit before pulling Joa's changes
Louis Opter <louis@lse.epita.fr>
parents:
93
diff
changeset
|
115 |
147519512c3d
Commit before pulling Joa's changes
Louis Opter <louis@lse.epita.fr>
parents:
93
diff
changeset
|
116 return 0; |
147519512c3d
Commit before pulling Joa's changes
Louis Opter <louis@lse.epita.fr>
parents:
93
diff
changeset
|
117 @@ -191,8 +188,9 @@ |
93
2cc8fda4c4e3
Add a patch with some wip on the ethernet part of the e1000 sample
Louis Opter <louis@lse.epita.fr>
parents:
diff
changeset
|
118 { |
98
147519512c3d
Commit before pulling Joa's changes
Louis Opter <louis@lse.epita.fr>
parents:
93
diff
changeset
|
119 static enum irqreturn rtx_ethernet_interrupt_handler(int irq, void *dev_id) |
147519512c3d
Commit before pulling Joa's changes
Louis Opter <louis@lse.epita.fr>
parents:
93
diff
changeset
|
120 { |
147519512c3d
Commit before pulling Joa's changes
Louis Opter <louis@lse.epita.fr>
parents:
93
diff
changeset
|
121 - ${Ethernet::Device} rtx_ether_dev = dev_id; |
147519512c3d
Commit before pulling Joa's changes
Louis Opter <louis@lse.epita.fr>
parents:
93
diff
changeset
|
122 + ${Ethernet::Device} *rtx_ether_dev = dev_id; |
147519512c3d
Commit before pulling Joa's changes
Louis Opter <louis@lse.epita.fr>
parents:
93
diff
changeset
|
123 |
147519512c3d
Commit before pulling Joa's changes
Louis Opter <louis@lse.epita.fr>
parents:
93
diff
changeset
|
124 + ${cast local.rtx_ether_dev as Ethernet::Device}; |
147519512c3d
Commit before pulling Joa's changes
Louis Opter <louis@lse.epita.fr>
parents:
93
diff
changeset
|
125 ${pointcut ::IMPLEMENTATION(local.rtx_ether_dev)}; |
147519512c3d
Commit before pulling Joa's changes
Louis Opter <louis@lse.epita.fr>
parents:
93
diff
changeset
|
126 |
147519512c3d
Commit before pulling Joa's changes
Louis Opter <louis@lse.epita.fr>
parents:
93
diff
changeset
|
127 return IRQ_NONE; |
147519512c3d
Commit before pulling Joa's changes
Louis Opter <louis@lse.epita.fr>
parents:
93
diff
changeset
|
128 @@ -222,8 +220,8 @@ |
147519512c3d
Commit before pulling Joa's changes
Louis Opter <louis@lse.epita.fr>
parents:
93
diff
changeset
|
129 */ |
147519512c3d
Commit before pulling Joa's changes
Louis Opter <louis@lse.epita.fr>
parents:
93
diff
changeset
|
130 chunk PCI::pci_probe_hook(PCI::Device rtx_pci_dev) |
147519512c3d
Commit before pulling Joa's changes
Louis Opter <louis@lse.epita.fr>
parents:
93
diff
changeset
|
131 { |
147519512c3d
Commit before pulling Joa's changes
Louis Opter <louis@lse.epita.fr>
parents:
93
diff
changeset
|
132 - ${Ethernet::Device} rtx_ether_ctx; |
147519512c3d
Commit before pulling Joa's changes
Louis Opter <louis@lse.epita.fr>
parents:
93
diff
changeset
|
133 - ${Ethernet::AbstractDevice} net_dev; |
147519512c3d
Commit before pulling Joa's changes
Louis Opter <louis@lse.epita.fr>
parents:
93
diff
changeset
|
134 + ${Ethernet::Device} *rtx_ether_ctx; |
147519512c3d
Commit before pulling Joa's changes
Louis Opter <louis@lse.epita.fr>
parents:
93
diff
changeset
|
135 + ${Ethernet::AbstractDevice} *net_dev; |
93
2cc8fda4c4e3
Add a patch with some wip on the ethernet part of the e1000 sample
Louis Opter <louis@lse.epita.fr>
parents:
diff
changeset
|
136 |
98
147519512c3d
Commit before pulling Joa's changes
Louis Opter <louis@lse.epita.fr>
parents:
93
diff
changeset
|
137 net_dev = alloc_etherdev(sizeof(*rtx_ether_ctx)); |
147519512c3d
Commit before pulling Joa's changes
Louis Opter <louis@lse.epita.fr>
parents:
93
diff
changeset
|
138 if (!net_dev) |
147519512c3d
Commit before pulling Joa's changes
Louis Opter <louis@lse.epita.fr>
parents:
93
diff
changeset
|
139 @@ -272,6 +270,7 @@ |
147519512c3d
Commit before pulling Joa's changes
Louis Opter <louis@lse.epita.fr>
parents:
93
diff
changeset
|
140 int irq = ${rtx_pci_dev.irq}; |
147519512c3d
Commit before pulling Joa's changes
Louis Opter <louis@lse.epita.fr>
parents:
93
diff
changeset
|
141 ${cast local.bars as Builtin::number}; |
147519512c3d
Commit before pulling Joa's changes
Louis Opter <louis@lse.epita.fr>
parents:
93
diff
changeset
|
142 ${cast local.irq as Builtin::number}; |
147519512c3d
Commit before pulling Joa's changes
Louis Opter <louis@lse.epita.fr>
parents:
93
diff
changeset
|
143 + ${cast local.rtx_ether_ctx as Ethernet::Device}; |
147519512c3d
Commit before pulling Joa's changes
Louis Opter <louis@lse.epita.fr>
parents:
93
diff
changeset
|
144 ${pointcut Ethernet::adapter_init_context(local.rtx_ether_ctx, |
147519512c3d
Commit before pulling Joa's changes
Louis Opter <louis@lse.epita.fr>
parents:
93
diff
changeset
|
145 local.bars, |
147519512c3d
Commit before pulling Joa's changes
Louis Opter <louis@lse.epita.fr>
parents:
93
diff
changeset
|
146 local.ioaddr, |
147519512c3d
Commit before pulling Joa's changes
Louis Opter <louis@lse.epita.fr>
parents:
93
diff
changeset
|
147 @@ -294,10 +293,11 @@ |
147519512c3d
Commit before pulling Joa's changes
Louis Opter <louis@lse.epita.fr>
parents:
93
diff
changeset
|
148 */ |
147519512c3d
Commit before pulling Joa's changes
Louis Opter <louis@lse.epita.fr>
parents:
93
diff
changeset
|
149 chunk PCI::pci_remove_hook(PCI::Device rtx_pci_dev) |
93
2cc8fda4c4e3
Add a patch with some wip on the ethernet part of the e1000 sample
Louis Opter <louis@lse.epita.fr>
parents:
diff
changeset
|
150 { |
98
147519512c3d
Commit before pulling Joa's changes
Louis Opter <louis@lse.epita.fr>
parents:
93
diff
changeset
|
151 - ${Ethernet::Device} rtx_ether_ctx = ${rtx_pci_dev.context}; |
147519512c3d
Commit before pulling Joa's changes
Louis Opter <louis@lse.epita.fr>
parents:
93
diff
changeset
|
152 + ${Ethernet::Device} *rtx_ether_ctx = ${rtx_pci_dev.context}; |
147519512c3d
Commit before pulling Joa's changes
Louis Opter <louis@lse.epita.fr>
parents:
93
diff
changeset
|
153 |
147519512c3d
Commit before pulling Joa's changes
Louis Opter <louis@lse.epita.fr>
parents:
93
diff
changeset
|
154 BUG_ON(!rtx_ether_ctx); |
93
2cc8fda4c4e3
Add a patch with some wip on the ethernet part of the e1000 sample
Louis Opter <louis@lse.epita.fr>
parents:
diff
changeset
|
155 |
98
147519512c3d
Commit before pulling Joa's changes
Louis Opter <louis@lse.epita.fr>
parents:
93
diff
changeset
|
156 + ${cast local.rtx_ether_ctx as Ethernet::Device}; |
147519512c3d
Commit before pulling Joa's changes
Louis Opter <louis@lse.epita.fr>
parents:
93
diff
changeset
|
157 unregister_netdev(${local.rtx_ether_ctx.net_device}); |
147519512c3d
Commit before pulling Joa's changes
Louis Opter <louis@lse.epita.fr>
parents:
93
diff
changeset
|
158 free_netdev(${local.rtx_ether_ctx.net_device}); |
147519512c3d
Commit before pulling Joa's changes
Louis Opter <louis@lse.epita.fr>
parents:
93
diff
changeset
|
159 } |
93
2cc8fda4c4e3
Add a patch with some wip on the ethernet part of the e1000 sample
Louis Opter <louis@lse.epita.fr>
parents:
diff
changeset
|
160 diff --git a/rathaxes/samples/e1000/ethernet.rti b/rathaxes/samples/e1000/ethernet.rti |
2cc8fda4c4e3
Add a patch with some wip on the ethernet part of the e1000 sample
Louis Opter <louis@lse.epita.fr>
parents:
diff
changeset
|
161 --- a/rathaxes/samples/e1000/ethernet.rti |
2cc8fda4c4e3
Add a patch with some wip on the ethernet part of the e1000 sample
Louis Opter <louis@lse.epita.fr>
parents:
diff
changeset
|
162 +++ b/rathaxes/samples/e1000/ethernet.rti |
98
147519512c3d
Commit before pulling Joa's changes
Louis Opter <louis@lse.epita.fr>
parents:
93
diff
changeset
|
163 @@ -22,7 +22,7 @@ |
93
2cc8fda4c4e3
Add a patch with some wip on the ethernet part of the e1000 sample
Louis Opter <louis@lse.epita.fr>
parents:
diff
changeset
|
164 chunk LKM::includes(); |
2cc8fda4c4e3
Add a patch with some wip on the ethernet part of the e1000 sample
Louis Opter <louis@lse.epita.fr>
parents:
diff
changeset
|
165 method decl(); |
98
147519512c3d
Commit before pulling Joa's changes
Louis Opter <louis@lse.epita.fr>
parents:
93
diff
changeset
|
166 method init(Ethernet::AbstractDevice, PCI::AbstractDevice); |
93
2cc8fda4c4e3
Add a patch with some wip on the ethernet part of the e1000 sample
Louis Opter <louis@lse.epita.fr>
parents:
diff
changeset
|
167 - pointcut Ethernet::SubContext(); |
2cc8fda4c4e3
Add a patch with some wip on the ethernet part of the e1000 sample
Louis Opter <louis@lse.epita.fr>
parents:
diff
changeset
|
168 + pointcut Ethernet::HardwareContext(); |
2cc8fda4c4e3
Add a patch with some wip on the ethernet part of the e1000 sample
Louis Opter <louis@lse.epita.fr>
parents:
diff
changeset
|
169 |
98
147519512c3d
Commit before pulling Joa's changes
Louis Opter <louis@lse.epita.fr>
parents:
93
diff
changeset
|
170 attribute PCI::AbstractDevice pci_device; |
147519512c3d
Commit before pulling Joa's changes
Louis Opter <louis@lse.epita.fr>
parents:
93
diff
changeset
|
171 attribute Ethernet::AbstractDevice net_device; |