if_sn.c (302408) | if_sn.c (315221) |
---|---|
1/*- 2 * Copyright (c) 1996 Gardner Buchanan <gbuchanan@shl.com> 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 16 unchanged lines hidden (view full) --- 25 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 26 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 27 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 28 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 29 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 */ 31 32#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 1996 Gardner Buchanan <gbuchanan@shl.com> 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 16 unchanged lines hidden (view full) --- 25 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 26 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 27 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 28 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 29 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 */ 31 32#include <sys/cdefs.h> |
33__FBSDID("$FreeBSD: stable/11/sys/dev/sn/if_sn.c 298955 2016-05-03 03:41:25Z pfg $"); | 33__FBSDID("$FreeBSD: stable/11/sys/dev/sn/if_sn.c 315221 2017-03-14 02:06:03Z pfg $"); |
34 35/* 36 * This is a driver for SMC's 9000 series of Ethernet adapters. 37 * 38 * This FreeBSD driver is derived from the smc9194 Linux driver by 39 * Erik Stahlman and is Copyright (C) 1996 by Erik Stahlman. 40 * This driver also shamelessly borrows from the FreeBSD ep driver 41 * which is Copyright (C) 1994 Herb Peyerl <hpeyerl@novatel.ca> --- 346 unchanged lines hidden (view full) --- 388 return; 389 } 390startagain: 391 392 /* 393 * Sneak a peek at the next packet 394 */ 395 m = ifp->if_snd.ifq_head; | 34 35/* 36 * This is a driver for SMC's 9000 series of Ethernet adapters. 37 * 38 * This FreeBSD driver is derived from the smc9194 Linux driver by 39 * Erik Stahlman and is Copyright (C) 1996 by Erik Stahlman. 40 * This driver also shamelessly borrows from the FreeBSD ep driver 41 * which is Copyright (C) 1994 Herb Peyerl <hpeyerl@novatel.ca> --- 346 unchanged lines hidden (view full) --- 388 return; 389 } 390startagain: 391 392 /* 393 * Sneak a peek at the next packet 394 */ 395 m = ifp->if_snd.ifq_head; |
396 if (m == 0) | 396 if (m == NULL) |
397 return; 398 /* 399 * Compute the frame length and set pad to give an overall even 400 * number of bytes. Below we assume that the packet length is even. 401 */ 402 for (len = 0, top = m; m; m = m->m_next) 403 len += m->m_len; 404 --- 99 unchanged lines hidden (view full) --- 504 * Get the packet from the kernel. This will include the Ethernet 505 * frame header, MAC Addresses etc. 506 */ 507 IFQ_DRV_DEQUEUE(&ifp->if_snd, m); 508 509 /* 510 * Push out the data to the card. 511 */ | 397 return; 398 /* 399 * Compute the frame length and set pad to give an overall even 400 * number of bytes. Below we assume that the packet length is even. 401 */ 402 for (len = 0, top = m; m; m = m->m_next) 403 len += m->m_len; 404 --- 99 unchanged lines hidden (view full) --- 504 * Get the packet from the kernel. This will include the Ethernet 505 * frame header, MAC Addresses etc. 506 */ 507 IFQ_DRV_DEQUEUE(&ifp->if_snd, m); 508 509 /* 510 * Push out the data to the card. 511 */ |
512 for (top = m; m != 0; m = m->m_next) { | 512 for (top = m; m != NULL; m = m->m_next) { |
513 514 /* 515 * Push out words. 516 */ 517 CSR_WRITE_MULTI_2(sc, DATA_REG_W, mtod(m, uint16_t *), 518 m->m_len / 2); 519 520 /* --- 81 unchanged lines hidden (view full) --- 602 603 pages_wanted = sc->pages_wanted; 604 sc->pages_wanted = -1; 605 606 /* 607 * Sneak a peek at the next packet 608 */ 609 m = ifp->if_snd.ifq_head; | 513 514 /* 515 * Push out words. 516 */ 517 CSR_WRITE_MULTI_2(sc, DATA_REG_W, mtod(m, uint16_t *), 518 m->m_len / 2); 519 520 /* --- 81 unchanged lines hidden (view full) --- 602 603 pages_wanted = sc->pages_wanted; 604 sc->pages_wanted = -1; 605 606 /* 607 * Sneak a peek at the next packet 608 */ 609 m = ifp->if_snd.ifq_head; |
610 if (m == 0) { | 610 if (m == NULL) { |
611 if_printf(ifp, "snresume() with nothing to send\n"); 612 return; 613 } 614 /* 615 * Compute the frame length and set pad to give an overall even 616 * number of bytes. Below we assume that the packet length is even. 617 */ 618 for (len = 0, top = m; m; m = m->m_next) --- 84 unchanged lines hidden (view full) --- 703 * Get the packet from the kernel. This will include the Ethernet 704 * frame header, MAC Addresses etc. 705 */ 706 IFQ_DRV_DEQUEUE(&ifp->if_snd, m); 707 708 /* 709 * Push out the data to the card. 710 */ | 611 if_printf(ifp, "snresume() with nothing to send\n"); 612 return; 613 } 614 /* 615 * Compute the frame length and set pad to give an overall even 616 * number of bytes. Below we assume that the packet length is even. 617 */ 618 for (len = 0, top = m; m; m = m->m_next) --- 84 unchanged lines hidden (view full) --- 703 * Get the packet from the kernel. This will include the Ethernet 704 * frame header, MAC Addresses etc. 705 */ 706 IFQ_DRV_DEQUEUE(&ifp->if_snd, m); 707 708 /* 709 * Push out the data to the card. 710 */ |
711 for (top = m; m != 0; m = m->m_next) { | 711 for (top = m; m != NULL; m = m->m_next) { |
712 713 /* 714 * Push out words. 715 */ 716 CSR_WRITE_MULTI_2(sc, DATA_REG_W, mtod(m, uint16_t *), 717 m->m_len / 2); 718 /* 719 * Push out remaining byte. --- 717 unchanged lines hidden --- | 712 713 /* 714 * Push out words. 715 */ 716 CSR_WRITE_MULTI_2(sc, DATA_REG_W, mtod(m, uint16_t *), 717 m->m_len / 2); 718 /* 719 * Push out remaining byte. --- 717 unchanged lines hidden --- |