Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-8]: src/sys/dev/pci Pull up the following revisions, requested by...



details:   https://anonhg.NetBSD.org/src/rev/b89be5933760
branches:  netbsd-8
changeset: 936821:b89be5933760
user:      martin <martin%NetBSD.org@localhost>
date:      Wed Aug 05 16:08:09 2020 +0000

description:
Pull up the following revisions, requested by msaitoh in ticket #1590:

        sys/dev/pci/if_ti.c                             1.103, 1.106, 1.108,
                                                        1.116-1.120 via patch
        sys/dev/pci/if_tireg.h                          1.26

- Use pci_intr_establish_xname()
- Don't clear CFI and priority bit to pass them to the upper layer.
- Add support for Farallon PN9000SX from FreeBSD.
- u_int_{8,16,32}_t -> uint_{8,16,32}_t
- Fix typo in comment.
- Style fix.

diffstat:

 sys/dev/pci/if_ti.c    |  280 ++++++++++++++++++++++++------------------------
 sys/dev/pci/if_tireg.h |    4 +-
 2 files changed, 142 insertions(+), 142 deletions(-)

diffs (truncated from 826 to 300 lines):

diff -r 85e8590f3e3c -r b89be5933760 sys/dev/pci/if_ti.c
--- a/sys/dev/pci/if_ti.c       Wed Aug 05 16:05:49 2020 +0000
+++ b/sys/dev/pci/if_ti.c       Wed Aug 05 16:08:09 2020 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: if_ti.c,v 1.101.8.2 2019/05/13 12:40:13 martin Exp $ */
+/* $NetBSD: if_ti.c,v 1.101.8.3 2020/08/05 16:08:09 martin Exp $ */
 
 /*
  * Copyright (c) 1997, 1998, 1999
@@ -81,7 +81,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_ti.c,v 1.101.8.2 2019/05/13 12:40:13 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_ti.c,v 1.101.8.3 2020/08/05 16:08:09 martin Exp $");
 
 #include "opt_inet.h"
 
@@ -140,6 +140,8 @@
                "Netgear GA620 1000BASE-T Ethernet" },
        { PCI_VENDOR_SGI, PCI_PRODUCT_SGI_TIGON,
                "Silicon Graphics Gigabit Ethernet" },
+       { PCI_VENDOR_DEC, PCI_PRODUCT_DEC_PN9000SX,
+               "Farallon PN9000SX Gigabit Ethernet" },
        { 0, 0, NULL }
 };
 
@@ -152,8 +154,8 @@
 static void ti_rxeof(struct ti_softc *);
 
 static void ti_stats_update(struct ti_softc *);
-static int ti_encap_tigon1(struct ti_softc *, struct mbuf *, u_int32_t *);
-static int ti_encap_tigon2(struct ti_softc *, struct mbuf *, u_int32_t *);
+static int ti_encap_tigon1(struct ti_softc *, struct mbuf *, uint32_t *);
+static int ti_encap_tigon2(struct ti_softc *, struct mbuf *, uint32_t *);
 
 static int ti_intr(void *);
 static void ti_start(struct ifnet *);
@@ -165,15 +167,15 @@
 static int ti_ifmedia_upd(struct ifnet *);
 static void ti_ifmedia_sts(struct ifnet *, struct ifmediareq *);
 
-static u_int32_t ti_eeprom_putbyte(struct ti_softc *, int);
-static u_int8_t        ti_eeprom_getbyte(struct ti_softc *, int, u_int8_t *);
+static uint32_t ti_eeprom_putbyte(struct ti_softc *, int);
+static uint8_t ti_eeprom_getbyte(struct ti_softc *, int, uint8_t *);
 static int ti_read_eeprom(struct ti_softc *, void *, int, int);
 
 static void ti_add_mcast(struct ti_softc *, struct ether_addr *);
 static void ti_del_mcast(struct ti_softc *, struct ether_addr *);
 static void ti_setmulti(struct ti_softc *);
 
-static void ti_mem(struct ti_softc *, u_int32_t, u_int32_t, const void *);
+static void ti_mem(struct ti_softc *, uint32_t, uint32_t, const void *);
 static void ti_loadfw(struct ti_softc *);
 static void ti_cmd(struct ti_softc *, struct ti_cmd_desc *);
 static void ti_cmd_ext(struct ti_softc *, struct ti_cmd_desc *, void *, int);
@@ -205,7 +207,7 @@
 /*
  * Send an instruction or address to the EEPROM, check for ACK.
  */
