diff options
Diffstat (limited to 'drivers/net/shaper.c')
| -rw-r--r-- | drivers/net/shaper.c | 50 |
1 files changed, 2 insertions, 48 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; |
