diff options
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/shaper.c | 50 | ||||
-rw-r--r-- | drivers/net/wan/sdla_fr.c | 22 |
2 files changed, 9 insertions, 63 deletions
diff --git a/drivers/net/shaper.c b/drivers/net/shaper.c index 3ad0b6751f6f..221354eea21f 100644 --- a/drivers/net/shaper.c +++ b/drivers/net/shaper.c | |||
@@ -156,52 +156,6 @@ static int shaper_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
156 | 156 | ||
157 | SHAPERCB(skb)->shapelen= shaper_clocks(shaper,skb); | 157 | SHAPERCB(skb)->shapelen= shaper_clocks(shaper,skb); |
158 | 158 | ||
159 | #ifdef SHAPER_COMPLEX /* and broken.. */ | ||
160 | |||
161 | while(ptr && ptr!=(struct sk_buff *)&shaper->sendq) | ||
162 | { | ||
163 | if(ptr->pri<skb->pri | ||
164 | && jiffies - SHAPERCB(ptr)->shapeclock < SHAPER_MAXSLIP) | ||
165 | { | ||
166 | struct sk_buff *tmp=ptr->prev; | ||
167 | |||
168 | /* | ||
169 | * It goes before us therefore we slip the length | ||
170 | * of the new frame. | ||
171 | */ | ||
172 | |||
173 | SHAPERCB(ptr)->shapeclock+=SHAPERCB(skb)->shapelen; | ||
174 | SHAPERCB(ptr)->shapelatency+=SHAPERCB(skb)->shapelen; | ||
175 | |||
176 | /* | ||
177 | * The packet may have slipped so far back it | ||
178 | * fell off. | ||
179 | */ | ||
180 | if(SHAPERCB(ptr)->shapelatency > SHAPER_LATENCY) | ||
181 | { | ||
182 | skb_unlink(ptr); | ||
183 | dev_kfree_skb(ptr); | ||
184 | } | ||
185 | ptr=tmp; | ||
186 | } | ||
187 | else | ||
188 | break; | ||
189 | } | ||
190 | if(ptr==NULL || ptr==(struct sk_buff *)&shaper->sendq) | ||
191 | skb_queue_head(&shaper->sendq,skb); | ||
192 | else | ||
193 | { | ||
194 | struct sk_buff *tmp; | ||
195 | /* | ||
196 | * Set the packet clock out time according to the | ||
197 | * frames ahead. Im sure a bit of thought could drop | ||
198 | * this loop. | ||
199 | */ | ||
200 | for(tmp=skb_peek(&shaper->sendq); tmp!=NULL && tmp!=ptr; tmp=tmp->next) | ||
201 | SHAPERCB(skb)->shapeclock+=tmp->shapelen; | ||
202 | skb_append(ptr,skb); | ||
203 | } | ||
204 | #else | ||
205 | { | 159 | { |
206 | struct sk_buff *tmp; | 160 | struct sk_buff *tmp; |
207 | /* | 161 | /* |
@@ -220,7 +174,7 @@ static int shaper_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
220 | } else | 174 | } else |
221 | skb_queue_tail(&shaper->sendq, skb); | 175 | skb_queue_tail(&shaper->sendq, skb); |
222 | } | 176 | } |
223 | #endif | 177 | |
224 | if(sh_debug) | 178 | if(sh_debug) |
225 | printk("Frame queued.\n"); | 179 | printk("Frame queued.\n"); |
226 | if(skb_queue_len(&shaper->sendq)>SHAPER_QLEN) | 180 | if(skb_queue_len(&shaper->sendq)>SHAPER_QLEN) |
@@ -302,7 +256,7 @@ static void shaper_kick(struct shaper *shaper) | |||
302 | * Pull the frame and get interrupts back on. | 256 | * Pull the frame and get interrupts back on. |
303 | */ | 257 | */ |
304 | 258 | ||
305 | skb_unlink(skb); | 259 | skb_unlink(skb, &shaper->sendq); |
306 | if (shaper->recovery < | 260 | if (shaper->recovery < |
307 | SHAPERCB(skb)->shapeclock + SHAPERCB(skb)->shapelen) | 261 | SHAPERCB(skb)->shapeclock + SHAPERCB(skb)->shapelen) |
308 | shaper->recovery = SHAPERCB(skb)->shapeclock + SHAPERCB(skb)->shapelen; | 262 | shaper->recovery = SHAPERCB(skb)->shapeclock + SHAPERCB(skb)->shapelen; |
diff --git a/drivers/net/wan/sdla_fr.c b/drivers/net/wan/sdla_fr.c index c5f5e62aab8b..0497dbdb8631 100644 --- a/drivers/net/wan/sdla_fr.c +++ b/drivers/net/wan/sdla_fr.c | |||
@@ -445,7 +445,7 @@ void s508_s514_unlock(sdla_t *card, unsigned long *smp_flags); | |||
445 | void s508_s514_lock(sdla_t *card, unsigned long *smp_flags); | 445 | void s508_s514_lock(sdla_t *card, unsigned long *smp_flags); |
446 | 446 | ||
447 | unsigned short calc_checksum (char *, int); | 447 | unsigned short calc_checksum (char *, int); |
448 | static int setup_fr_header(struct sk_buff** skb, | 448 | static int setup_fr_header(struct sk_buff *skb, |
449 | struct net_device* dev, char op_mode); | 449 | struct net_device* dev, char op_mode); |
450 | 450 | ||
451 | 451 | ||
@@ -1372,7 +1372,7 @@ static int if_send(struct sk_buff* skb, struct net_device* dev) | |||
1372 | /* Move the if_header() code to here. By inserting frame | 1372 | /* Move the if_header() code to here. By inserting frame |
1373 | * relay header in if_header() we would break the | 1373 | * relay header in if_header() we would break the |
1374 | * tcpdump and other packet sniffers */ | 1374 | * tcpdump and other packet sniffers */ |
1375 | chan->fr_header_len = setup_fr_header(&skb,dev,chan->common.usedby); | 1375 | chan->fr_header_len = setup_fr_header(skb,dev,chan->common.usedby); |
1376 | if (chan->fr_header_len < 0 ){ | 1376 | if (chan->fr_header_len < 0 ){ |
1377 | ++chan->ifstats.tx_dropped; | 1377 | ++chan->ifstats.tx_dropped; |
1378 | ++card->wandev.stats.tx_dropped; | 1378 | ++card->wandev.stats.tx_dropped; |
@@ -1597,8 +1597,6 @@ static int setup_for_delayed_transmit(struct net_device* dev, | |||
1597 | return 1; | 1597 | return 1; |
1598 | } | 1598 | } |
1599 | 1599 | ||
1600 | skb_unlink(skb); | ||
1601 | |||
1602 | chan->transmit_length = len; | 1600 | chan->transmit_length = len; |
1603 | chan->delay_skb = skb; | 1601 | chan->delay_skb = skb; |
1604 | 1602 | ||
@@ -4871,18 +4869,15 @@ static void unconfig_fr (sdla_t *card) | |||
4871 | } | 4869 | } |
4872 | } | 4870 | } |
4873 | 4871 | ||
4874 | static int setup_fr_header(struct sk_buff **skb_orig, struct net_device* dev, | 4872 | static int setup_fr_header(struct sk_buff *skb, struct net_device* dev, |
4875 | char op_mode) | 4873 | char op_mode) |
4876 | { | 4874 | { |
4877 | struct sk_buff *skb = *skb_orig; | ||
4878 | fr_channel_t *chan=dev->priv; | 4875 | fr_channel_t *chan=dev->priv; |
4879 | 4876 | ||
4880 | if (op_mode == WANPIPE){ | 4877 | if (op_mode == WANPIPE) { |
4881 | |||
4882 | chan->fr_header[0]=Q922_UI; | 4878 | chan->fr_header[0]=Q922_UI; |
4883 | 4879 | ||
4884 | switch (htons(skb->protocol)){ | 4880 | switch (htons(skb->protocol)){ |
4885 | |||
4886 | case ETH_P_IP: | 4881 | case ETH_P_IP: |
4887 | chan->fr_header[1]=NLPID_IP; | 4882 | chan->fr_header[1]=NLPID_IP; |
4888 | break; | 4883 | break; |
@@ -4894,16 +4889,14 @@ static int setup_fr_header(struct sk_buff **skb_orig, struct net_device* dev, | |||
4894 | } | 4889 | } |
4895 | 4890 | ||
4896 | /* If we are in bridging mode, we must apply | 4891 | /* If we are in bridging mode, we must apply |
4897 | * an Ethernet header */ | 4892 | * an Ethernet header |
4898 | if (op_mode == BRIDGE || op_mode == BRIDGE_NODE){ | 4893 | */ |
4899 | 4894 | if (op_mode == BRIDGE || op_mode == BRIDGE_NODE) { | |
4900 | |||
4901 | /* Encapsulate the packet as a bridged Ethernet frame. */ | 4895 | /* Encapsulate the packet as a bridged Ethernet frame. */ |
4902 | #ifdef DEBUG | 4896 | #ifdef DEBUG |
4903 | printk(KERN_INFO "%s: encapsulating skb for frame relay\n", | 4897 | printk(KERN_INFO "%s: encapsulating skb for frame relay\n", |
4904 | dev->name); | 4898 | dev->name); |
4905 | #endif | 4899 | #endif |
4906 | |||
4907 | chan->fr_header[0] = 0x03; | 4900 | chan->fr_header[0] = 0x03; |
4908 | chan->fr_header[1] = 0x00; | 4901 | chan->fr_header[1] = 0x00; |
4909 | chan->fr_header[2] = 0x80; | 4902 | chan->fr_header[2] = 0x80; |
@@ -4916,7 +4909,6 @@ static int setup_fr_header(struct sk_buff **skb_orig, struct net_device* dev, | |||
4916 | /* Yuck. */ | 4909 | /* Yuck. */ |
4917 | skb->protocol = ETH_P_802_3; | 4910 | skb->protocol = ETH_P_802_3; |
4918 | return 8; | 4911 | return 8; |
4919 | |||
4920 | } | 4912 | } |
4921 | 4913 | ||
4922 | return 0; | 4914 | return 0; |