Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/usb - u_intNN_t -> uintNN_t



details:   https://anonhg.NetBSD.org/src/rev/dd5904447d8f
branches:  trunk
changeset: 757141:dd5904447d8f
user:      tsutsui <tsutsui%NetBSD.org@localhost>
date:      Mon Aug 16 09:44:01 2010 +0000

description:
- u_intNN_t -> uintNN_t
- use uint8_t for binary data
- use bool for boolean vaules
No binary change.

diffstat:

 sys/dev/usb/if_kue.c    |  36 ++++++++++++++++++------------------
 sys/dev/usb/if_kuereg.h |  36 ++++++++++++++++++------------------
 sys/dev/usb/kue_fw.h    |   8 ++++----
 3 files changed, 40 insertions(+), 40 deletions(-)

diffs (229 lines):

diff -r 9ef6a3e56700 -r dd5904447d8f sys/dev/usb/if_kue.c
--- a/sys/dev/usb/if_kue.c      Mon Aug 16 09:34:43 2010 +0000
+++ b/sys/dev/usb/if_kue.c      Mon Aug 16 09:44:01 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_kue.c,v 1.70 2010/08/16 09:34:43 tsutsui Exp $      */
+/*     $NetBSD: if_kue.c,v 1.71 2010/08/16 09:44:01 tsutsui Exp $      */
 /*
  * Copyright (c) 1997, 1998, 1999, 2000
  *     Bill Paul <wpaul%ee.columbia.edu@localhost>.  All rights reserved.
@@ -70,7 +70,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_kue.c,v 1.70 2010/08/16 09:34:43 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_kue.c,v 1.71 2010/08/16 09:44:01 tsutsui Exp $");
 
 #include "opt_inet.h"
 #include "rnd.h"
@@ -176,13 +176,13 @@
 Static void kue_setmulti(struct kue_softc *);
 Static void kue_reset(struct kue_softc *);
 
-Static usbd_status kue_ctl(struct kue_softc *, int, u_int8_t,
-                          u_int16_t, void *, u_int32_t);
-Static usbd_status kue_setword(struct kue_softc *, u_int8_t, u_int16_t);
+Static usbd_status kue_ctl(struct kue_softc *, int, uint8_t,
+                          uint16_t, void *, uint32_t);
+Static usbd_status kue_setword(struct kue_softc *, uint8_t, uint16_t);
 Static int kue_load_fw(struct kue_softc *);
 
 Static usbd_status
-kue_setword(struct kue_softc *sc, u_int8_t breq, u_int16_t word)
+kue_setword(struct kue_softc *sc, uint8_t breq, uint16_t word)
 {
        usb_device_request_t    req;
 
@@ -198,8 +198,8 @@
 }
 
 Static usbd_status
-kue_ctl(struct kue_softc *sc, int rw, u_int8_t breq, u_int16_t val,
-       void *data, u_int32_t len)
+kue_ctl(struct kue_softc *sc, int rw, uint8_t breq, uint16_t val,
+       void *data, uint32_t len)
 {
        usb_device_request_t    req;
 
@@ -504,7 +504,7 @@
            RND_TYPE_NET, 0);
 #endif
 
-       sc->kue_attached = 1;
+       sc->kue_attached = true;
        splx(s);
 
        usbd_add_drv_event(USB_EVENT_DRIVER_ATTACH, sc->kue_udev,
@@ -549,7 +549,7 @@
                aprint_debug_dev(self, "detach has active endpoints\n");
 #endif
 
-       sc->kue_attached = 0;
+       sc->kue_attached = false;
        splx(s);
 
        return (0);
@@ -566,7 +566,7 @@
        case DVACT_DEACTIVATE:
                /* Deactivate the interface. */
                if_deactivate(&sc->kue_ec.ec_if);
-               sc->kue_dying = 1;
+               sc->kue_dying = true;
                return 0;
        default:
                return EOPNOTSUPP;
@@ -709,18 +709,18 @@
 
        DPRINTFN(10,("%s: %s: total_len=%d len=%d\n", USBDEVNAME(sc->kue_dev),
                     __func__, total_len,
-                    UGETW(mtod(c->kue_mbuf, u_int8_t *))));
+                    UGETW(mtod(c->kue_mbuf, uint8_t *))));
 
        if (total_len <= 1)
                goto done;
 
        m = c->kue_mbuf;
        /* copy data to mbuf */
-       memcpy(mtod(m, char *), c->kue_buf, total_len);
+       memcpy(mtod(m, uint8_t *), c->kue_buf, total_len);
 
        /* No errors; receive the packet. */
