25 #include <linux/kernel.h>
26 #include <linux/netdevice.h>
27 #include <linux/if_ether.h>
28 #include <linux/if_arp.h>
31 #include <linux/if_phonet.h>
35 #define GPRS_DEFAULT_MTU 1400
51 pvfc = skb_header_pointer(skb, 0, 1, &buf);
64 static void gprs_writeable(
struct gprs_dev *
gp)
69 netif_wake_queue(dev);
76 static void gprs_state_change(
struct sock *
sk)
83 netif_stop_queue(dev);
99 if (skb_headroom(skb) & 3) {
107 rskb = netdev_alloc_skb(dev, 0);
112 skb_shinfo(rskb)->frag_list =
skb;
118 skb_walk_frags(skb, fs)
120 skb->
next = skb_shinfo(skb)->frag_list;
121 skb_frag_list_init(skb);
129 skb->protocol = protocol;
130 skb_reset_mac_header(skb);
134 dev->stats.rx_packets++;
135 dev->stats.rx_bytes += skb->len;
144 dev->
stats.rx_dropped++;
149 static void gprs_data_ready(
struct sock *sk,
int len)
160 static void gprs_write_space(
struct sock *sk)
164 if (netif_running(gp->
dev))
174 struct gprs_dev *gp = netdev_priv(dev);
182 netif_stop_queue(dev);
188 struct gprs_dev *gp = netdev_priv(dev);
202 skb_set_owner_w(skb, sk);
208 dev->
stats.tx_aborted_errors++;
209 dev->
stats.tx_errors++;
211 dev->
stats.tx_packets++;
215 netif_stop_queue(dev);
217 netif_wake_queue(dev);
221 static int gprs_set_mtu(
struct net_device *dev,
int new_mtu)
231 .ndo_open = gprs_open,
232 .ndo_stop = gprs_close,
233 .ndo_start_xmit = gprs_xmit,
234 .ndo_change_mtu = gprs_set_mtu,
237 static void gprs_setup(
struct net_device *dev)
261 static const char ifname[] =
"gprs%d";
273 gp = netdev_priv(dev);
277 netif_stop_queue(dev);