PERFORCE change 158407 for review
John Baldwin
jhb at FreeBSD.org
Fri Feb 27 13:14:16 PST 2009
http://perforce.freebsd.org/chv.cgi?CH=158407
Change 158407 by jhb at jhb_jhbbsd on 2009/02/27 21:13:56
IFC @158406
Affected files ...
.. //depot/projects/smpng/sys/dev/ata/ata-usb.c#10 integrate
.. //depot/projects/smpng/sys/dev/bce/if_bce.c#25 integrate
.. //depot/projects/smpng/sys/dev/bce/if_bcefw.h#7 integrate
.. //depot/projects/smpng/sys/dev/bce/if_bcereg.h#14 integrate
.. //depot/projects/smpng/sys/dev/sound/usb/uaudio.c#22 integrate
.. //depot/projects/smpng/sys/dev/usb/bluetooth/ubtbcmfw.c#2 integrate
.. //depot/projects/smpng/sys/dev/usb/image/uscanner.c#2 integrate
.. //depot/projects/smpng/sys/dev/usb/input/uhid.c#2 integrate
.. //depot/projects/smpng/sys/dev/usb/input/ums.c#3 integrate
.. //depot/projects/smpng/sys/dev/usb/misc/ufm.c#2 integrate
.. //depot/projects/smpng/sys/dev/usb/serial/ulpt.c#2 integrate
.. //depot/projects/smpng/sys/dev/usb/storage/urio.c#2 integrate
.. //depot/projects/smpng/sys/dev/usb/usb_bus.h#2 integrate
.. //depot/projects/smpng/sys/dev/usb/usb_core.h#3 integrate
.. //depot/projects/smpng/sys/dev/usb/usb_dev.c#3 integrate
.. //depot/projects/smpng/sys/dev/usb/usb_dev.h#2 integrate
.. //depot/projects/smpng/sys/dev/usb/usb_device.c#3 integrate
.. //depot/projects/smpng/sys/dev/usb/usb_device.h#3 integrate
.. //depot/projects/smpng/sys/dev/usb/usb_generic.c#3 integrate
.. //depot/projects/smpng/sys/dev/usb/usb_ioctl.h#3 integrate
.. //depot/projects/smpng/sys/fs/msdosfs/denode.h#17 integrate
.. //depot/projects/smpng/sys/fs/msdosfs/msdosfs_denode.c#33 integrate
.. //depot/projects/smpng/sys/fs/msdosfs/msdosfs_vfsops.c#62 integrate
.. //depot/projects/smpng/sys/fs/msdosfs/msdosfs_vnops.c#48 integrate
.. //depot/projects/smpng/sys/fs/msdosfs/msdosfsmount.h#15 integrate
.. //depot/projects/smpng/sys/fs/udf/udf_vnops.c#49 integrate
.. //depot/projects/smpng/sys/netinet/sctp_crc32.c#10 integrate
.. //depot/projects/smpng/sys/netinet/sctp_input.c#24 integrate
.. //depot/projects/smpng/sys/netinet/sctp_output.c#26 integrate
.. //depot/projects/smpng/sys/netinet/sctp_output.h#11 integrate
.. //depot/projects/smpng/sys/netinet/sctp_usrreq.c#25 integrate
.. //depot/projects/smpng/sys/sys/param.h#136 integrate
Differences ...
==== //depot/projects/smpng/sys/dev/ata/ata-usb.c#10 (text) ====
@@ -28,7 +28,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/ata/ata-usb.c,v 1.12 2009/02/23 21:19:18 thompsa Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/ata/ata-usb.c,v 1.13 2009/02/27 19:27:33 mav Exp $");
#include "usbdevs.h"
#include <dev/usb/usb.h>
@@ -322,6 +322,7 @@
struct usb2_interface_descriptor *id;
const char *proto, *subclass;
struct usb2_device_request request;
+ device_t child;
uint16_t i;
uint8_t maxlun;
uint8_t has_intr;
@@ -413,11 +414,11 @@
/* ata channels are children to this USB control device */
for (i = 0; i <= sc->maxlun; i++) {
- if (!device_add_child(sc->dev, "ata",
- devclass_find_free_unit(ata_devclass, 2))) {
- device_printf(sc->dev, "failed to attach ata child device\n");
- goto detach;
- }
+ if ((child = device_add_child(sc->dev, "ata",
+ devclass_find_free_unit(ata_devclass, 2))) == NULL) {
+ device_printf(sc->dev, "failed to add ata child device\n");
+ } else
+ device_set_ivars(child, (void *)(intptr_t)i);
}
bus_generic_attach(sc->dev);
@@ -957,23 +958,10 @@
static int
ata_usbchannel_probe(device_t dev)
{
- struct ata_channel *ch = device_get_softc(dev);
- device_t *children;
- int count, i;
char buffer[32];
- /* take care of green memory */
- bzero(ch, sizeof(struct ata_channel));
-
- /* find channel number on this controller */
- if (!device_get_children(device_get_parent(dev), &children, &count)) {
- for (i = 0; i < count; i++) {
- if (children[i] == dev)
- ch->unit = i;
- }
- free(children, M_TEMP);
- }
- snprintf(buffer, sizeof(buffer), "USB lun %d", ch->unit);
+ snprintf(buffer, sizeof(buffer), "USB lun %d",
+ (int)(intptr_t)device_get_ivars(dev));
device_set_desc_copy(dev, buffer);
return (0);
@@ -984,8 +972,13 @@
{
struct ata_channel *ch = device_get_softc(dev);
+ if (ch->attached)
+ return (0);
+ ch->attached = 1;
+
/* initialize the softc basics */
ch->dev = dev;
+ ch->unit = (intptr_t)device_get_ivars(dev);
ch->state = ATA_IDLE;
ch->hw.begin_transaction = ata_usbchannel_begin_transaction;
ch->hw.end_transaction = ata_usbchannel_end_transaction;
@@ -1015,6 +1008,10 @@
device_t *children;
int nchildren, i;
+ if (!ch->attached)
+ return (0);
+ ch->attached = 0;
+
/* detach & delete all children */
if (!device_get_children(dev, &children, &nchildren)) {
for (i = 0; i < nchildren; i++)
==== //depot/projects/smpng/sys/dev/bce/if_bce.c#25 (text) ====
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2006-2008 Broadcom Corporation
+ * Copyright (c) 2006-2009 Broadcom Corporation
* David Christensen <davidch at broadcom.com>. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -29,7 +29,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/bce/if_bce.c,v 1.50 2009/01/15 22:28:05 delphij Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/bce/if_bce.c,v 1.51 2009/02/27 19:25:06 davidch Exp $");
/*
* The following controllers are supported by this driver:
@@ -89,7 +89,6 @@
/****************************************************************************/
/* BCE Build Time Options */
/****************************************************************************/
-#define BCE_USE_SPLIT_HEADER 1
/* #define BCE_NVRAM_WRITE_SUPPORT 1 */
@@ -294,12 +293,12 @@
static void bce_dump_mbuf (struct bce_softc *, struct mbuf *);
static void bce_dump_tx_mbuf_chain (struct bce_softc *, u16, int);
static void bce_dump_rx_mbuf_chain (struct bce_softc *, u16, int);
-#ifdef BCE_USE_SPLIT_HEADER
+#ifdef ZERO_COPY_SOCKETS
static void bce_dump_pg_mbuf_chain (struct bce_softc *, u16, int);
#endif
static void bce_dump_txbd (struct bce_softc *, int, struct tx_bd *);
static void bce_dump_rxbd (struct bce_softc *, int, struct rx_bd *);
-#ifdef BCE_USE_SPLIT_HEADER
+#ifdef ZERO_COPY_SOCKETS
static void bce_dump_pgbd (struct bce_softc *, int, struct rx_bd *);
#endif
static void bce_dump_l2fhdr (struct bce_softc *, int, struct l2_fhdr *);
@@ -307,7 +306,7 @@
static void bce_dump_ftqs (struct bce_softc *);
static void bce_dump_tx_chain (struct bce_softc *, u16, int);
static void bce_dump_rx_chain (struct bce_softc *, u16, int);
-#ifdef BCE_USE_SPLIT_HEADER
+#ifdef ZERO_COPY_SOCKETS
static void bce_dump_pg_chain (struct bce_softc *, u16, int);
#endif
static void bce_dump_status_block (struct bce_softc *);
@@ -392,7 +391,7 @@
static void bce_fill_rx_chain (struct bce_softc *);
static void bce_free_rx_chain (struct bce_softc *);
-#ifdef BCE_USE_SPLIT_HEADER
+#ifdef ZERO_COPY_SOCKETS
static int bce_get_pg_buf (struct bce_softc *, struct mbuf *, u16 *, u16 *);
static int bce_init_pg_chain (struct bce_softc *);
static void bce_fill_pg_chain (struct bce_softc *);
@@ -597,7 +596,7 @@
/* Firmware version and device features. */
printf("F/W (0x%08X); Flags( ", sc->bce_fw_ver);
-#ifdef BCE_USE_SPLIT_HEADER
+#ifdef ZERO_COPY_SOCKETS
printf("SPLT ");
#endif
if (sc->bce_flags & BCE_MFW_ENABLE_FLAG)
@@ -1013,7 +1012,7 @@
* This may change later if the MTU size is set to
* something other than 1500.
*/
-#ifdef BCE_USE_SPLIT_HEADER
+#ifdef ZERO_COPY_SOCKETS
sc->rx_bd_mbuf_alloc_size = MHLEN;
/* Make sure offset is 16 byte aligned for hardware. */
sc->rx_bd_mbuf_align_pad = roundup2((MSIZE - MHLEN), 16) -
@@ -2753,7 +2752,7 @@
}
-#ifdef BCE_USE_SPLIT_HEADER
+#ifdef ZERO_COPY_SOCKETS
/* Free, unmap and destroy all page buffer descriptor chain pages. */
for (i = 0; i < PG_PAGES; i++ ) {
if (sc->pg_bd_chain[i] != NULL) {
@@ -2817,7 +2816,7 @@
sc->rx_mbuf_tag = NULL;
}
-#ifdef BCE_USE_SPLIT_HEADER
+#ifdef ZERO_COPY_SOCKETS
/* Unload and destroy the page mbuf maps. */
for (i = 0; i < TOTAL_PG_BD; i++) {
if (sc->pg_mbuf_map[i] != NULL) {
@@ -3267,7 +3266,7 @@
/*
* Create a DMA tag for RX mbufs.
*/
-#ifdef BCE_USE_SPLIT_HEADER
+#ifdef ZERO_COPY_SOCKETS
max_size = max_seg_size = ((sc->rx_bd_mbuf_alloc_size < MCLBYTES) ?
MCLBYTES : sc->rx_bd_mbuf_alloc_size);
#else
@@ -3303,7 +3302,7 @@
}
}
-#ifdef BCE_USE_SPLIT_HEADER
+#ifdef ZERO_COPY_SOCKETS
/*
* Create a DMA tag for the page buffer descriptor chain,
* allocate and clear the memory, and fetch the physical
@@ -4384,7 +4383,7 @@
bce_disable_intr(sc);
/* Free RX buffers. */
-#ifdef BCE_USE_SPLIT_HEADER
+#ifdef ZERO_COPY_SOCKETS
bce_free_pg_chain(sc);
#endif
bce_free_rx_chain(sc);
@@ -4822,7 +4821,7 @@
goto bce_get_rx_buf_exit);
/* This is a new mbuf allocation. */
-#ifdef BCE_USE_SPLIT_HEADER
+#ifdef ZERO_COPY_SOCKETS
MGETHDR(m_new, M_DONTWAIT, MT_DATA);
#else
if (sc->rx_bd_mbuf_alloc_size <= MCLBYTES)
@@ -4901,7 +4900,7 @@
}
-#ifdef BCE_USE_SPLIT_HEADER
+#ifdef ZERO_COPY_SOCKETS
/****************************************************************************/
/* Encapsulate an mbuf cluster into the page chain. */
/* */
@@ -5010,7 +5009,7 @@
return(rc);
}
-#endif /* BCE_USE_SPLIT_HEADER */
+#endif /* ZERO_COPY_SOCKETS */
/****************************************************************************/
/* Initialize the TX context memory. */
@@ -5368,7 +5367,7 @@
}
-#ifdef BCE_USE_SPLIT_HEADER
+#ifdef ZERO_COPY_SOCKETS
/****************************************************************************/
/* Allocate memory and initialize the page data structures. */
/* Assumes that bce_init_rx_chain() has not already been called. */
@@ -5534,7 +5533,7 @@
DBEXIT(BCE_VERBOSE_RESET | BCE_VERBOSE_RECV | BCE_VERBOSE_UNLOAD);
}
-#endif /* BCE_USE_SPLIT_HEADER */
+#endif /* ZERO_COPY_SOCKETS */
/****************************************************************************/
@@ -5707,7 +5706,7 @@
unsigned int pkt_len;
u16 sw_rx_cons, sw_rx_cons_idx, hw_rx_cons;
u32 status;
-#ifdef BCE_USE_SPLIT_HEADER
+#ifdef ZERO_COPY_SOCKETS
unsigned int rem_len;
u16 sw_pg_cons, sw_pg_cons_idx;
#endif
@@ -5723,7 +5722,7 @@
bus_dmamap_sync(sc->rx_bd_chain_tag,
sc->rx_bd_chain_map[i], BUS_DMASYNC_POSTWRITE);
-#ifdef BCE_USE_SPLIT_HEADER
+#ifdef ZERO_COPY_SOCKETS
/* Prepare the page chain pages to be accessed by the host CPU. */
for (int i = 0; i < PG_PAGES; i++)
bus_dmamap_sync(sc->pg_bd_chain_tag,
@@ -5735,7 +5734,7 @@
/* Get working copies of the driver's view of the consumer indices. */
sw_rx_cons = sc->rx_cons;
-#ifdef BCE_USE_SPLIT_HEADER
+#ifdef ZERO_COPY_SOCKETS
sw_pg_cons = sc->pg_cons;
#endif
@@ -5797,7 +5796,7 @@
*/
m_adj(m0, sizeof(struct l2_fhdr) + ETHER_ALIGN);
-#ifdef BCE_USE_SPLIT_HEADER
+#ifdef ZERO_COPY_SOCKETS
/*
* Check whether the received frame fits in a single
* mbuf or not (i.e. packet data + FCS <=
@@ -5970,7 +5969,7 @@
if (m0) {
/* Make sure we don't lose our place when we release the lock. */
sc->rx_cons = sw_rx_cons;
-#ifdef BCE_USE_SPLIT_HEADER
+#ifdef ZERO_COPY_SOCKETS
sc->pg_cons = sw_pg_cons;
#endif
@@ -5980,7 +5979,7 @@
/* Recover our place. */
sw_rx_cons = sc->rx_cons;
-#ifdef BCE_USE_SPLIT_HEADER
+#ifdef ZERO_COPY_SOCKETS
sw_pg_cons = sc->pg_cons;
#endif
}
@@ -5991,7 +5990,7 @@
}
/* No new packets to process. Refill the RX and page chains and exit. */
-#ifdef BCE_USE_SPLIT_HEADER
+#ifdef ZERO_COPY_SOCKETS
sc->pg_cons = sw_pg_cons;
bce_fill_pg_chain(sc);
#endif
@@ -6003,7 +6002,7 @@
bus_dmamap_sync(sc->rx_bd_chain_tag,
sc->rx_bd_chain_map[i], BUS_DMASYNC_PREWRITE);
-#ifdef BCE_USE_SPLIT_HEADER
+#ifdef ZERO_COPY_SOCKETS
for (int i = 0; i < PG_PAGES; i++)
bus_dmamap_sync(sc->pg_bd_chain_tag,
sc->pg_bd_chain_map[i], BUS_DMASYNC_PREWRITE);
@@ -6249,7 +6248,7 @@
* Calculate and program the hardware Ethernet MTU
* size. Be generous on the receive if we have room.
*/
-#ifdef BCE_USE_SPLIT_HEADER
+#ifdef ZERO_COPY_SOCKETS
if (ifp->if_mtu <= (sc->rx_bd_mbuf_data_len + sc->pg_bd_mbuf_alloc_size))
ether_mtu = sc->rx_bd_mbuf_data_len + sc->pg_bd_mbuf_alloc_size;
#else
@@ -6281,7 +6280,7 @@
/* Program appropriate promiscuous/multicast filtering. */
bce_set_rx_mode(sc);
-#ifdef BCE_USE_SPLIT_HEADER
+#ifdef ZERO_COPY_SOCKETS
/* Init page buffer descriptor chain. */
bce_init_pg_chain(sc);
#endif
@@ -6794,7 +6793,7 @@
BCE_LOCK(sc);
ifp->if_mtu = ifr->ifr_mtu;
ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
-#ifdef BCE_USE_SPLIT_HEADER
+#ifdef ZERO_COPY_SOCKETS
/* No buffer allocation size changes are necessary. */
#else
/* Recalculate our buffer allocation sizes. */
@@ -7495,7 +7494,7 @@
bce_stats_update(sc);
/* Top off the receive and page chains. */
-#ifdef BCE_USE_SPLIT_HEADER
+#ifdef ZERO_COPY_SOCKETS
bce_fill_pg_chain(sc);
#endif
bce_fill_rx_chain(sc);
@@ -7675,7 +7674,7 @@
}
-#ifdef BCE_USE_SPLIT_HEADER
+#ifdef ZERO_COPY_SOCKETS
/****************************************************************************/
/* Provides a sysctl interface to allow dumping the page chain. */
/* */
@@ -8248,7 +8247,7 @@
(void *)sc, 0,
bce_sysctl_dump_tx_chain, "I", "Dump tx_bd chain");
-#ifdef BCE_USE_SPLIT_HEADER
+#ifdef ZERO_COPY_SOCKETS
SYSCTL_ADD_PROC(ctx, children, OID_AUTO,
"dump_pg_chain", CTLTYPE_INT | CTLFLAG_RW,
(void *)sc, 0,
@@ -8543,7 +8542,7 @@
}
-#ifdef BCE_USE_SPLIT_HEADER
+#ifdef ZERO_COPY_SOCKETS
/****************************************************************************/
/* Prints out the mbufs in the mbuf page chain. */
/* */
@@ -8667,7 +8666,7 @@
}
-#ifdef BCE_USE_SPLIT_HEADER
+#ifdef ZERO_COPY_SOCKETS
/****************************************************************************/
/* Prints out a rx_bd structure in the page chain. */
/* */
@@ -9154,7 +9153,7 @@
}
-#ifdef BCE_USE_SPLIT_HEADER
+#ifdef ZERO_COPY_SOCKETS
/****************************************************************************/
/* Prints out the page chain. */
/* */
@@ -9635,7 +9634,7 @@
"0x%08X:%08X - (sc->rx_bd_chain) rx_bd chain virtual address\n",
val_hi, val_lo);
-#ifdef BCE_USE_SPLIT_HEADER
+#ifdef ZERO_COPY_SOCKETS
val_hi = BCE_ADDR_HI(sc->pg_bd_chain);
val_lo = BCE_ADDR_LO(sc->pg_bd_chain);
BCE_PRINTF(
@@ -9655,7 +9654,7 @@
"0x%08X:%08X - (sc->rx_mbuf_ptr) rx mbuf chain virtual address\n",
val_hi, val_lo);
-#ifdef BCE_USE_SPLIT_HEADER
+#ifdef ZERO_COPY_SOCKETS
val_hi = BCE_ADDR_HI(sc->pg_mbuf_ptr);
val_lo = BCE_ADDR_LO(sc->pg_mbuf_ptr);
BCE_PRINTF(
@@ -9708,7 +9707,7 @@
BCE_PRINTF(" 0x%08X - (sc->free_rx_bd) free rx_bd's\n",
sc->free_rx_bd);
-#ifdef BCE_USE_SPLIT_HEADER
+#ifdef ZERO_COPY_SOCKETS
BCE_PRINTF(" 0x%04X(0x%04X) - (sc->pg_prod) page producer index\n",
sc->pg_prod, (u16) PG_CHAIN_IDX(sc->pg_prod));
@@ -10218,7 +10217,7 @@
bce_dump_tpat_state(sc, 0);
bce_dump_cp_state(sc, 0);
bce_dump_com_state(sc, 0);
-#ifdef BCE_USE_SPLIT_HEADER
+#ifdef ZERO_COPY_SOCKETS
bce_dump_pgbd(sc, 0, NULL);
bce_dump_pg_mbuf_chain(sc, 0, USABLE_PG_BD);
bce_dump_pg_chain(sc, 0, USABLE_PG_BD);
==== //depot/projects/smpng/sys/dev/bce/if_bcefw.h#7 (text) ====
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2006-2008 Broadcom Corporation
+ * Copyright (c) 2006-2009 Broadcom Corporation
* David Christensen <davidch at broadcom.com>. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -26,7 +26,7 @@
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*
- * $FreeBSD: src/sys/dev/bce/if_bcefw.h,v 1.7 2008/06/13 01:16:37 davidch Exp $
+ * $FreeBSD: src/sys/dev/bce/if_bcefw.h,v 1.8 2009/02/27 19:25:06 davidch Exp $
*/
/*
==== //depot/projects/smpng/sys/dev/bce/if_bcereg.h#14 (text) ====
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2006-2008 Broadcom Corporation
+ * Copyright (c) 2006-2009 Broadcom Corporation
* David Christensen <davidch at broadcom.com>. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -26,7 +26,7 @@
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*
- * $FreeBSD: src/sys/dev/bce/if_bcereg.h,v 1.22 2008/11/22 05:55:56 kmacy Exp $
+ * $FreeBSD: src/sys/dev/bce/if_bcereg.h,v 1.23 2009/02/27 19:25:06 davidch Exp $
*/
#ifndef _BCE_H_DEFINED
@@ -6206,6 +6206,7 @@
#define RX_PAGE(x) (((x) & ~USABLE_RX_BD_PER_PAGE) >> (BCM_PAGE_BITS - 4))
#define RX_IDX(x) ((x) & USABLE_RX_BD_PER_PAGE)
+#ifdef ZERO_COPY_SOCKETS
/*
* To accomodate jumbo frames, the page chain should
* be 4 times larger than the receive chain.
@@ -6226,6 +6227,8 @@
#define PG_PAGE(x) (((x) & ~USABLE_PG_BD_PER_PAGE) >> (BCM_PAGE_BITS - 4))
#define PG_IDX(x) ((x) & USABLE_PG_BD_PER_PAGE)
+#endif /* ZERO_COPY_SOCKETS */
+
/* Context size. */
#define CTX_SHIFT 7
#define CTX_SIZE (1 << CTX_SHIFT)
@@ -6499,8 +6502,11 @@
u16 tx_prod;
u16 tx_cons;
u32 tx_prod_bseq; /* Counts the bytes used. */
+
+#ifdef ZERO_COPY_SOCKETS
u16 pg_prod;
u16 pg_cons;
+#endif
int bce_link;
struct callout bce_tick_callout;
@@ -6513,7 +6519,10 @@
int rx_bd_mbuf_alloc_size;
int rx_bd_mbuf_data_len;
int rx_bd_mbuf_align_pad;
+
+#ifdef ZERO_COPY_SOCKETS
int pg_bd_mbuf_alloc_size;
+#endif
/* Receive mode settings (i.e promiscuous, multicast, etc.). */
u32 rx_mode;
@@ -6533,11 +6542,13 @@
struct rx_bd *rx_bd_chain[RX_PAGES];
bus_addr_t rx_bd_chain_paddr[RX_PAGES];
+#ifdef ZERO_COPY_SOCKETS
/* H/W maintained page buffer descriptor chain structure. */
bus_dma_tag_t pg_bd_chain_tag;
bus_dmamap_t pg_bd_chain_map[PG_PAGES];
struct rx_bd *pg_bd_chain[PG_PAGES];
bus_addr_t pg_bd_chain_paddr[PG_PAGES];
+#endif
/* H/W maintained status block. */
bus_dma_tag_t status_tag;
@@ -6567,7 +6578,10 @@
/* Bus tag for RX/TX mbufs. */
bus_dma_tag_t rx_mbuf_tag;
bus_dma_tag_t tx_mbuf_tag;
+
+#ifdef ZERO_COPY_SOCKETS
bus_dma_tag_t pg_mbuf_tag;
+#endif
/* S/W maintained mbuf TX chain structure. */
bus_dmamap_t tx_mbuf_map[TOTAL_TX_BD];
@@ -6577,17 +6591,22 @@
bus_dmamap_t rx_mbuf_map[TOTAL_RX_BD];
struct mbuf *rx_mbuf_ptr[TOTAL_RX_BD];
+#ifdef ZERO_COPY_SOCKETS
/* S/W maintained mbuf page chain structure. */
bus_dmamap_t pg_mbuf_map[TOTAL_PG_BD];
struct mbuf *pg_mbuf_ptr[TOTAL_PG_BD];
+#endif
/* Track the number of buffer descriptors in use. */
u16 free_rx_bd;
u16 max_rx_bd;
u16 used_tx_bd;
u16 max_tx_bd;
+
+#ifdef ZERO_COPY_SOCKETS
u16 free_pg_bd;
u16 max_pg_bd;
+#endif
/* Provides access to hardware statistics through sysctl. */
u64 stat_IfHCInOctets;
@@ -6661,7 +6680,10 @@
/* Track the number of enqueued mbufs. */
int debug_tx_mbuf_alloc;
int debug_rx_mbuf_alloc;
+
+#ifdef ZERO_COPY_SOCKETS
int debug_pg_mbuf_alloc;
+#endif
/* Track how many and what type of interrupts are generated. */
u32 interrupts_generated;
@@ -6676,8 +6698,10 @@
u32 rx_low_watermark; /* Lowest number of rx_bd's free. */
u32 rx_empty_count; /* Number of times the RX chain was empty. */
+#ifdef ZERO_COPY_SOCKETS
u32 pg_low_watermark; /* Lowest number of pages free. */
u32 pg_empty_count; /* Number of times the page chain was empty. */
+#endif
u32 tx_hi_watermark; /* Greatest number of tx_bd's used. */
u32 tx_full_count; /* Number of times the TX chain was full. */
@@ -6693,5 +6717,5 @@
#endif
};
-#endif /* #ifndef _BCE_H_DEFINED */
+#endif /* __BCEREG_H_DEFINED */
==== //depot/projects/smpng/sys/dev/sound/usb/uaudio.c#22 (text+ko) ====
@@ -1,5 +1,5 @@
/* $NetBSD: uaudio.c,v 1.91 2004/11/05 17:46:14 kent Exp $ */
-/* $FreeBSD: src/sys/dev/sound/usb/uaudio.c,v 1.39 2009/02/23 21:19:18 thompsa Exp $ */
+/* $FreeBSD: src/sys/dev/sound/usb/uaudio.c,v 1.40 2009/02/27 17:27:16 thompsa Exp $ */
/*-
* Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -379,9 +379,9 @@
static void umidi_stop_read(struct usb2_fifo *);
static void umidi_start_write(struct usb2_fifo *);
static void umidi_stop_write(struct usb2_fifo *);
-static int umidi_open(struct usb2_fifo *, int, struct thread *);
-static int umidi_ioctl(struct usb2_fifo *, u_long cmd, void *, int, struct thread *);
-static void umidi_close(struct usb2_fifo *, int, struct thread *);
+static int umidi_open(struct usb2_fifo *, int);
+static int umidi_ioctl(struct usb2_fifo *, u_long cmd, void *, int);
+static void umidi_close(struct usb2_fifo *, int);
static void umidi_init(device_t dev);
static int32_t umidi_probe(device_t dev);
static int32_t umidi_detach(device_t dev);
@@ -3585,7 +3585,7 @@
}
static int
-umidi_open(struct usb2_fifo *fifo, int fflags, struct thread *td)
+umidi_open(struct usb2_fifo *fifo, int fflags)
{
struct umidi_chan *chan = fifo->priv_sc0;
struct umidi_sub_chan *sub = umidi_sub_by_fifo(fifo);
@@ -3617,7 +3617,7 @@
}
static void
-umidi_close(struct usb2_fifo *fifo, int fflags, struct thread *td)
+umidi_close(struct usb2_fifo *fifo, int fflags)
{
if (fflags & FREAD) {
usb2_fifo_free_buffer(fifo);
@@ -3630,7 +3630,7 @@
static int
umidi_ioctl(struct usb2_fifo *fifo, u_long cmd, void *data,
- int fflags, struct thread *td)
+ int fflags)
{
return (ENODEV);
}
@@ -3684,9 +3684,6 @@
(chan->max_cable == 0)) {
chan->max_cable = UMIDI_CABLES_MAX;
}
- /* set interface permissions */
- usb2_set_iface_perm(sc->sc_udev, chan->iface_index,
- UID_ROOT, GID_OPERATOR, 0644);
for (n = 0; n < chan->max_cable; n++) {
@@ -3694,7 +3691,8 @@
error = usb2_fifo_attach(sc->sc_udev, chan, &chan->mtx,
&umidi_fifo_methods, &sub->fifo, unit, n,
- chan->iface_index);
+ chan->iface_index,
+ UID_ROOT, GID_OPERATOR, 0644);
if (error) {
goto detach;
}
==== //depot/projects/smpng/sys/dev/usb/bluetooth/ubtbcmfw.c#2 (text+ko) ====
@@ -28,7 +28,7 @@
* SUCH DAMAGE.
*
* $Id: ubtbcmfw.c,v 1.3 2003/10/10 19:15:08 max Exp $
- * $FreeBSD: src/sys/dev/usb/bluetooth/ubtbcmfw.c,v 1.1 2009/02/23 18:31:00 thompsa Exp $
+ * $FreeBSD: src/sys/dev/usb/bluetooth/ubtbcmfw.c,v 1.2 2009/02/27 17:27:16 thompsa Exp $
*/
#include "usbdevs.h"
@@ -211,13 +211,10 @@
goto detach;
}
- /* Set interface permissions */
- usb2_set_iface_perm(uaa->device, uaa->info.bIfaceIndex,
- UID_ROOT, GID_OPERATOR, 0644);
-
error = usb2_fifo_attach(uaa->device, sc, &sc->sc_mtx,
&ubtbcmfw_fifo_methods, &sc->sc_fifo,
- device_get_unit(dev), 0 - 1, uaa->info.bIfaceIndex);
+ device_get_unit(dev), 0 - 1, uaa->info.bIfaceIndex,
+ UID_ROOT, GID_OPERATOR, 0644);
if (error != 0) {
device_printf(dev, "could not attach fifo. %s\n",
usb2_errstr(error));
@@ -369,7 +366,7 @@
*/
static int
-ubtbcmfw_open(struct usb2_fifo *fifo, int fflags, struct thread *td)
+ubtbcmfw_open(struct usb2_fifo *fifo, int fflags)
{
struct ubtbcmfw_softc *sc = fifo->priv_sc0;
struct usb2_xfer *xfer;
@@ -398,7 +395,7 @@
*/
static void
-ubtbcmfw_close(struct usb2_fifo *fifo, int fflags, struct thread *td)
+ubtbcmfw_close(struct usb2_fifo *fifo, int fflags)
{
if (fflags & (FREAD | FWRITE))
usb2_fifo_free_buffer(fifo);
@@ -410,7 +407,7 @@
static int
ubtbcmfw_ioctl(struct usb2_fifo *fifo, u_long cmd, void *data,
- int fflags, struct thread *td)
+ int fflags)
{
struct ubtbcmfw_softc *sc = fifo->priv_sc0;
int error = 0;
==== //depot/projects/smpng/sys/dev/usb/image/uscanner.c#2 (text+ko) ====
@@ -5,7 +5,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/usb/image/uscanner.c,v 1.1 2009/02/23 18:31:00 thompsa Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/usb/image/uscanner.c,v 1.2 2009/02/27 17:27:16 thompsa Exp $");
/*-
* Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -399,13 +399,11 @@
"error=%s\n", usb2_errstr(error));
goto detach;
}
- /* set interface permissions */
- usb2_set_iface_perm(uaa->device, uaa->info.bIfaceIndex,
- UID_ROOT, GID_OPERATOR, 0644);
error = usb2_fifo_attach(uaa->device, sc, &sc->sc_mtx,
&uscanner_fifo_methods, &sc->sc_fifo,
- unit, 0 - 1, uaa->info.bIfaceIndex);
+ unit, 0 - 1, uaa->info.bIfaceIndex,
+ UID_ROOT, GID_OPERATOR, 0644);
if (error) {
goto detach;
}
@@ -553,7 +551,7 @@
* uscanner character device opening method.
*/
static int
-uscanner_open(struct usb2_fifo *fifo, int fflags, struct thread *td)
+uscanner_open(struct usb2_fifo *fifo, int fflags)
{
struct uscanner_softc *sc;
@@ -585,7 +583,7 @@
}
static void
-uscanner_close(struct usb2_fifo *fifo, int fflags, struct thread *td)
+uscanner_close(struct usb2_fifo *fifo, int fflags)
{
if (fflags & (FREAD | FWRITE)) {
usb2_fifo_free_buffer(fifo);
==== //depot/projects/smpng/sys/dev/usb/input/uhid.c#2 (text+ko) ====
@@ -5,7 +5,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/usb/input/uhid.c,v 1.1 2009/02/23 18:31:00 thompsa Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/usb/input/uhid.c,v 1.2 2009/02/27 17:27:16 thompsa Exp $");
/*-
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -447,7 +447,7 @@
}
static int
-uhid_open(struct usb2_fifo *fifo, int fflags, struct thread *td)
+uhid_open(struct usb2_fifo *fifo, int fflags)
{
struct uhid_softc *sc = fifo->priv_sc0;
@@ -474,7 +474,7 @@
}
static void
-uhid_close(struct usb2_fifo *fifo, int fflags, struct thread *td)
+uhid_close(struct usb2_fifo *fifo, int fflags)
{
if (fflags & (FREAD | FWRITE)) {
usb2_fifo_free_buffer(fifo);
@@ -483,7 +483,7 @@
static int
uhid_ioctl(struct usb2_fifo *fifo, u_long cmd, void *addr,
- int fflags, struct thread *td)
+ int fflags)
{
struct uhid_softc *sc = fifo->priv_sc0;
struct usb2_gen_descriptor *ugd;
@@ -734,13 +734,11 @@
sc->sc_fsize);
sc->sc_fsize = UHID_BSIZE;
}
- /* set interface permissions */
- usb2_set_iface_perm(uaa->device, uaa->info.bIfaceIndex,
- UID_ROOT, GID_OPERATOR, 0644);
error = usb2_fifo_attach(uaa->device, sc, &sc->sc_mtx,
&uhid_fifo_methods, &sc->sc_fifo,
- unit, 0 - 1, uaa->info.bIfaceIndex);
+ unit, 0 - 1, uaa->info.bIfaceIndex,
+ UID_ROOT, GID_OPERATOR, 0644);
if (error) {
goto detach;
}
==== //depot/projects/smpng/sys/dev/usb/input/ums.c#3 (text+ko) ====
@@ -36,7 +36,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/usb/input/ums.c,v 1.2 2009/02/24 03:34:05 thompsa Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/usb/input/ums.c,v 1.3 2009/02/27 17:27:16 thompsa Exp $");
/*
* HID spec: http://www.usb.org/developers/devclass_docs/HID1_11.pdf
@@ -583,13 +583,10 @@
sc->sc_status.dy = 0;
sc->sc_status.dz = 0;
- /* set interface permissions */
- usb2_set_iface_perm(uaa->device, uaa->info.bIfaceIndex,
- UID_ROOT, GID_OPERATOR, 0644);
-
err = usb2_fifo_attach(uaa->device, sc, &sc->sc_mtx,
&ums_fifo_methods, &sc->sc_fifo,
- unit, 0 - 1, uaa->info.bIfaceIndex);
+ unit, 0 - 1, uaa->info.bIfaceIndex,
+ UID_ROOT, GID_OPERATOR, 0644);
if (err) {
goto detach;
}
@@ -697,7 +694,7 @@
}
static int
-ums_open(struct usb2_fifo *fifo, int fflags, struct thread *td)
+ums_open(struct usb2_fifo *fifo, int fflags)
{
struct ums_softc *sc = fifo->priv_sc0;
@@ -724,7 +721,7 @@
}
static void
-ums_close(struct usb2_fifo *fifo, int fflags, struct thread *td)
+ums_close(struct usb2_fifo *fifo, int fflags)
{
if (fflags & FREAD) {
usb2_fifo_free_buffer(fifo);
@@ -732,8 +729,7 @@
}
static int
-ums_ioctl(struct usb2_fifo *fifo, u_long cmd, void *addr,
- int fflags, struct thread *td)
+ums_ioctl(struct usb2_fifo *fifo, u_long cmd, void *addr, int fflags)
{
struct ums_softc *sc = fifo->priv_sc0;
mousemode_t mode;
==== //depot/projects/smpng/sys/dev/usb/misc/ufm.c#2 (text+ko) ====
@@ -29,7 +29,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/usb/misc/ufm.c,v 1.1 2009/02/23 18:31:00 thompsa Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/usb/misc/ufm.c,v 1.2 2009/02/27 17:27:16 thompsa Exp $");
#include "usbdevs.h"
@@ -139,13 +139,10 @@
device_set_usb2_desc(dev);
- /* set interface permissions */
- usb2_set_iface_perm(uaa->device, uaa->info.bIfaceIndex,
- UID_ROOT, GID_OPERATOR, 0644);
-
error = usb2_fifo_attach(uaa->device, sc, &sc->sc_mtx,
&ufm_fifo_methods, &sc->sc_fifo,
- device_get_unit(dev), 0 - 1, uaa->info.bIfaceIndex);
+ device_get_unit(dev), 0 - 1, uaa->info.bIfaceIndex,
+ UID_ROOT, GID_OPERATOR, 0644);
if (error) {
goto detach;
}
@@ -169,7 +166,7 @@
}
static int
-ufm_open(struct usb2_fifo *dev, int fflags, struct thread *td)
+ufm_open(struct usb2_fifo *dev, int fflags)
{
if ((fflags & (FWRITE | FREAD)) != (FWRITE | FREAD)) {
return (EACCES);
@@ -300,7 +297,7 @@
static int
ufm_ioctl(struct usb2_fifo *fifo, u_long cmd, void *addr,
- int fflags, struct thread *td)
+ int fflags)
{
struct ufm_softc *sc = fifo->priv_sc0;
int error = 0;
==== //depot/projects/smpng/sys/dev/usb/serial/ulpt.c#2 (text+ko) ====
@@ -1,5 +1,5 @@
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/usb/serial/ulpt.c,v 1.1 2009/02/23 18:31:00 thompsa Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/usb/serial/ulpt.c,v 1.2 2009/02/27 17:27:16 thompsa Exp $");
/* $NetBSD: ulpt.c,v 1.60 2003/10/04 21:19:50 augustss Exp $ */
@@ -395,7 +395,7 @@
}
static int
-ulpt_open(struct usb2_fifo *fifo, int fflags, struct thread *td)
+ulpt_open(struct usb2_fifo *fifo, int fflags)
{
struct ulpt_softc *sc = fifo->priv_sc0;
@@ -404,11 +404,11 @@
if (sc->sc_fflags == 0) {
ulpt_reset(sc);
}
- return (unlpt_open(fifo, fflags, td));
+ return (unlpt_open(fifo, fflags));
}
static int
-unlpt_open(struct usb2_fifo *fifo, int fflags, struct thread *td)
+unlpt_open(struct usb2_fifo *fifo, int fflags)
{
struct ulpt_softc *sc = fifo->priv_sc0;
>>> TRUNCATED FOR MAIL (1000 lines) <<<
More information about the p4-projects
mailing list