aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/atm
diff options
context:
space:
mode:
authorDavid Woodhouse <David.Woodhouse@intel.com>2009-01-26 18:18:51 -0500
committerDavid Woodhouse <David.Woodhouse@intel.com>2009-01-26 18:18:51 -0500
commitb76811af7606b36cb0703f04449c301b9634dcbc (patch)
tree2420dfb34e469b8521c0a70bdbba78b547b61f0c /drivers/atm
parent1de9e8e70f5acc441550ca75433563d91b269bbe (diff)
solos: Fix length header in FPGA transfers
The length field shouldn't ever include the size of the header itself. This fixes the problem that some people were seeing with 1500-byte packets. Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Diffstat (limited to 'drivers/atm')
-rw-r--r--drivers/atm/solos-pci.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/drivers/atm/solos-pci.c b/drivers/atm/solos-pci.c
index 72fc0f799a64..f0309546c356 100644
--- a/drivers/atm/solos-pci.c
+++ b/drivers/atm/solos-pci.c
@@ -356,7 +356,7 @@ static int popen(struct atm_vcc *vcc)
356 } 356 }
357 header = (void *)skb_put(skb, sizeof(*header)); 357 header = (void *)skb_put(skb, sizeof(*header));
358 358
359 header->size = cpu_to_le16(sizeof(*header)); 359 header->size = cpu_to_le16(0);
360 header->vpi = cpu_to_le16(vcc->vpi); 360 header->vpi = cpu_to_le16(vcc->vpi);
361 header->vci = cpu_to_le16(vcc->vci); 361 header->vci = cpu_to_le16(vcc->vci);
362 header->type = cpu_to_le16(PKT_POPEN); 362 header->type = cpu_to_le16(PKT_POPEN);
@@ -389,7 +389,7 @@ static void pclose(struct atm_vcc *vcc)
389 } 389 }
390 header = (void *)skb_put(skb, sizeof(*header)); 390 header = (void *)skb_put(skb, sizeof(*header));
391 391
392 header->size = cpu_to_le16(sizeof(*header)); 392 header->size = cpu_to_le16(0);
393 header->vpi = cpu_to_le16(vcc->vpi); 393 header->vpi = cpu_to_le16(vcc->vpi);
394 header->vci = cpu_to_le16(vcc->vci); 394 header->vci = cpu_to_le16(vcc->vci);
395 header->type = cpu_to_le16(PKT_PCLOSE); 395 header->type = cpu_to_le16(PKT_PCLOSE);
@@ -507,6 +507,7 @@ static int psend(struct atm_vcc *vcc, struct sk_buff *skb)
507 struct solos_card *card = vcc->dev->dev_data; 507 struct solos_card *card = vcc->dev->dev_data;
508 struct sk_buff *skb2 = NULL; 508 struct sk_buff *skb2 = NULL;
509 struct pkt_hdr *header; 509 struct pkt_hdr *header;
510 int pktlen;
510 511
511 //dev_dbg(&card->dev->dev, "psend called.\n"); 512 //dev_dbg(&card->dev->dev, "psend called.\n");
512 //dev_dbg(&card->dev->dev, "dev,vpi,vci = %d,%d,%d\n",SOLOS_CHAN(vcc->dev),vcc->vpi,vcc->vci); 513 //dev_dbg(&card->dev->dev, "dev,vpi,vci = %d,%d,%d\n",SOLOS_CHAN(vcc->dev),vcc->vpi,vcc->vci);
@@ -524,7 +525,8 @@ static int psend(struct atm_vcc *vcc, struct sk_buff *skb)
524 return 0; 525 return 0;
525 } 526 }
526 527
527 if (skb->len > (BUF_SIZE - sizeof(*header))) { 528 pktlen = skb->len;
529 if (pktlen > (BUF_SIZE - sizeof(*header))) {
528 dev_warn(&card->dev->dev, "Length of PDU is too large. Dropping PDU.\n"); 530 dev_warn(&card->dev->dev, "Length of PDU is too large. Dropping PDU.\n");
529 solos_pop(vcc, skb); 531 solos_pop(vcc, skb);
530 return 0; 532 return 0;
@@ -546,7 +548,8 @@ static int psend(struct atm_vcc *vcc, struct sk_buff *skb)
546 548
547 header = (void *)skb_push(skb, sizeof(*header)); 549 header = (void *)skb_push(skb, sizeof(*header));
548 550
549 header->size = cpu_to_le16(skb->len); 551 /* This does _not_ include the size of the header */
552 header->size = cpu_to_le16(pktlen);
550 header->vpi = cpu_to_le16(vcc->vpi); 553 header->vpi = cpu_to_le16(vcc->vpi);
551 header->vci = cpu_to_le16(vcc->vci); 554 header->vci = cpu_to_le16(vcc->vci);
552 header->type = cpu_to_le16(PKT_DATA); 555 header->type = cpu_to_le16(PKT_DATA);