?? eth.c
字號:
#include "skbuff.h"
#include "eth.h"
int eth_init(void)
{
return s3c2410_eth_init();
}
int eth_send(struct sk_buff *skb, unsigned char *dest_addr, unsigned short proto)
{
struct ethhdr *eth_hdr;
unsigned char local_eth_addr[ETH_ALEN];
eth_get_addr(local_eth_addr);
eth_hdr = (struct ethhdr *)skb_push(skb, ETH_HLEN);
memcpy(eth_hdr->h_dest, dest_addr, ETH_ALEN);
memcpy(eth_hdr->h_source, local_eth_addr, ETH_ALEN);
eth_hdr->h_proto = htons(proto);
return s3c2410_eth_send(skb->data, skb->len);
}
int eth_rcv(struct sk_buff *skb)
{
return s3c2410_eth_rcv(skb->data, &skb->len);
}
int eth_get_addr(unsigned char *addr)
{
return s3c2410_eth_get_addr(addr);
}
void eth_skb_reserve(struct sk_buff *skb)
{
skb_reserve(skb, ETH_HLEN);
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -