From: chas w. - C. <ch...@cm...> - 2008-03-13 12:36:48
|
In message <b4e...@ma...>,"Nathan Williams" writes: >Can anyone suggest the basic outline required to achieve this? adummy.c is a good outline. obviously you just need to replace the send function with yours below. >Currently I've tried to copy data to an skbuff and then vcc->push it >inside the send function. >awrite appears to send data correctly, but aread doesn't show anything. > >Here is my send function: > >static int psend(struct atm_vcc *vcc,struct sk_buff *skb){ > int size; > struct sk_buff *myskb; > size = skb->len; > myskb = atm_alloc_charge(vcc, size, GFP_ATOMIC); > memcpy(myskb->data,skb->data,size); > skb_put(myskb,size); > if (vcc->pop){ > vcc->pop(vcc, skb); > } else { > dev_kfree_skb_any(skb); > } > atomic_inc(&vcc->stats->tx); > vcc->push(vcc, myskb); > atomic_inc(vcc->stats->rx); > return(0); >} if this is an exact copy of your code, i am pretty sure that your psend() routine is not being called. the atomic_inc() for the rx stats should have a &; otherwise i think it will oops the kernel. of course, while running your driver keep an eye on the output of atmdiag. see if any of the counters change. you should probably use skb_copy_bits() instead of memcpy() but i dont think that's the problem here. you actually dont have to copy the skb through. you could just charge the recv vcc directly and push the skb psend gets (clear the ->cb field first though). |