nicstar.c (b22364c8eec89e6b0c081a237f3b6348df87796f) | nicstar.c (27a884dc3cb63b93c2b3b643f5b31eed5f8a4d26) |
---|---|
1/****************************************************************************** 2 * 3 * nicstar.c 4 * 5 * Device driver supporting CBR for IDT 77201/77211 "NICStAR" based cards. 6 * 7 * IMPORTANT: The included file nicstarmac.c was NOT WRITTEN BY ME. 8 * It was taken from the frle-0.22 device driver. --- 2194 unchanged lines hidden (view full) --- 2203 break; 2204 } 2205 /* Rebuild the header */ 2206 *((u32 *) sb->data) = le32_to_cpu(rsqe->word_1) << 4 | 2207 (ns_rsqe_clp(rsqe) ? 0x00000001 : 0x00000000); 2208 if (i == 1 && ns_rsqe_eopdu(rsqe)) 2209 *((u32 *) sb->data) |= 0x00000002; 2210 skb_put(sb, NS_AAL0_HEADER); | 1/****************************************************************************** 2 * 3 * nicstar.c 4 * 5 * Device driver supporting CBR for IDT 77201/77211 "NICStAR" based cards. 6 * 7 * IMPORTANT: The included file nicstarmac.c was NOT WRITTEN BY ME. 8 * It was taken from the frle-0.22 device driver. --- 2194 unchanged lines hidden (view full) --- 2203 break; 2204 } 2205 /* Rebuild the header */ 2206 *((u32 *) sb->data) = le32_to_cpu(rsqe->word_1) << 4 | 2207 (ns_rsqe_clp(rsqe) ? 0x00000001 : 0x00000000); 2208 if (i == 1 && ns_rsqe_eopdu(rsqe)) 2209 *((u32 *) sb->data) |= 0x00000002; 2210 skb_put(sb, NS_AAL0_HEADER); |
2211 memcpy(sb->tail, cell, ATM_CELL_PAYLOAD); | 2211 memcpy(skb_tail_pointer(sb), cell, ATM_CELL_PAYLOAD); |
2212 skb_put(sb, ATM_CELL_PAYLOAD); 2213 ATM_SKB(sb)->vcc = vcc; 2214 __net_timestamp(sb); 2215 vcc->push(vcc, sb); 2216 atomic_inc(&vcc->stats->rx); 2217 cell += ATM_CELL_PAYLOAD; 2218 } 2219 --- 27 unchanged lines hidden (view full) --- 2247 NS_SKB_CB(iovb)->buf_type = BUF_NONE; 2248 skb_queue_tail(&card->iovpool.queue, new_iovb); 2249 card->iovpool.count++; 2250 } 2251 } 2252 vc->rx_iov = iovb; 2253 NS_SKB(iovb)->iovcnt = 0; 2254 iovb->len = 0; | 2212 skb_put(sb, ATM_CELL_PAYLOAD); 2213 ATM_SKB(sb)->vcc = vcc; 2214 __net_timestamp(sb); 2215 vcc->push(vcc, sb); 2216 atomic_inc(&vcc->stats->rx); 2217 cell += ATM_CELL_PAYLOAD; 2218 } 2219 --- 27 unchanged lines hidden (view full) --- 2247 NS_SKB_CB(iovb)->buf_type = BUF_NONE; 2248 skb_queue_tail(&card->iovpool.queue, new_iovb); 2249 card->iovpool.count++; 2250 } 2251 } 2252 vc->rx_iov = iovb; 2253 NS_SKB(iovb)->iovcnt = 0; 2254 iovb->len = 0; |
2255 iovb->tail = iovb->data = iovb->head; | 2255 iovb->data = iovb->head; 2256 skb_reset_tail_pointer(iovb); |
2256 NS_SKB(iovb)->vcc = vcc; 2257 /* IMPORTANT: a pointer to the sk_buff containing the small or large 2258 buffer is stored as iovec base, NOT a pointer to the 2259 small or large buffer itself. */ 2260 } 2261 else if (NS_SKB(iovb)->iovcnt >= NS_MAX_IOVECS) 2262 { 2263 printk("nicstar%d: received too big AAL5 SDU.\n", card->index); 2264 atomic_inc(&vcc->stats->rx_err); 2265 recycle_iovec_rx_bufs(card, (struct iovec *) iovb->data, NS_MAX_IOVECS); 2266 NS_SKB(iovb)->iovcnt = 0; 2267 iovb->len = 0; | 2257 NS_SKB(iovb)->vcc = vcc; 2258 /* IMPORTANT: a pointer to the sk_buff containing the small or large 2259 buffer is stored as iovec base, NOT a pointer to the 2260 small or large buffer itself. */ 2261 } 2262 else if (NS_SKB(iovb)->iovcnt >= NS_MAX_IOVECS) 2263 { 2264 printk("nicstar%d: received too big AAL5 SDU.\n", card->index); 2265 atomic_inc(&vcc->stats->rx_err); 2266 recycle_iovec_rx_bufs(card, (struct iovec *) iovb->data, NS_MAX_IOVECS); 2267 NS_SKB(iovb)->iovcnt = 0; 2268 iovb->len = 0; |
2268 iovb->tail = iovb->data = iovb->head; | 2269 iovb->data = iovb->head; 2270 skb_reset_tail_pointer(iovb); |
2269 NS_SKB(iovb)->vcc = vcc; 2270 } 2271 iov = &((struct iovec *) iovb->data)[NS_SKB(iovb)->iovcnt++]; 2272 iov->iov_base = (void *) skb; 2273 iov->iov_len = ns_rsqe_cellcount(rsqe) * 48; 2274 iovb->len += iov->iov_len; 2275 2276 if (NS_SKB(iovb)->iovcnt == 1) --- 207 unchanged lines hidden (view full) --- 2484 /* Free the small buffer */ 2485 push_rxbufs(card, sb); 2486 2487 /* Copy all large buffers to the huge buffer and free them */ 2488 for (j = 1; j < NS_SKB(iovb)->iovcnt; j++) 2489 { 2490 lb = (struct sk_buff *) iov->iov_base; 2491 tocopy = min_t(int, remaining, iov->iov_len); | 2271 NS_SKB(iovb)->vcc = vcc; 2272 } 2273 iov = &((struct iovec *) iovb->data)[NS_SKB(iovb)->iovcnt++]; 2274 iov->iov_base = (void *) skb; 2275 iov->iov_len = ns_rsqe_cellcount(rsqe) * 48; 2276 iovb->len += iov->iov_len; 2277 2278 if (NS_SKB(iovb)->iovcnt == 1) --- 207 unchanged lines hidden (view full) --- 2486 /* Free the small buffer */ 2487 push_rxbufs(card, sb); 2488 2489 /* Copy all large buffers to the huge buffer and free them */ 2490 for (j = 1; j < NS_SKB(iovb)->iovcnt; j++) 2491 { 2492 lb = (struct sk_buff *) iov->iov_base; 2493 tocopy = min_t(int, remaining, iov->iov_len); |
2492 memcpy(hb->tail, lb->data, tocopy); | 2494 memcpy(skb_tail_pointer(hb), lb->data, tocopy); |
2493 skb_put(hb, tocopy); 2494 iov++; 2495 remaining -= tocopy; 2496 push_rxbufs(card, lb); 2497 } 2498#ifdef EXTRA_DEBUG 2499 if (remaining != 0 || hb->len != len) 2500 printk("nicstar%d: Huge buffer len mismatch.\n", card->index); --- 594 unchanged lines hidden --- | 2495 skb_put(hb, tocopy); 2496 iov++; 2497 remaining -= tocopy; 2498 push_rxbufs(card, lb); 2499 } 2500#ifdef EXTRA_DEBUG 2501 if (remaining != 0 || hb->len != len) 2502 printk("nicstar%d: Huge buffer len mismatch.\n", card->index); --- 594 unchanged lines hidden --- |