speedtch usbatm.c,1.23,1.24
Duncan Sands
duncan at infradead.org
Tue May 3 04:24:28 EDT 2005
Update of /home/cvs/speedtch
In directory phoenix.infradead.org:/tmp/cvs-serv31421
Modified Files:
usbatm.c
Log Message:
Turn the first element of struct usbatm_control back into a struct atm_skb_data,
on the lily-livered principle of "better safe than sorry". In theory the layer
that has the skb owns the control block, but ATM is a law unto itself, and I
don't feel like auditing the ATM code right now...
Index: usbatm.c
===================================================================
RCS file: /home/cvs/speedtch/usbatm.c,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -r1.23 -r1.24
--- usbatm.c 3 May 2005 08:08:19 -0000 1.23
+++ usbatm.c 3 May 2005 08:24:25 -0000 1.24
@@ -156,7 +156,7 @@
/* send */
struct usbatm_control {
- struct atm_vcc *vcc;
+ struct atm_skb_data atm;
u32 len;
u32 crc;
};
@@ -414,6 +414,7 @@
u8 *target, unsigned int avail_space)
{
struct usbatm_control *ctrl = UDSL_SKB(skb);
+ struct atm_vcc *vcc = ctrl->atm.vcc;
unsigned int num_written;
/* UDSL_ASSERT(!(avail_space % instance->tx_channel.stride)); */
@@ -427,10 +428,10 @@
unsigned int left = ATM_CELL_PAYLOAD - data_len;
u8 *ptr = target;
- ptr[0] = ctrl->vcc->vpi >> 4;
- ptr[1] = (ctrl->vcc->vpi << 4) | (ctrl->vcc->vci >> 12);
- ptr[2] = ctrl->vcc->vci >> 4;
- ptr[3] = ctrl->vcc->vci << 4;
+ ptr[0] = vcc->vpi >> 4;
+ ptr[1] = (vcc->vpi << 4) | (vcc->vci >> 12);
+ ptr[2] = vcc->vci >> 4;
+ ptr[3] = vcc->vci << 4;
ptr[4] = 0xec;
ptr += ATM_CELL_HEADER;
@@ -535,7 +536,7 @@
__func__, num_written, skb, tx);
if (!UDSL_SKB(skb)->len) {
- struct atm_vcc *vcc = UDSL_SKB(skb)->vcc;
+ struct atm_vcc *vcc = UDSL_SKB(skb)->atm.vcc;
usbatm_pop(vcc, skb);
atomic_inc(&vcc->stats->tx);
@@ -566,7 +567,7 @@
for (skb = instance->sndqueue.next, n = skb->next;
skb != (struct sk_buff *)&instance->sndqueue;
skb = n, n = skb->next)
- if (UDSL_SKB(skb)->vcc == vcc) {
+ if (UDSL_SKB(skb)->atm.vcc == vcc) {
atm_dbg(instance, "%s: popping skb 0x%p\n", __func__, skb);
__skb_unlink(skb, &instance->sndqueue);
usbatm_pop(vcc, skb);
@@ -574,7 +575,7 @@
spin_unlock_irq(&instance->sndqueue.lock);
tasklet_disable(&instance->tx_channel.tasklet);
- if ((skb = instance->current_skb) && (UDSL_SKB(skb)->vcc == vcc)) {
+ if ((skb = instance->current_skb) && (UDSL_SKB(skb)->atm.vcc == vcc)) {
atm_dbg(instance, "%s: popping current skb (0x%p)\n", __func__, skb);
instance->current_skb = NULL;
usbatm_pop(vcc, skb);
@@ -613,7 +614,7 @@
PACKETDEBUG(skb->data, skb->len);
/* initialize the control block */
- ctrl->vcc = vcc;
+ ctrl->atm.vcc = vcc;
ctrl->len = skb->len;
ctrl->crc = crc32_be(~0, skb->data, skb->len);
More information about the Usbatm-commits
mailing list