hi i'm working on network driver driver, totally confused by the existing code under driver/net/...
say i got RECV_COMPLETE interrupt, i need to move the received pkt into the SKB to pass up.
my plan is,
1. read the 1st 22 bytes for un-tagged ethernet frame,
that's preamble+SFD+src+dst+len,
2. from len, i know the total size of this frame,
data_len = len - 22;
read this number of bytes from hardware into buf1
3. the last 4 bytes is the frame check sequence
4. skb = netdev_alloc_skb,
skb_len = data_len - 4; // don't need the last 4 bytes
5. copy skb_len of bytes from buf1 into skb->data
is the above correct ?
also i saw netdev_alloc_skp_ip_align, ALIGN(len, 4), ...
each driver is doing things in different ways,
can someone give me a clear steps ?
thanks very much !