comparison e1000_implement_the_frame_transmission_chunk.patch @ 83:27f0e70df342

Wip on the transmission, tx init done, and tx hooked from Ethernet send
author Louis Opter <louis@lse.epitech.net>
date Sun, 08 Jul 2012 10:00:25 +0200
parents
children 6432998a8245
comparison
equal deleted inserted replaced
82:71f76c0f235f 83:27f0e70df342
1 # HG changeset patch
2 # Parent 1a5a83776de5ecff15e42930c7741f5b4f2ada13
3 rathaxes: start to queue up packets in the TX ring on the e1000 sample
4
5 diff --git a/rathaxes/samples/e1000/e1000.blt b/rathaxes/samples/e1000/e1000.blt
6 --- a/rathaxes/samples/e1000/e1000.blt
7 +++ b/rathaxes/samples/e1000/e1000.blt
8 @@ -597,7 +597,7 @@
9
10 chunk ::CALL()
11 {
12 - // this is an hack for the scope
13 + // See #10
14 (void)1;
15 {
16 int error;
17 @@ -970,4 +970,31 @@
18 }
19 }
20 }
21 +
22 + template sequence e1000::xmit(Ethernet::Device ctx, Socket::SKBuff skb)
23 + {
24 + chunk ::CALL()
25 + {
26 + /*
27 + * Put packets on the TX ring, must return NETDEV_TX_OK or
28 + * NETDEV_TX_BUSY.
29 + */
30 + (void)1; // See #10
31 + {
32 + ${Log::info("xmit: skbuff details:")};
33 + }
34 + pr_info(
35 + "\t len = %-5u data_len = %-5u head_len = %-5u\n"
36 + "\tnr_frags = %u\n"
37 + "\tgso_size = %-5u gso_segs = %-5u gso_type = %-5u\n",
38 + ${skb}->len,
39 + ${skb}->data_len,
40 + skb_headlen(${skb}),
41 + skb_shinfo(${skb})->nr_frags,
42 + skb_shinfo(${skb})->gso_size,
43 + skb_shinfo(${skb})->gso_segs,
44 + skb_shinfo(${skb})->gso_type
45 + );
46 + }
47 + }
48 }
49 diff --git a/rathaxes/samples/e1000/e1000.rti b/rathaxes/samples/e1000/e1000.rti
50 --- a/rathaxes/samples/e1000/e1000.rti
51 +++ b/rathaxes/samples/e1000/e1000.rti
52 @@ -70,6 +70,11 @@
53 provided chunk ::CALL();
54 }
55
56 + provided sequence e1000::xmit(Ethernet::Device, Socket::SKBuff)
57 + {
58 + provided chunk ::CALL();
59 + }
60 +
61 provided sequence e1000::register_read32(e1000::Context, e1000::Register)
62 {
63 provided chunk LKM::prototypes();
64 diff --git a/rathaxes/samples/e1000/lkm.rtx b/rathaxes/samples/e1000/lkm.rtx
65 --- a/rathaxes/samples/e1000/lkm.rtx
66 +++ b/rathaxes/samples/e1000/lkm.rtx
67 @@ -46,6 +46,7 @@
68 Ethernet::send(Ethernet::Device dev, Socket::SKBuff skb)
69 {
70 Log::info("we have one packet to transmit!");
71 + e1000::xmit(dev, skb);
72 }
73
74 LKM::init()