-       total_len = UGETW(mtod(m, u_int8_t *));
-       m_adj(m, sizeof(u_int16_t));
+       total_len = UGETW(mtod(m, uint8_t *));
+       m_adj(m, sizeof(uint16_t));
 
        if (total_len < sizeof(struct ether_header)) {
                ifp->if_ierrors++;
@@ -839,8 +839,8 @@
        total_len += 64 - (total_len % 64);
 
        /* Frame length is specified in the first 2 bytes of the buffer. */
-       c->kue_buf[0] = (u_int8_t)m->m_pkthdr.len;
-       c->kue_buf[1] = (u_int8_t)(m->m_pkthdr.len >> 8);
+       c->kue_buf[0] = (uint8_t)m->m_pkthdr.len;
+       c->kue_buf[1] = (uint8_t)(m->m_pkthdr.len >> 8);
 
        usbd_setup_xfer(c->kue_xfer, sc->kue_ep[KUE_ENDPT_TX],
            c, c->kue_buf, total_len, USBD_NO_COPY, USBD_DEFAULT_TIMEOUT,
@@ -905,7 +905,7 @@
        struct kue_softc        *sc = xsc;
        struct ifnet            *ifp = GET_IFP(sc);
        int                     s;
-       u_char                  eaddr[ETHER_ADDR_LEN];
+       uint8_t                 eaddr[ETHER_ADDR_LEN];
 
        DPRINTFN(5,("%s: %s: enter\n", USBDEVNAME(sc->kue_dev),__func__));
 
diff -r 9ef6a3e56700 -r dd5904447d8f sys/dev/usb/if_kuereg.h
--- a/sys/dev/usb/if_kuereg.h   Mon Aug 16 09:34:43 2010 +0000
+++ b/sys/dev/usb/if_kuereg.h   Mon Aug 16 09:44:01 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_kuereg.h,v 1.13 2010/08/16 09:34:43 tsutsui Exp $   */
+/*     $NetBSD: if_kuereg.h,v 1.14 2010/08/16 09:44:01 tsutsui Exp $   */
 /*
  * Copyright (c) 1997, 1998, 1999, 2000
  *     Bill Paul <wpaul%ee.columbia.edu@localhost>.  All rights reserved.
@@ -58,14 +58,14 @@
 #define KUE_CMD_SEND_SCAN                      0xFF
 
 struct kue_ether_desc {
-       u_int8_t                kue_len;
-       u_int8_t                kue_rsvd0;
-       u_int8_t                kue_rsvd1;
-       u_int8_t                kue_macaddr[ETHER_ADDR_LEN];
-       u_int8_t                kue_etherstats[4];
-       u_int8_t                kue_maxseg[2];
-       u_int8_t                kue_mcastfilt[2];
-       u_int8_t                kue_rsvd2;
+       uint8_t                 kue_len;
+       uint8_t                 kue_rsvd0;
+       uint8_t                 kue_rsvd1;
+       uint8_t                 kue_macaddr[ETHER_ADDR_LEN];
+       uint8_t                 kue_etherstats[4];
+       uint8_t                 kue_maxseg[2];
+       uint8_t                 kue_mcastfilt[2];
+       uint8_t                 kue_rsvd2;
 };
 
 #define KUE_ETHERSTATS(x)      \
@@ -136,8 +136,8 @@
 #define KUE_ENDPT_MAX          0x3
 
 struct kue_type {
-       u_int16_t               kue_vid;
-       u_int16_t               kue_did;
+       uint16_t                kue_vid;
+       uint16_t                kue_did;
 };
 
 struct kue_softc;
@@ -145,7 +145,7 @@
 struct kue_chain {
        struct kue_softc        *kue_sc;
        usbd_xfer_handle        kue_xfer;
-       char                    *kue_buf;
+       uint8_t                 *kue_buf;
        struct mbuf             *kue_mbuf;
        int                     kue_idx;
 };
@@ -170,18 +170,18 @@
 
        usbd_device_handle      kue_udev;
        usbd_interface_handle   kue_iface;
-       u_int16_t               kue_vendor;
-       u_int16_t               kue_product;
+       uint16_t                kue_vendor;
+       uint16_t                kue_product;
        struct kue_ether_desc   kue_desc;
        int                     kue_ed[KUE_ENDPT_MAX];
        usbd_pipe_handle        kue_ep[KUE_ENDPT_MAX];
        int                     kue_if_flags;
-       u_int16_t               kue_rxfilt;
-       u_int8_t                *kue_mcfilters;
+       uint16_t                kue_rxfilt;
+       uint8_t                 *kue_mcfilters;
        struct kue_cdata        kue_cdata;
 
-       char                    kue_dying;
-       char                    kue_attached;
+       bool                    kue_dying;
+       bool                    kue_attached;
        u_int                   kue_rx_errs;
        struct timeval          kue_rx_notice;
 };
diff -r 9ef6a3e56700 -r dd5904447d8f sys/dev/usb/kue_fw.h
--- a/sys/dev/usb/kue_fw.h      Mon Aug 16 09:34:43 2010 +0000
+++ b/sys/dev/usb/kue_fw.h      Mon Aug 16 09:44:01 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: kue_fw.h,v 1.3 2001/01/19 08:54:21 jdolecek Exp $      */
+/*     $NetBSD: kue_fw.h,v 1.4 2010/08/16 09:44:01 tsutsui Exp $       */
 /*
  * Copyright (c) 1997, 1998, 1999, 2000
  *     Bill Paul <wpaul%ee.columbia.edu@localhost>.  All rights reserved.
@@ -86,7 +86,7 @@
 #define KUE_QTINTR_LOAD_CODE_HIGH      0x9C
 
 /* Firmware code segment */
-Static const unsigned char kue_code_seg[] =
+Static const uint8_t kue_code_seg[] =
 {
     /******************************************/
     /* NOTE: B6/C3 is data header signature   */
@@ -578,7 +578,7 @@
 };
 
 /* Firmware fixup (data?) segment */
-Static const unsigned char kue_fix_seg[] =
+Static const uint8_t kue_fix_seg[] =
 {
     /******************************************/
     /* NOTE: B6/C3 is data header signature   */
@@ -681,6 +681,6 @@
 
 /* Fixup command. */
 #define KUE_TRIGCMD_OFFSET     5
-Static const unsigned char kue_trig_seg[] = {
+Static const uint8_t kue_trig_seg[] = {
     0xb6, 0xc3, 0x01, 0x00, 0x06, 0x64, 0x00, 0x00
 };



Home | Main Index | Thread Index | Old Index