Mercurial > archived > louis > epitech > mq > rathaxes
annotate e1000_implement_the_frame_transmission_chunk.patch @ 85:5dda73e7d728
Add my WIP on the actual tx
author | Louis Opter <louis@lse.epitech.net> |
---|---|
date | Fri, 14 Sep 2012 08:58:35 +0200 |
parents | 6432998a8245 |
children | c99e69966dd3 |
rev | line source |
---|---|
83
27f0e70df342
Wip on the transmission, tx init done, and tx hooked from Ethernet send
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
1 # HG changeset patch |
85
5dda73e7d728
Add my WIP on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
84
diff
changeset
|
2 # Parent 41aa481c1ba8a54a7291ac2630f2eebc50022f33 |
83
27f0e70df342
Wip on the transmission, tx init done, and tx hooked from Ethernet send
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
3 rathaxes: start to queue up packets in the TX ring on the e1000 sample |
27f0e70df342
Wip on the transmission, tx init done, and tx hooked from Ethernet send
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
4 |
84
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
5 diff --git a/maintainers/CMakeScripts/Templates/MakefileLKM.in b/maintainers/CMakeScripts/Templates/MakefileLKM.in |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
6 --- a/maintainers/CMakeScripts/Templates/MakefileLKM.in |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
7 +++ b/maintainers/CMakeScripts/Templates/MakefileLKM.in |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
8 @@ -1,6 +1,6 @@ |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
9 # Disable this "coding-style" warning (seriously, you have to compile with |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
10 # -pedantic to get it...) |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
11 -EXTRA_CFLAGS = -Wno-declaration-after-statement |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
12 +EXTRA_CFLAGS = -Wno-declaration-after-statement -std=gnu99 |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
13 |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
14 KDIR = /lib/modules/$(shell uname -r)/build |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
15 obj-m := @LKM_OBJECTS@ |
83
27f0e70df342
Wip on the transmission, tx init done, and tx hooked from Ethernet send
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
16 diff --git a/rathaxes/samples/e1000/e1000.blt b/rathaxes/samples/e1000/e1000.blt |
27f0e70df342
Wip on the transmission, tx init done, and tx hooked from Ethernet send
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
17 --- a/rathaxes/samples/e1000/e1000.blt |
27f0e70df342
Wip on the transmission, tx init done, and tx hooked from Ethernet send
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
18 +++ b/rathaxes/samples/e1000/e1000.blt |
85
5dda73e7d728
Add my WIP on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
84
diff
changeset
|
19 @@ -964,4 +964,52 @@ |
83
27f0e70df342
Wip on the transmission, tx init done, and tx hooked from Ethernet send
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
20 } |
27f0e70df342
Wip on the transmission, tx init done, and tx hooked from Ethernet send
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
21 } |
27f0e70df342
Wip on the transmission, tx init done, and tx hooked from Ethernet send
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
22 } |
27f0e70df342
Wip on the transmission, tx init done, and tx hooked from Ethernet send
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
23 + |
27f0e70df342
Wip on the transmission, tx init done, and tx hooked from Ethernet send
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
24 + template sequence e1000::xmit(Ethernet::Device ctx, Socket::SKBuff skb) |
27f0e70df342
Wip on the transmission, tx init done, and tx hooked from Ethernet send
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
25 + { |
27f0e70df342
Wip on the transmission, tx init done, and tx hooked from Ethernet send
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
26 + chunk ::CALL() |
27f0e70df342
Wip on the transmission, tx init done, and tx hooked from Ethernet send
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
27 + { |
85
5dda73e7d728
Add my WIP on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
84
diff
changeset
|
28 + typedef unsigned long int dma_addr_t; |
5dda73e7d728
Add my WIP on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
84
diff
changeset
|
29 + |
84
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
30 + (void)1; // Issue 10 |
83
27f0e70df342
Wip on the transmission, tx init done, and tx hooked from Ethernet send
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
31 + /* |
27f0e70df342
Wip on the transmission, tx init done, and tx hooked from Ethernet send
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
32 + * Put packets on the TX ring, must return NETDEV_TX_OK or |
27f0e70df342
Wip on the transmission, tx init done, and tx hooked from Ethernet send
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
33 + * NETDEV_TX_BUSY. |
27f0e70df342
Wip on the transmission, tx init done, and tx hooked from Ethernet send
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
34 + */ |
27f0e70df342
Wip on the transmission, tx init done, and tx hooked from Ethernet send
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
35 + { |
27f0e70df342
Wip on the transmission, tx init done, and tx hooked from Ethernet send
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
36 + ${Log::info("xmit: skbuff details:")}; |
84
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
37 + ${skb.dump_infos()}; |
83
27f0e70df342
Wip on the transmission, tx init done, and tx hooked from Ethernet send
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
38 + } |
85
5dda73e7d728
Add my WIP on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
84
diff
changeset
|
39 + |
5dda73e7d728
Add my WIP on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
84
diff
changeset
|
40 + /* |
5dda73e7d728
Add my WIP on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
84
diff
changeset
|
41 + * The transmission is going to be several steps: |
5dda73e7d728
Add my WIP on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
84
diff
changeset
|
42 + * - TCP Segmentation Offload & Checksum Offloading: pick a |
5dda73e7d728
Add my WIP on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
84
diff
changeset
|
43 + * descriptor from the tx ring and fill it as a context descriptor |
5dda73e7d728
Add my WIP on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
84
diff
changeset
|
44 + * to allow the card to slice into several packets according to |
5dda73e7d728
Add my WIP on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
84
diff
changeset
|
45 + * the MSS; |
5dda73e7d728
Add my WIP on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
84
diff
changeset
|
46 + * - DMA Map the skbuff data as slices of 4096; |
5dda73e7d728
Add my WIP on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
84
diff
changeset
|
47 + * - Signal the hardware that data is available via a tx desc. |
5dda73e7d728
Add my WIP on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
84
diff
changeset
|
48 + */ |
5dda73e7d728
Add my WIP on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
84
diff
changeset
|
49 + |
5dda73e7d728
Add my WIP on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
84
diff
changeset
|
50 + if (skb_is_gso(${skb}) || ${skb}->ip_summed == CHECKSUM_PARTIAL) |
5dda73e7d728
Add my WIP on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
84
diff
changeset
|
51 + { |
5dda73e7d728
Add my WIP on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
84
diff
changeset
|
52 + ${Log::info("xmit: the packet needs to be fragmented and/or checksummed but this not implemented yet!")}; |
5dda73e7d728
Add my WIP on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
84
diff
changeset
|
53 + return NETDEV_TX_OK; |
5dda73e7d728
Add my WIP on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
84
diff
changeset
|
54 + } |
5dda73e7d728
Add my WIP on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
84
diff
changeset
|
55 + |
5dda73e7d728
Add my WIP on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
84
diff
changeset
|
56 + /* XXX ${ctx} expands into skb */ |
5dda73e7d728
Add my WIP on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
84
diff
changeset
|
57 + dma_addr_t buff_addr = dma_map_single( |
5dda73e7d728
Add my WIP on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
84
diff
changeset
|
58 + &${ctx}->pci_dev->dev, |
5dda73e7d728
Add my WIP on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
84
diff
changeset
|
59 + ${skb}->data, |
5dda73e7d728
Add my WIP on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
84
diff
changeset
|
60 + skb_headlen(${skb}), |
5dda73e7d728
Add my WIP on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
84
diff
changeset
|
61 + DMA_TO_DEVICE); |
5dda73e7d728
Add my WIP on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
84
diff
changeset
|
62 + if (dma_mapping_error(&${ctx}->pci_dev->dev, buff_addr)) |
5dda73e7d728
Add my WIP on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
84
diff
changeset
|
63 + { |
5dda73e7d728
Add my WIP on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
84
diff
changeset
|
64 + ${Log::info("xmit: can't DMA map a SKBuff")}; |
5dda73e7d728
Add my WIP on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
84
diff
changeset
|
65 + /* now what, should I free the skb? */ |
5dda73e7d728
Add my WIP on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
84
diff
changeset
|
66 + } |
5dda73e7d728
Add my WIP on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
84
diff
changeset
|
67 + |
5dda73e7d728
Add my WIP on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
84
diff
changeset
|
68 + return NETDEV_TX_OK; |
83
27f0e70df342
Wip on the transmission, tx init done, and tx hooked from Ethernet send
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
69 + } |
27f0e70df342
Wip on the transmission, tx init done, and tx hooked from Ethernet send
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
70 + } |
27f0e70df342
Wip on the transmission, tx init done, and tx hooked from Ethernet send
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
71 } |
27f0e70df342
Wip on the transmission, tx init done, and tx hooked from Ethernet send
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
72 diff --git a/rathaxes/samples/e1000/e1000.rti b/rathaxes/samples/e1000/e1000.rti |
27f0e70df342
Wip on the transmission, tx init done, and tx hooked from Ethernet send
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
73 --- a/rathaxes/samples/e1000/e1000.rti |
27f0e70df342
Wip on the transmission, tx init done, and tx hooked from Ethernet send
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
74 +++ b/rathaxes/samples/e1000/e1000.rti |
84
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
75 @@ -109,6 +109,11 @@ |
83
27f0e70df342
Wip on the transmission, tx init done, and tx hooked from Ethernet send
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
76 provided chunk ::CALL(); |
27f0e70df342
Wip on the transmission, tx init done, and tx hooked from Ethernet send
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
77 } |
27f0e70df342
Wip on the transmission, tx init done, and tx hooked from Ethernet send
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
78 |
84
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
79 + provided sequence xmit(Ethernet::Device, Socket::SKBuff) |
83
27f0e70df342
Wip on the transmission, tx init done, and tx hooked from Ethernet send
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
80 + { |
27f0e70df342
Wip on the transmission, tx init done, and tx hooked from Ethernet send
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
81 + provided chunk ::CALL(); |
27f0e70df342
Wip on the transmission, tx init done, and tx hooked from Ethernet send
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
82 + } |
27f0e70df342
Wip on the transmission, tx init done, and tx hooked from Ethernet send
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
83 + |
84
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
84 provided sequence register_read32(e1000::Context, e1000::Register) |
83
27f0e70df342
Wip on the transmission, tx init done, and tx hooked from Ethernet send
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
85 { |
27f0e70df342
Wip on the transmission, tx init done, and tx hooked from Ethernet send
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
86 provided chunk LKM::prototypes(); |
84
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
87 diff --git a/rathaxes/samples/e1000/ethernet.blt b/rathaxes/samples/e1000/ethernet.blt |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
88 --- a/rathaxes/samples/e1000/ethernet.blt |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
89 +++ b/rathaxes/samples/e1000/ethernet.blt |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
90 @@ -1,6 +1,51 @@ |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
91 with Ethernet, PCI, LKM, Log |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
92 { |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
93 - template type Ethernet::Net() |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
94 + template type Ethernet::ProtocolId() |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
95 + { |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
96 + chunk LKM::prototypes() |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
97 + { |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
98 + static const char *rtx_ethernet_protocol_id_to_str(unsigned short); |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
99 + } |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
100 + |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
101 + chunk LKM::data() |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
102 + { |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
103 + static const struct |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
104 + { |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
105 + const unsigned short id; |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
106 + const char *name; |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
107 + } rtx_ethernet_proto_table[] = |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
108 + { |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
109 + { ETH_P_IP, "IPv4" }, |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
110 + { ETH_P_IPV6, "IPv6" }, |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
111 + { ETH_P_ARP, "ARP" }, |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
112 + }; |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
113 + } |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
114 + |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
115 + chunk LKM::code() |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
116 + { |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
117 + static const char *rtx_ethernet_protocol_id_to_str(unsigned short proto_id) |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
118 + { |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
119 + for (int i = 0; |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
120 + i != sizeof(rtx_ethernet_proto_table[0]) / sizeof(rtx_ethernet_proto_table); |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
121 + i++) |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
122 + if (proto_id == rtx_ethernet_proto_table[i].id) |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
123 + return rtx_ethernet_proto_table[i].name; |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
124 + |
85
5dda73e7d728
Add my WIP on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
84
diff
changeset
|
125 + return "Unknown"; |
84
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
126 + } |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
127 + } |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
128 + |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
129 + chunk to_str() |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
130 + { |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
131 + rtx_ethernet_protocol_id_to_str(${self}); |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
132 + } |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
133 + |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
134 + map |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
135 + { |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
136 + } |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
137 + } |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
138 + |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
139 + template type Ethernet::AbstractDevice() |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
140 { |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
141 chunk LKM::includes() |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
142 { |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
143 @@ -17,11 +62,6 @@ |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
144 } |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
145 } |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
146 |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
147 - /* |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
148 - * Unlike PCI::Device, Ethernet::Device doesn't match the struct net_device |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
149 - * from Linux. Ethernet::Device is the type that we use in the private |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
150 - * field of the struct net_device. |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
151 - */ |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
152 template type Ethernet::Device() |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
153 { |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
154 chunk LKM::includes() |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
155 @@ -52,7 +92,7 @@ |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
156 } *rtx_ethernet_dev_p; |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
157 } |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
158 |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
159 - chunk ::init(Ethernet::Net net_dev, PCI::Device pci_dev) |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
160 + chunk ::init(Ethernet::AbstractDevice net_dev, PCI::Device pci_dev) |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
161 { |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
162 ${self} = netdev_priv(${net_dev}); |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
163 /* |
85
5dda73e7d728
Add my WIP on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
84
diff
changeset
|
164 @@ -100,11 +140,11 @@ |
5dda73e7d728
Add my WIP on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
84
diff
changeset
|
165 { |
5dda73e7d728
Add my WIP on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
84
diff
changeset
|
166 static int rtx_ethernet_xmit(struct sk_buff* skb, struct net_device *dev) |
5dda73e7d728
Add my WIP on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
84
diff
changeset
|
167 { |
5dda73e7d728
Add my WIP on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
84
diff
changeset
|
168 - ${cast local.dev as Ethernet::Device}; |
5dda73e7d728
Add my WIP on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
84
diff
changeset
|
169 + struct rtx_ethernet_dev* rtx_ethernet_dev = netdev_priv(dev); |
5dda73e7d728
Add my WIP on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
84
diff
changeset
|
170 + |
5dda73e7d728
Add my WIP on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
84
diff
changeset
|
171 + ${cast local.rtx_ethernet_dev as Ethernet::Device}; |
5dda73e7d728
Add my WIP on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
84
diff
changeset
|
172 ${cast local.skb as Socket::SKBuff}; |
5dda73e7d728
Add my WIP on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
84
diff
changeset
|
173 - ${pointcut ::IMPLEMENTATION(local.dev, local.skb)}; |
5dda73e7d728
Add my WIP on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
84
diff
changeset
|
174 - |
5dda73e7d728
Add my WIP on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
84
diff
changeset
|
175 - return 0; |
5dda73e7d728
Add my WIP on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
84
diff
changeset
|
176 + ${pointcut ::IMPLEMENTATION(local.rtx_ethernet_dev, local.skb)}; |
5dda73e7d728
Add my WIP on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
84
diff
changeset
|
177 } |
5dda73e7d728
Add my WIP on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
84
diff
changeset
|
178 } |
5dda73e7d728
Add my WIP on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
84
diff
changeset
|
179 } |
84
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
180 diff --git a/rathaxes/samples/e1000/ethernet.rti b/rathaxes/samples/e1000/ethernet.rti |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
181 --- a/rathaxes/samples/e1000/ethernet.rti |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
182 +++ b/rathaxes/samples/e1000/ethernet.rti |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
183 @@ -1,11 +1,28 @@ |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
184 interface Ethernet : Socket, PCI, LKM |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
185 { |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
186 - provided type Net |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
187 + provided type ProtocolId |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
188 + { |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
189 + chunk LKM::prototypes(); |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
190 + chunk LKM::data(); |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
191 + chunk LKM::code(); |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
192 + method ::to_str(); |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
193 + } |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
194 + |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
195 + /* |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
196 + * This is the abstract type used by the Kernel to represent an ethernet |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
197 + * device. |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
198 + */ |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
199 + provided type AbstractDevice |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
200 { |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
201 chunk LKM::includes(); |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
202 chunk ::decl(); |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
203 } |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
204 |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
205 + /* |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
206 + * Unlike PCI::Device, Ethernet::Device doesn't match the struct net_device |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
207 + * from Linux. Ethernet::Device is the type that we use in the private |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
208 + * field of the struct net_device. |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
209 + */ |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
210 provided type Device |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
211 { |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
212 chunk LKM::includes(); |
83
27f0e70df342
Wip on the transmission, tx init done, and tx hooked from Ethernet send
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
213 diff --git a/rathaxes/samples/e1000/lkm.rtx b/rathaxes/samples/e1000/lkm.rtx |
27f0e70df342
Wip on the transmission, tx init done, and tx hooked from Ethernet send
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
214 --- a/rathaxes/samples/e1000/lkm.rtx |
27f0e70df342
Wip on the transmission, tx init done, and tx hooked from Ethernet send
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
215 +++ b/rathaxes/samples/e1000/lkm.rtx |
27f0e70df342
Wip on the transmission, tx init done, and tx hooked from Ethernet send
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
216 @@ -46,6 +46,7 @@ |
27f0e70df342
Wip on the transmission, tx init done, and tx hooked from Ethernet send
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
217 Ethernet::send(Ethernet::Device dev, Socket::SKBuff skb) |
27f0e70df342
Wip on the transmission, tx init done, and tx hooked from Ethernet send
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
218 { |
27f0e70df342
Wip on the transmission, tx init done, and tx hooked from Ethernet send
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
219 Log::info("we have one packet to transmit!"); |
27f0e70df342
Wip on the transmission, tx init done, and tx hooked from Ethernet send
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
220 + e1000::xmit(dev, skb); |
27f0e70df342
Wip on the transmission, tx init done, and tx hooked from Ethernet send
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
221 } |
27f0e70df342
Wip on the transmission, tx init done, and tx hooked from Ethernet send
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
222 |
27f0e70df342
Wip on the transmission, tx init done, and tx hooked from Ethernet send
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
223 LKM::init() |
85
5dda73e7d728
Add my WIP on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
84
diff
changeset
|
224 @@ -79,4 +80,10 @@ |
5dda73e7d728
Add my WIP on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
84
diff
changeset
|
225 * 4096, 8192 and 16384 bytes: |
5dda73e7d728
Add my WIP on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
84
diff
changeset
|
226 */ |
5dda73e7d728
Add my WIP on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
84
diff
changeset
|
227 e1000::rx_buffer_len = 2048; |
5dda73e7d728
Add my WIP on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
84
diff
changeset
|
228 + /* |
5dda73e7d728
Add my WIP on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
84
diff
changeset
|
229 + * 4096 bytes maximum per transmit descriptor is used on Linux and FreeBSD, |
5dda73e7d728
Add my WIP on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
84
diff
changeset
|
230 + * 2048 on Minix and HelenOS, I can't find why. If I understand the Intel |
5dda73e7d728
Add my WIP on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
84
diff
changeset
|
231 + * man correctly, the maximum should be 16288 (see section 3.3.3). |
5dda73e7d728
Add my WIP on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
84
diff
changeset
|
232 + */ |
5dda73e7d728
Add my WIP on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
84
diff
changeset
|
233 + e1000::tx_max_data_per_desc = 4096; |
5dda73e7d728
Add my WIP on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
84
diff
changeset
|
234 } |
84
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
235 diff --git a/rathaxes/samples/e1000/socket.blt b/rathaxes/samples/e1000/socket.blt |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
236 --- a/rathaxes/samples/e1000/socket.blt |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
237 +++ b/rathaxes/samples/e1000/socket.blt |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
238 @@ -1,4 +1,4 @@ |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
239 -with Socket, LKM |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
240 +with Socket, LKM, Ethernet |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
241 { |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
242 template type Socket::SKBuff() |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
243 { |
85
5dda73e7d728
Add my WIP on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
84
diff
changeset
|
244 @@ -17,6 +17,34 @@ |
84
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
245 { |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
246 } |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
247 |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
248 + chunk ::dump_infos() |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
249 + { |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
250 + /* |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
251 + * We should use a Rathaxes log abstraction instead of pr_info here, |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
252 + * but Rathaxes doesn't support functions with a variable number of |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
253 + * arguments yet. |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
254 + */ |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
255 + unsigned short ethernet_proto = be16_to_cpu(${self}->protocol); |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
256 + ${cast local.ethernet_proto as Ethernet::ProtocolId}; |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
257 + |
85
5dda73e7d728
Add my WIP on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
84
diff
changeset
|
258 + static const char * const ip_summed_values[] = { |
5dda73e7d728
Add my WIP on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
84
diff
changeset
|
259 + "none", "unnecessary", "complete", "partial" |
5dda73e7d728
Add my WIP on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
84
diff
changeset
|
260 + }; |
5dda73e7d728
Add my WIP on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
84
diff
changeset
|
261 + |
84
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
262 + pr_info( |
85
5dda73e7d728
Add my WIP on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
84
diff
changeset
|
263 + "\t protocol = %#-5x (%s)\n" |
5dda73e7d728
Add my WIP on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
84
diff
changeset
|
264 + "\t len = %-5u data_len = %-5u head_len = %-5u\n" |
5dda73e7d728
Add my WIP on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
84
diff
changeset
|
265 + "\t nr_frags = %u\n" |
5dda73e7d728
Add my WIP on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
84
diff
changeset
|
266 + "\t gso_size = %-5u gso_segs = %-5u gso_type = %-5u\n" |
5dda73e7d728
Add my WIP on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
84
diff
changeset
|
267 + "\tip_summed = %d\n (%s)", |
84
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
268 + ethernet_proto, "", // XXX: ${local.ethernet_proto.to_str()}, |
85
5dda73e7d728
Add my WIP on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
84
diff
changeset
|
269 + ${self}->len, ${self}->data_len, skb_headlen(${self}), |
84
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
270 + skb_shinfo(${self})->nr_frags, |
85
5dda73e7d728
Add my WIP on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
84
diff
changeset
|
271 + skb_shinfo(${self})->gso_size, skb_shinfo(${self})->gso_segs, skb_shinfo(${self})->gso_type, |
5dda73e7d728
Add my WIP on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
84
diff
changeset
|
272 + ${self}->ip_summed, ip_summed_values[${self}->ip_summed] |
84
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
273 + ); |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
274 + } |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
275 + |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
276 map |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
277 { |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
278 // some work may have to be done here in order |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
279 diff --git a/rathaxes/samples/e1000/socket.rti b/rathaxes/samples/e1000/socket.rti |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
280 --- a/rathaxes/samples/e1000/socket.rti |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
281 +++ b/rathaxes/samples/e1000/socket.rti |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
282 @@ -1,8 +1,10 @@ |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
283 interface Socket : LKM |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
284 { |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
285 - provided type Socket::SKBuff { |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
286 - chunk LKM::includes(); |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
287 - chunk ::decl(); |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
288 - method ::init(); |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
289 + provided type Socket::SKBuff |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
290 + { |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
291 + chunk LKM::includes(); |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
292 + chunk ::decl(); |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
293 + method ::init(); |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
294 + method ::dump_infos(); |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
295 } |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
296 } |