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>
This commit is contained in:
David Woodhouse 2009-01-27 10:18:51 +11:00
parent 1de9e8e70f
commit b76811af76

View file

@ -356,7 +356,7 @@ static int popen(struct atm_vcc *vcc)
}
header = (void *)skb_put(skb, sizeof(*header));
header->size = cpu_to_le16(sizeof(*header));
header->size = cpu_to_le16(0);
header->vpi = cpu_to_le16(vcc->vpi);
header->vci = cpu_to_le16(vcc->vci);
header->type = cpu_to_le16(PKT_POPEN);
@ -389,7 +389,7 @@ static void pclose(struct atm_vcc *vcc)
}
header = (void *)skb_put(skb, sizeof(*header));
header->size = cpu_to_le16(sizeof(*header));
header->size = cpu_to_le16(0);
header->vpi = cpu_to_le16(vcc->vpi);
header->vci = cpu_to_le16(vcc->vci);
header->type = cpu_to_le16(PKT_PCLOSE);
@ -507,6 +507,7 @@ static int psend(struct atm_vcc *vcc, struct sk_buff *skb)
struct solos_card *card = vcc->dev->dev_data;
struct sk_buff *skb2 = NULL;
struct pkt_hdr *header;
int pktlen;
//dev_dbg(&card->dev->dev, "psend called.\n");
//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)
return 0;
}
if (skb->len > (BUF_SIZE - sizeof(*header))) {
pktlen = skb->len;
if (pktlen > (BUF_SIZE - sizeof(*header))) {
dev_warn(&card->dev->dev, "Length of PDU is too large. Dropping PDU.\n");
solos_pop(vcc, skb);
return 0;
@ -546,7 +548,8 @@ static int psend(struct atm_vcc *vcc, struct sk_buff *skb)
header = (void *)skb_push(skb, sizeof(*header));
header->size = cpu_to_le16(skb->len);
/* This does _not_ include the size of the header */
header->size = cpu_to_le16(pktlen);
header->vpi = cpu_to_le16(vcc->vpi);
header->vci = cpu_to_le16(vcc->vci);
header->type = cpu_to_le16(PKT_DATA);