-static u_int32_t
+static uint32_t
 ti_eeprom_putbyte(struct ti_softc *sc, int byte)
 {
        int i, ack = 0;
@@ -216,7 +218,7 @@
        TI_SETBIT(sc, TI_MISC_LOCAL_CTL, TI_MLC_EE_TXEN);
 
        /*
-        * Feed in each bit and stobe the clock.
+        * Feed in each bit and strobe the clock.
         */
        for (i = 0x80; i; i >>= 1) {
                if (byte & i) {
@@ -250,11 +252,11 @@
  * We have to send two address bytes since the EEPROM can hold
  * more than 256 bytes of data.
  */
-static u_int8_t
-ti_eeprom_getbyte(struct ti_softc *sc, int addr, u_int8_t *dest)
+static uint8_t
+ti_eeprom_getbyte(struct ti_softc *sc, int addr, uint8_t *dest)
 {
        int             i;
-       u_int8_t                byte = 0;
+       uint8_t         byte = 0;
 
        EEPROM_START();
 
@@ -327,7 +329,7 @@
 {
        char *dest = destv;
        int err = 0, i;
-       u_int8_t byte = 0;
+       uint8_t byte = 0;
 
        for (i = 0; i < cnt; i++) {
                err = ti_eeprom_getbyte(sc, off + i, &byte);
@@ -344,7 +346,7 @@
  * of NIC local memory or (if tbuf is non-NULL) copy data into it.
  */
 static void
-ti_mem(struct ti_softc *sc, u_int32_t addr, u_int32_t len, const void *xbuf)
+ti_mem(struct ti_softc *sc, uint32_t addr, uint32_t len, const void *xbuf)
 {
        int                     segptr, segsize, cnt;
        const void              *ptr;
@@ -368,11 +370,11 @@
                        bus_space_write_region_stream_4(sc->ti_btag,
                            sc->ti_bhandle,
                            TI_WINDOW + (segptr & (TI_WINLEN - 1)),
-                           (const u_int32_t *)ptr, segsize / 4);
+                           (const uint32_t *)ptr, segsize / 4);
 #else
                        bus_space_write_region_4(sc->ti_btag, sc->ti_bhandle,
                            TI_WINDOW + (segptr & (TI_WINLEN - 1)),
-                           (const u_int32_t *)ptr, segsize / 4);
+                           (const uint32_t *)ptr, segsize / 4);
 #endif
                        ptr = (const char *)ptr + segsize;
                }
@@ -444,10 +446,10 @@
 static void
 ti_cmd(struct ti_softc *sc, struct ti_cmd_desc *cmd)
 {
-       u_int32_t               index;
+       uint32_t                index;
 
        index = sc->ti_cmd_saved_prodidx;
-       CSR_WRITE_4(sc, TI_GCR_CMDRING + (index * 4), *(u_int32_t *)(cmd));
+       CSR_WRITE_4(sc, TI_GCR_CMDRING + (index * 4), *(uint32_t *)(cmd));
        TI_INC(index, TI_CMD_RING_CNT);
        CSR_WRITE_4(sc, TI_MB_CMDPROD_IDX, index);
        sc->ti_cmd_saved_prodidx = index;
@@ -460,16 +462,16 @@
 static void
 ti_cmd_ext(struct ti_softc *sc, struct ti_cmd_desc *cmd, void *argv, int len)
 {
-       char *arg = argv;
-       u_int32_t               index;
+       char            *arg = argv;
+       uint32_t        index;
        int             i;
 
        index = sc->ti_cmd_saved_prodidx;
-       CSR_WRITE_4(sc, TI_GCR_CMDRING + (index * 4), *(u_int32_t *)(cmd));
+       CSR_WRITE_4(sc, TI_GCR_CMDRING + (index * 4), *(uint32_t *)(cmd));
        TI_INC(index, TI_CMD_RING_CNT);
        for (i = 0; i < len; i++) {
                CSR_WRITE_4(sc, TI_GCR_CMDRING + (index * 4),
-                   *(u_int32_t *)(&arg[i * 4]));
+                   *(uint32_t *)(&arg[i * 4]));
                TI_INC(index, TI_CMD_RING_CNT);
        }
        CSR_WRITE_4(sc, TI_MB_CMDPROD_IDX, index);
@@ -561,7 +563,7 @@
 {
        char *ptr;
        int i;
-       struct ti_jpool_entry   *entry;
+       struct ti_jpool_entry   *entry;
        bus_dma_segment_t dmaseg;
        int error, dmanseg;
 
@@ -576,7 +578,7 @@
 
        if ((error = bus_dmamem_map(sc->sc_dmat, &dmaseg, dmanseg,
            TI_JMEM, (void **)&sc->ti_cdata.ti_jumbo_buf,
-           BUS_DMA_NOWAIT|BUS_DMA_COHERENT)) != 0) {
+           BUS_DMA_NOWAIT | BUS_DMA_COHERENT)) != 0) {
                aprint_error_dev(sc->sc_dev,
                    "can't map jumbo buffer, error = %d\n", error);
                return (error);
@@ -634,7 +636,7 @@
 static void *
 ti_jalloc(struct ti_softc *sc)
 {
-       struct ti_jpool_entry   *entry;
+       struct ti_jpool_entry   *entry;
 
        entry = SIMPLEQ_FIRST(&sc->ti_jfree_listhead);
 
@@ -656,8 +658,8 @@
 ti_jfree(struct mbuf *m, void *tbuf, size_t size, void *arg)
 {
        struct ti_softc         *sc;
-       int                     i, s;
-       struct ti_jpool_entry   *entry;
+       int                     i, s;
+       struct ti_jpool_entry   *entry;
 
        /* Extract the softc struct pointer. */
        sc = (struct ti_softc *)arg;
@@ -688,7 +690,7 @@
 
 
 /*
- * Intialize a standard receive ring descriptor.
+ * Initialize a standard receive ring descriptor.
  */
 static int
 ti_newbuf_std(struct ti_softc *sc, int i, struct mbuf *m, bus_dmamap_t dmamap)
@@ -730,7 +732,7 @@
 
                if ((error = bus_dmamap_load(sc->sc_dmat, dmamap,
                                mtod(m_new, void *), m_new->m_len, NULL,
-                               BUS_DMA_READ|BUS_DMA_NOWAIT)) != 0) {
+                               BUS_DMA_READ | BUS_DMA_NOWAIT)) != 0) {
                        aprint_error_dev(sc->sc_dev,
                            "can't load recv map, error = %d\n", error);
                        m_freem(m_new);
@@ -762,7 +764,7 @@
 }
 
 /*
- * Intialize a mini receive ring descriptor. This only applies to
+ * Initialize a mini receive ring descriptor. This only applies to
  * the Tigon 2.
  */
 static int
@@ -797,7 +799,7 @@
 
                if ((error = bus_dmamap_load(sc->sc_dmat, dmamap,
                                mtod(m_new, void *), m_new->m_len, NULL,
-                               BUS_DMA_READ|BUS_DMA_NOWAIT)) != 0) {
+                               BUS_DMA_READ | BUS_DMA_NOWAIT)) != 0) {
                        aprint_error_dev(sc->sc_dev,
                            "can't load recv map, error = %d\n", error);
                        m_freem(m_new);
@@ -839,7 +841,7 @@
        struct ti_rx_desc       *r;
 
        if (m == NULL) {
-               void *                  tbuf = NULL;
+               void *          tbuf = NULL;
 
                /* Allocate the mbuf. */
                MGETHDR(m_new, M_DONTWAIT, MT_DATA);
@@ -903,7 +905,7 @@
        for (i = 0; i < TI_SSLOTS; i++) {
                if (ti_newbuf_std(sc, i, NULL, 0) == ENOBUFS)
                        return (ENOBUFS);
-       };
+       }
 
        TI_UPDATE_STDPROD(sc, i - 1);
        sc->ti_std = i - 1;
@@ -941,7 +943,7 @@
        for (i = 0; i < TI_JUMBO_RX_RING_CNT; i++) {
                if (ti_newbuf_jumbo(sc, i, NULL) == ENOBUFS)
                        return (ENOBUFS);
-       };
+       }
 
        TI_UPDATE_JUMBOPROD(sc, i - 1);
        sc->ti_jumbo = i - 1;
@@ -974,7 +976,7 @@
        for (i = 0; i < TI_MSLOTS; i++) {
                if (ti_newbuf_mini(sc, i, NULL, 0) == ENOBUFS)
                        return (ENOBUFS);
-       };
+       }
 
        TI_UPDATE_MINIPROD(sc, i - 1);
        sc->ti_mini = i - 1;
@@ -1076,10 +1078,10 @@
 ti_add_mcast(struct ti_softc *sc, struct ether_addr *addr)
 {
        struct ti_cmd_desc      cmd;
-       u_int16_t               *m;
-       u_int32_t               ext[2] = {0, 0};
-
-       m = (u_int16_t *)&addr->ether_addr_octet[0]; /* XXX */
+       uint16_t                *m;
+       uint32_t                ext[2] = {0, 0};
+
+       m = (uint16_t *)&addr->ether_addr_octet[0]; /* XXX */
 
        switch (sc->ti_hwrev) {
        case TI_HWREV_TIGON:
@@ -1104,10 +1106,10 @@
 ti_del_mcast(struct ti_softc *sc, struct ether_addr *addr)
 {
        struct ti_cmd_desc      cmd;
-       u_int16_t               *m;
-       u_int32_t               ext[2] = {0, 0};
-
-       m = (u_int16_t *)&addr->ether_addr_octet[0]; /* XXX */
+       uint16_t                *m;
+       uint32_t                ext[2] = {0, 0};
+
+       m = (uint16_t *)&addr->ether_addr_octet[0]; /* XXX */
 
        switch (sc->ti_hwrev) {
        case TI_HWREV_TIGON:
@@ -1148,9 +1150,9 @@
        struct ifnet            *ifp;
        struct ti_cmd_desc      cmd;
        struct ti_mc_entry      *mc;



Home | Main Index | Thread Index | Old Index