Date: Thu, 1 Jan 2004 22:22:28 -0800 (PST) From: Sam Leffler <sam@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 44675 for review Message-ID: <200401020622.i026MSJC081367@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=44675 Change 44675 by sam@sam_ebb on 2004/01/01 22:21:52 IFC Affected files ... .. //depot/projects/netperf+sockets/sys/amd64/amd64/pmap.c#4 integrate .. //depot/projects/netperf+sockets/sys/compat/ndis/kern_ndis.c#7 integrate .. //depot/projects/netperf+sockets/sys/compat/ndis/ndis_var.h#6 integrate .. //depot/projects/netperf+sockets/sys/compat/ndis/subr_ndis.c#7 integrate .. //depot/projects/netperf+sockets/sys/compat/ndis/subr_ntoskrnl.c#4 integrate .. //depot/projects/netperf+sockets/sys/dev/acpica/acpi_thermal.c#3 integrate .. //depot/projects/netperf+sockets/sys/dev/ed/if_ed_pccard.c#3 integrate .. //depot/projects/netperf+sockets/sys/dev/if_ndis/if_ndis.c#7 integrate .. //depot/projects/netperf+sockets/sys/dev/ips/ips_commands.c#3 integrate .. //depot/projects/netperf+sockets/sys/dev/pccard/pccarddevs#4 integrate .. //depot/projects/netperf+sockets/sys/dev/pccard/pccarddevs.h#4 integrate .. //depot/projects/netperf+sockets/sys/dev/puc/pucdata.c#4 integrate .. //depot/projects/netperf+sockets/sys/dev/usb/ubsa.c#3 integrate .. //depot/projects/netperf+sockets/sys/dev/usb/ucom.c#3 integrate .. //depot/projects/netperf+sockets/sys/dev/usb/ufm.c#2 integrate .. //depot/projects/netperf+sockets/sys/dev/usb/usbdevs#4 integrate .. //depot/projects/netperf+sockets/sys/dev/usb/usbdevs.h#4 integrate .. //depot/projects/netperf+sockets/sys/dev/usb/usbdevs_data.h#4 integrate .. //depot/projects/netperf+sockets/sys/dev/usb/uvscom.c#3 integrate .. //depot/projects/netperf+sockets/sys/i386/acpica/acpi_wakecode.S#4 integrate .. //depot/projects/netperf+sockets/sys/i386/pci/pci_cfgreg.c#3 integrate .. //depot/projects/netperf+sockets/sys/sys/copyright.h#2 integrate .. //depot/projects/netperf+sockets/sys/vm/vm_kern.c#4 integrate .. //depot/projects/netperf+sockets/sys/vm/vm_map.c#4 integrate .. //depot/projects/netperf+sockets/sys/vm/vm_object.c#4 integrate .. //depot/projects/netperf+sockets/sys/vm/vm_page.c#4 integrate Differences ... ==== //depot/projects/netperf+sockets/sys/amd64/amd64/pmap.c#4 (text+ko) ==== @@ -75,7 +75,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/amd64/amd64/pmap.c,v 1.449 2003/12/22 01:01:31 alc Exp $"); +__FBSDID("$FreeBSD: src/sys/amd64/amd64/pmap.c,v 1.450 2004/01/01 07:08:52 alc Exp $"); /* * Manages physical address maps. @@ -1079,14 +1079,11 @@ while ((pml4pg = vm_page_alloc(NULL, color++, VM_ALLOC_NOOBJ | VM_ALLOC_NORMAL | VM_ALLOC_WIRED | VM_ALLOC_ZERO)) == NULL) VM_WAIT; - vm_page_lock_queues(); - vm_page_flag_clear(pml4pg, PG_BUSY); - vm_page_unlock_queues(); pmap->pm_pml4 = (pml4_entry_t *)PHYS_TO_DMAP(VM_PAGE_TO_PHYS(pml4pg)); if ((pml4pg->flags & PG_ZERO) == 0) - bzero(pmap->pm_pml4, PAGE_SIZE); + pagezero(pmap->pm_pml4); mtx_lock_spin(&allpmaps_lock); LIST_INSERT_HEAD(&allpmaps, pmap, pm_list); @@ -1254,7 +1251,6 @@ } vm_page_lock_queues(); - vm_page_flag_clear(m, PG_ZERO); vm_page_wakeup(m); vm_page_unlock_queues(); @@ -1424,7 +1420,6 @@ m = PHYS_TO_VM_PAGE(pmap->pm_pml4[PML4PML4I]); m->wire_count--; atomic_subtract_int(&cnt.v_wire_count, 1); - vm_page_busy(m); vm_page_free(m); vm_page_unlock_queues(); } ==== //depot/projects/netperf+sockets/sys/compat/ndis/kern_ndis.c#7 (text+ko) ==== @@ -31,7 +31,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/compat/ndis/kern_ndis.c,v 1.16 2003/12/29 23:51:58 wpaul Exp $"); +__FBSDID("$FreeBSD: src/sys/compat/ndis/kern_ndis.c,v 1.18 2004/01/02 04:31:06 wpaul Exp $"); #include <sys/param.h> #include <sys/types.h> @@ -52,6 +52,8 @@ #include <sys/bus.h> #include <sys/rman.h> +#include <vm/uma.h> + #include <net/if.h> #include <net/if_arp.h> #include <net/ethernet.h> @@ -82,6 +84,8 @@ __stdcall static void ndis_getdone_func(ndis_handle, ndis_status); __stdcall static void ndis_resetdone_func(ndis_handle, ndis_status, uint8_t); +static uma_zone_t ndis_packet_zone, ndis_buffer_zone; + /* * This allows us to export our symbols to other modules. * Note that we call ourselves 'ndisapi' to avoid a namespace @@ -91,7 +95,28 @@ static int ndis_modevent(module_t mod, int cmd, void *arg) { - return(0); + int error = 0; + + switch (cmd) { + case MOD_LOAD: + ndis_packet_zone = uma_zcreate("NDIS packet", + sizeof(ndis_packet), NULL, NULL, NULL, + NULL, UMA_ALIGN_PTR, 0); + ndis_buffer_zone = uma_zcreate("NDIS buffer", + sizeof(ndis_buffer), NULL, NULL, NULL, + NULL, UMA_ALIGN_PTR, 0); + break; + case MOD_UNLOAD: + case MOD_SHUTDOWN: + uma_zdestroy(ndis_packet_zone); + uma_zdestroy(ndis_buffer_zone); + break; + default: + error = EINVAL; + break; + } + + return(error); } DEV_MODULE(ndisapi, ndis_modevent, NULL); MODULE_VERSION(ndisapi, 1); @@ -104,7 +129,10 @@ void *sbuf; uint32_t slen; { - printf ("status: %x\n", status); + ndis_miniport_block *block; + block = adapter; + + device_printf (block->nmb_dev, "status: %x\n", status); return; } @@ -112,7 +140,10 @@ ndis_statusdone_func(adapter) ndis_handle adapter; { - printf ("status complete\n"); + ndis_miniport_block *block; + block = adapter; + + device_printf (block->nmb_dev, "status complete\n"); return; } @@ -148,7 +179,10 @@ ndis_status status; uint8_t addressingreset; { - printf ("reset done...\n"); + ndis_miniport_block *block; + block = adapter; + + device_printf (block->nmb_dev, "reset done...\n"); return; } @@ -170,8 +204,8 @@ &rid, 0UL, ~0UL, 0x1000, RF_ACTIVE); if (sc->ndis_res_am == NULL) { - printf("ndis%d: failed to allocate attribute memory\n", - sc->ndis_unit); + device_printf(sc->ndis_dev, + "failed to allocate attribute memory\n"); return(ENXIO); } @@ -179,8 +213,8 @@ sc->ndis_dev, rid, 0, NULL); if (error) { - printf("ndis%d: CARD_SET_MEMORY_OFFSET() returned 0x%x\n", - sc->ndis_unit, error); + device_printf(sc->ndis_dev, + "CARD_SET_MEMORY_OFFSET() returned 0x%x\n", error); return(error); } @@ -188,8 +222,8 @@ sc->ndis_dev, SYS_RES_MEMORY, rid, PCCARD_A_MEM_ATTR); if (error) { - printf("ndis%d: CARD_SET_RES_FLAGS() returned 0x%x\n", - sc->ndis_unit, error); + device_printf(sc->ndis_dev, + "CARD_SET_RES_FLAGS() returned 0x%x\n", error); return(error); } @@ -369,7 +403,7 @@ while(b0 != NULL) { next = b0->nb_next; - free (b0, M_DEVBUF); + uma_zfree (ndis_buffer_zone, b0); b0 = next; } @@ -384,7 +418,7 @@ return; ndis_free_bufs(p->np_private.npp_head); - free(p, M_DEVBUF); + uma_zfree(ndis_packet_zone, p); return; } @@ -538,7 +572,7 @@ /* If caller didn't supply a packet, make one. */ if (*p == NULL) { - *p = malloc(sizeof(ndis_packet), M_DEVBUF, M_NOWAIT|M_ZERO); + *p = uma_zalloc(ndis_packet_zone, M_NOWAIT|M_ZERO); if (*p == NULL) return(ENOMEM); @@ -551,7 +585,7 @@ for (m = m0; m != NULL; m = m->m_next) { if (m->m_len == 0) continue; - buf = malloc(sizeof(ndis_buffer), M_DEVBUF, M_NOWAIT|M_ZERO); + buf = uma_zalloc(ndis_buffer_zone, M_NOWAIT | M_ZERO); if (buf == NULL) { ndis_free_packet(*p); *p = NULL; @@ -567,6 +601,7 @@ } priv->npp_tail = buf; + priv->npp_totlen = m0->m_pkthdr.len; return(0); } @@ -671,7 +706,13 @@ for (i = 0; i < cnt; i++) { p = packets[i]; - if (p->np_oob.npo_status == NDIS_STATUS_PENDING) + /* + * Either the driver already handed the packet to + * ndis_txeof() due to a failure, or it wants to keep + * it and release it asynchronously later. Skip to the + * next one. + */ + if (p == NULL || p->np_oob.npo_status == NDIS_STATUS_PENDING) continue; idx = p->np_txidx; m = p->np_m0; ==== //depot/projects/netperf+sockets/sys/compat/ndis/ndis_var.h#6 (text+ko) ==== @@ -29,7 +29,7 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. * - * $FreeBSD: src/sys/compat/ndis/ndis_var.h,v 1.9 2003/12/26 03:31:34 wpaul Exp $ + * $FreeBSD: src/sys/compat/ndis/ndis_var.h,v 1.10 2003/12/30 21:33:26 wpaul Exp $ */ #ifndef _NDIS_VAR_H_ @@ -100,17 +100,6 @@ #define NDIS_STATUS_REQUEST_ABORTED 0xC001000C #define NDIS_STATUS_RESET_IN_PROGRESS 0xC001000D #define NDIS_STATUS_CLOSING_INDICATING 0xC001000E -#define NDIS_STATUS_BAD_VERSION 0xC0010004 -#define NDIS_STATUS_BAD_CHARACTERISTICS 0xC0010005 -#define NDIS_STATUS_ADAPTER_NOT_FOUND 0xC0010006 -#define NDIS_STATUS_OPEN_FAILED 0xC0010007 -#define NDIS_STATUS_DEVICE_FAILED 0xC0010008 -#define NDIS_STATUS_MULTICAST_FULL 0xC0010009 -#define NDIS_STATUS_MULTICAST_EXISTS 0xC001000A -#define NDIS_STATUS_MULTICAST_NOT_FOUND 0xC001000B -#define NDIS_STATUS_REQUEST_ABORTED 0xC001000C -#define NDIS_STATUS_RESET_IN_PROGRESS 0xC001000D -#define NDIS_STATUS_CLOSING_INDICATING 0xC001000E #define NDIS_STATUS_NOT_SUPPORTED 0xC00000BB #define NDIS_STATUS_INVALID_PACKET 0xC001000F #define NDIS_STATUS_OPEN_LIST_FULL 0xC0010010 @@ -192,134 +181,141 @@ */ /* Required OIDs */ -#define OID_GEN_SUPPORTED_LIST 0x00010101 -#define OID_GEN_HARDWARE_STATUS 0x00010102 -#define OID_GEN_MEDIA_SUPPORTED 0x00010103 -#define OID_GEN_MEDIA_IN_USE 0x00010104 -#define OID_GEN_MAXIMUM_LOOKAHEAD 0x00010105 -#define OID_GEN_MAXIMUM_FRAME_SIZE 0x00010106 -#define OID_GEN_LINK_SPEED 0x00010107 -#define OID_GEN_TRANSMIT_BUFFER_SPACE 0x00010108 -#define OID_GEN_RECEIVE_BUFFER_SPACE 0x00010109 -#define OID_GEN_TRANSMIT_BLOCK_SIZE 0x0001010A -#define OID_GEN_RECEIVE_BLOCK_SIZE 0x0001010B -#define OID_GEN_VENDOR_ID 0x0001010C -#define OID_GEN_VENDOR_DESCRIPTION 0x0001010D -#define OID_GEN_CURRENT_PACKET_FILTER 0x0001010E -#define OID_GEN_CURRENT_LOOKAHEAD 0x0001010F -#define OID_GEN_DRIVER_VERSION 0x00010110 -#define OID_GEN_MAXIMUM_TOTAL_SIZE 0x00010111 -#define OID_GEN_PROTOCOL_OPTIONS 0x00010112 -#define OID_GEN_MAC_OPTIONS 0x00010113 -#define OID_GEN_MEDIA_CONNECT_STATUS 0x00010114 -#define OID_GEN_MAXIMUM_SEND_PACKETS 0x00010115 -#define OID_GEN_VENDOR_DRIVER_VERSION 0x00010116 -#define OID_GEN_SUPPORTED_GUIDS 0x00010117 -#define OID_GEN_NETWORK_LAYER_ADDRESSES 0x00010118 /* Set only */ -#define OID_GEN_TRANSPORT_HEADER_OFFSET 0x00010119 /* Set only */ -#define OID_GEN_MACHINE_NAME 0x0001021A -#define OID_GEN_RNDIS_CONFIG_PARAMETER 0x0001021B /* Set only */ -#define OID_GEN_VLAN_ID 0x0001021C +#define OID_GEN_SUPPORTED_LIST 0x00010101 +#define OID_GEN_HARDWARE_STATUS 0x00010102 +#define OID_GEN_MEDIA_SUPPORTED 0x00010103 +#define OID_GEN_MEDIA_IN_USE 0x00010104 +#define OID_GEN_MAXIMUM_LOOKAHEAD 0x00010105 +#define OID_GEN_MAXIMUM_FRAME_SIZE 0x00010106 +#define OID_GEN_LINK_SPEED 0x00010107 +#define OID_GEN_TRANSMIT_BUFFER_SPACE 0x00010108 +#define OID_GEN_RECEIVE_BUFFER_SPACE 0x00010109 +#define OID_GEN_TRANSMIT_BLOCK_SIZE 0x0001010A +#define OID_GEN_RECEIVE_BLOCK_SIZE 0x0001010B +#define OID_GEN_VENDOR_ID 0x0001010C +#define OID_GEN_VENDOR_DESCRIPTION 0x0001010D +#define OID_GEN_CURRENT_PACKET_FILTER 0x0001010E +#define OID_GEN_CURRENT_LOOKAHEAD 0x0001010F +#define OID_GEN_DRIVER_VERSION 0x00010110 +#define OID_GEN_MAXIMUM_TOTAL_SIZE 0x00010111 +#define OID_GEN_PROTOCOL_OPTIONS 0x00010112 +#define OID_GEN_MAC_OPTIONS 0x00010113 +#define OID_GEN_MEDIA_CONNECT_STATUS 0x00010114 +#define OID_GEN_MAXIMUM_SEND_PACKETS 0x00010115 +#define OID_GEN_VENDOR_DRIVER_VERSION 0x00010116 +#define OID_GEN_SUPPORTED_GUIDS 0x00010117 +#define OID_GEN_NETWORK_LAYER_ADDRESSES 0x00010118 /* Set only */ +#define OID_GEN_TRANSPORT_HEADER_OFFSET 0x00010119 /* Set only */ +#define OID_GEN_MACHINE_NAME 0x0001021A +#define OID_GEN_RNDIS_CONFIG_PARAMETER 0x0001021B /* Set only */ +#define OID_GEN_VLAN_ID 0x0001021C /* Optional OIDs. */ -#define OID_GEN_MEDIA_CAPABILITIES 0x00010201 -#define OID_GEN_PHYSICAL_MEDIUM 0x00010202 +#define OID_GEN_MEDIA_CAPABILITIES 0x00010201 +#define OID_GEN_PHYSICAL_MEDIUM 0x00010202 /* Required statistics OIDs. */ -#define OID_GEN_XMIT_OK 0x00020101 -#define OID_GEN_RCV_OK 0x00020102 -#define OID_GEN_XMIT_ERROR 0x00020103 -#define OID_GEN_RCV_ERROR 0x00020104 -#define OID_GEN_RCV_NO_BUFFER 0x00020105 +#define OID_GEN_XMIT_OK 0x00020101 +#define OID_GEN_RCV_OK 0x00020102 +#define OID_GEN_XMIT_ERROR 0x00020103 +#define OID_GEN_RCV_ERROR 0x00020104 +#define OID_GEN_RCV_NO_BUFFER 0x00020105 /* Optional OID statistics */ -#define OID_GEN_DIRECTED_BYTES_XMIT 0x00020201 -#define OID_GEN_DIRECTED_FRAMES_XMIT 0x00020202 -#define OID_GEN_MULTICAST_BYTES_XMIT 0x00020203 -#define OID_GEN_MULTICAST_FRAMES_XMIT 0x00020204 -#define OID_GEN_BROADCAST_BYTES_XMIT 0x00020205 -#define OID_GEN_BROADCAST_FRAMES_XMIT 0x00020206 -#define OID_GEN_DIRECTED_BYTES_RCV 0x00020207 -#define OID_GEN_DIRECTED_FRAMES_RCV 0x00020208 -#define OID_GEN_MULTICAST_BYTES_RCV 0x00020209 -#define OID_GEN_MULTICAST_FRAMES_RCV 0x0002020A -#define OID_GEN_BROADCAST_BYTES_RCV 0x0002020B -#define OID_GEN_BROADCAST_FRAMES_RCV 0x0002020C -#define OID_GEN_RCV_CRC_ERROR 0x0002020D -#define OID_GEN_TRANSMIT_QUEUE_LENGTH 0x0002020E -#define OID_GEN_GET_TIME_CAPS 0x0002020F -#define OID_GEN_GET_NETCARD_TIME 0x00020210 -#define OID_GEN_NETCARD_LOAD 0x00020211 -#define OID_GEN_DEVICE_PROFILE 0x00020212 +#define OID_GEN_DIRECTED_BYTES_XMIT 0x00020201 +#define OID_GEN_DIRECTED_FRAMES_XMIT 0x00020202 +#define OID_GEN_MULTICAST_BYTES_XMIT 0x00020203 +#define OID_GEN_MULTICAST_FRAMES_XMIT 0x00020204 +#define OID_GEN_BROADCAST_BYTES_XMIT 0x00020205 +#define OID_GEN_BROADCAST_FRAMES_XMIT 0x00020206 +#define OID_GEN_DIRECTED_BYTES_RCV 0x00020207 +#define OID_GEN_DIRECTED_FRAMES_RCV 0x00020208 +#define OID_GEN_MULTICAST_BYTES_RCV 0x00020209 +#define OID_GEN_MULTICAST_FRAMES_RCV 0x0002020A +#define OID_GEN_BROADCAST_BYTES_RCV 0x0002020B +#define OID_GEN_BROADCAST_FRAMES_RCV 0x0002020C +#define OID_GEN_RCV_CRC_ERROR 0x0002020D +#define OID_GEN_TRANSMIT_QUEUE_LENGTH 0x0002020E +#define OID_GEN_GET_TIME_CAPS 0x0002020F +#define OID_GEN_GET_NETCARD_TIME 0x00020210 +#define OID_GEN_NETCARD_LOAD 0x00020211 +#define OID_GEN_DEVICE_PROFILE 0x00020212 /* 802.3 (ethernet) OIDs */ -#define OID_802_3_PERMANENT_ADDRESS 0x01010101 -#define OID_802_3_CURRENT_ADDRESS 0x01010102 -#define OID_802_3_MULTICAST_LIST 0x01010103 -#define OID_802_3_MAXIMUM_LIST_SIZE 0x01010104 -#define OID_802_3_MAC_OPTIONS 0x01010105 -#define NDIS_802_3_MAC_OPTION_PRIORITY 0x00000001 -#define OID_802_3_RCV_ERROR_ALIGNMENT 0x01020101 -#define OID_802_3_XMIT_ONE_COLLISION 0x01020102 -#define OID_802_3_XMIT_MORE_COLLISIONS 0x01020103 -#define OID_802_3_XMIT_DEFERRED 0x01020201 -#define OID_802_3_XMIT_MAX_COLLISIONS 0x01020202 -#define OID_802_3_RCV_OVERRUN 0x01020203 -#define OID_802_3_XMIT_UNDERRUN 0x01020204 -#define OID_802_3_XMIT_HEARTBEAT_FAILURE 0x01020205 -#define OID_802_3_XMIT_TIMES_CRS_LOST 0x01020206 -#define OID_802_3_XMIT_LATE_COLLISIONS 0x01020207 +#define OID_802_3_PERMANENT_ADDRESS 0x01010101 +#define OID_802_3_CURRENT_ADDRESS 0x01010102 +#define OID_802_3_MULTICAST_LIST 0x01010103 +#define OID_802_3_MAXIMUM_LIST_SIZE 0x01010104 +#define OID_802_3_MAC_OPTIONS 0x01010105 +#define NDIS_802_3_MAC_OPTION_PRIORITY 0x00000001 +#define OID_802_3_RCV_ERROR_ALIGNMENT 0x01020101 +#define OID_802_3_XMIT_ONE_COLLISION 0x01020102 +#define OID_802_3_XMIT_MORE_COLLISIONS 0x01020103 +#define OID_802_3_XMIT_DEFERRED 0x01020201 +#define OID_802_3_XMIT_MAX_COLLISIONS 0x01020202 +#define OID_802_3_RCV_OVERRUN 0x01020203 +#define OID_802_3_XMIT_UNDERRUN 0x01020204 +#define OID_802_3_XMIT_HEARTBEAT_FAILURE 0x01020205 +#define OID_802_3_XMIT_TIMES_CRS_LOST 0x01020206 +#define OID_802_3_XMIT_LATE_COLLISIONS 0x01020207 /* PnP and power management OIDs */ -#define OID_PNP_CAPABILITIES 0xFD010100 -#define OID_PNP_SET_POWER 0xFD010101 -#define OID_PNP_QUERY_POWER 0xFD010102 -#define OID_PNP_ADD_WAKE_UP_PATTERN 0xFD010103 -#define OID_PNP_REMOVE_WAKE_UP_PATTERN 0xFD010104 -#define OID_PNP_WAKE_UP_PATTERN_LIST 0xFD010105 -#define OID_PNP_ENABLE_WAKE_UP 0xFD010106 +#define OID_PNP_CAPABILITIES 0xFD010100 +#define OID_PNP_SET_POWER 0xFD010101 +#define OID_PNP_QUERY_POWER 0xFD010102 +#define OID_PNP_ADD_WAKE_UP_PATTERN 0xFD010103 +#define OID_PNP_REMOVE_WAKE_UP_PATTERN 0xFD010104 +#define OID_PNP_WAKE_UP_PATTERN_LIST 0xFD010105 +#define OID_PNP_ENABLE_WAKE_UP 0xFD010106 /* PnP/PM Statistics (Optional). */ -#define OID_PNP_WAKE_UP_OK 0xFD020200 -#define OID_PNP_WAKE_UP_ERROR 0xFD020201 +#define OID_PNP_WAKE_UP_OK 0xFD020200 +#define OID_PNP_WAKE_UP_ERROR 0xFD020201 /* The following bits are defined for OID_PNP_ENABLE_WAKE_UP */ -#define NDIS_PNP_WAKE_UP_MAGIC_PACKET 0x00000001 -#define NDIS_PNP_WAKE_UP_PATTERN_MATCH 0x00000002 -#define NDIS_PNP_WAKE_UP_LINK_CHANGE 0x00000004 +#define NDIS_PNP_WAKE_UP_MAGIC_PACKET 0x00000001 +#define NDIS_PNP_WAKE_UP_PATTERN_MATCH 0x00000002 +#define NDIS_PNP_WAKE_UP_LINK_CHANGE 0x00000004 /* 802.11 OIDs */ -#define OID_802_11_BSSID 0x0D010101 -#define OID_802_11_SSID 0x0D010102 -#define OID_802_11_NETWORK_TYPES_SUPPORTED 0x0D010203 -#define OID_802_11_NETWORK_TYPE_IN_USE 0x0D010204 -#define OID_802_11_TX_POWER_LEVEL 0x0D010205 -#define OID_802_11_RSSI 0x0D010206 -#define OID_802_11_RSSI_TRIGGER 0x0D010207 -#define OID_802_11_INFRASTRUCTURE_MODE 0x0D010108 -#define OID_802_11_FRAGMENTATION_THRESHOLD 0x0D010209 -#define OID_802_11_RTS_THRESHOLD 0x0D01020A -#define OID_802_11_NUMBER_OF_ANTENNAS 0x0D01020B -#define OID_802_11_RX_ANTENNA_SELECTED 0x0D01020C -#define OID_802_11_TX_ANTENNA_SELECTED 0x0D01020D -#define OID_802_11_SUPPORTED_RATES 0x0D01020E -#define OID_802_11_DESIRED_RATES 0x0D010210 -#define OID_802_11_CONFIGURATION 0x0D010211 -#define OID_802_11_STATISTICS 0x0D020212 -#define OID_802_11_ADD_WEP 0x0D010113 -#define OID_802_11_REMOVE_WEP 0x0D010114 -#define OID_802_11_DISASSOCIATE 0x0D010115 -#define OID_802_11_POWER_MODE 0x0D010216 -#define OID_802_11_BSSID_LIST 0x0D010217 -#define OID_802_11_AUTHENTICATION_MODE 0x0D010118 -#define OID_802_11_PRIVACY_FILTER 0x0D010119 -#define OID_802_11_BSSID_LIST_SCAN 0x0D01011A -#define OID_802_11_WEP_STATUS 0x0D01011B -#define OID_802_11_RELOAD_DEFAULTS 0x0D01011C +#define OID_802_11_BSSID 0x0D010101 +#define OID_802_11_SSID 0x0D010102 +#define OID_802_11_NETWORK_TYPES_SUPPORTED 0x0D010203 +#define OID_802_11_NETWORK_TYPE_IN_USE 0x0D010204 +#define OID_802_11_TX_POWER_LEVEL 0x0D010205 +#define OID_802_11_RSSI 0x0D010206 +#define OID_802_11_RSSI_TRIGGER 0x0D010207 +#define OID_802_11_INFRASTRUCTURE_MODE 0x0D010108 +#define OID_802_11_FRAGMENTATION_THRESHOLD 0x0D010209 +#define OID_802_11_RTS_THRESHOLD 0x0D01020A +#define OID_802_11_NUMBER_OF_ANTENNAS 0x0D01020B +#define OID_802_11_RX_ANTENNA_SELECTED 0x0D01020C +#define OID_802_11_TX_ANTENNA_SELECTED 0x0D01020D +#define OID_802_11_SUPPORTED_RATES 0x0D01020E +#define OID_802_11_DESIRED_RATES 0x0D010210 +#define OID_802_11_CONFIGURATION 0x0D010211 +#define OID_802_11_STATISTICS 0x0D020212 +#define OID_802_11_ADD_WEP 0x0D010113 +#define OID_802_11_REMOVE_WEP 0x0D010114 +#define OID_802_11_DISASSOCIATE 0x0D010115 +#define OID_802_11_POWER_MODE 0x0D010216 +#define OID_802_11_BSSID_LIST 0x0D010217 +#define OID_802_11_AUTHENTICATION_MODE 0x0D010118 +#define OID_802_11_PRIVACY_FILTER 0x0D010119 +#define OID_802_11_BSSID_LIST_SCAN 0x0D01011A +#define OID_802_11_WEP_STATUS 0x0D01011B +#define OID_802_11_ENCRYPTION_STATUS OID_802_11_WEP_STATUS +#define OID_802_11_RELOAD_DEFAULTS 0x0D01011C +#define OID_802_11_ADD_KEY 0x0D01011D +#define OID_802_11_REMOVE_KEY 0x0D01011E +#define OID_802_11_ASSOCIATION_INFORMATION 0x0D01011F +#define OID_802_11_TEST 0x0D010120 /* structures/definitions for 802.11 */ #define NDIS_80211_NETTYPE_11FH 0x00000000 #define NDIS_80211_NETTYPE_11DS 0x00000001 +#define NDIS_80211_NETTYPE_11OFDM5 0x00000002 +#define NDIS_80211_NETTYPE_11OFDM24 0x00000003 struct ndis_80211_nettype_list { uint32_t ntl_items; @@ -376,11 +372,14 @@ uint32_t nw_length; uint32_t nw_keyidx; uint32_t nw_keylen; - uint32_t nw_keydata[1]; + uint8_t nw_keydata[256]; }; typedef struct ndis_80211_wep ndis_80211_wep; +#define NDIS_80211_WEPKEY_TX 0x80000000 +#define NDIS_80211_WEPKEY_PERCLIENT 0x40000000 + #define NDIS_80211_NET_INFRA_IBSS 0x00000000 #define NDIS_80211_NET_INFRA_BSS 0x00000001 #define NDIS_80211_NET_INFRA_AUTO 0x00000002 @@ -388,8 +387,12 @@ #define NDIS_80211_AUTHMODE_OPEN 0x00000000 #define NDIS_80211_AUTHMODE_SHARED 0x00000001 #define NDIS_80211_AUTHMODE_AUTO 0x00000002 +#define NDIS_80211_AUTHMODE_WPA 0x00000003 +#define NDIS_80211_AUTHMODE_WPAPSK 0x00000004 +#define NDIS_80211_AUTHMODE_WPANONE 0x00000005 typedef uint8_t ndis_80211_rates[8]; +typedef uint8_t ndis_80211_rates_ex[16]; typedef uint8_t ndis_80211_macaddr[6]; struct ndis_80211_ssid { @@ -421,6 +424,42 @@ typedef struct ndis_80211_bssid_list ndis_80211_bssid_list; +struct ndis_wlan_bssid_ex { + uint32_t nwbx_len; + ndis_80211_macaddr nwbx_macaddr; + uint8_t nwbx_rsvd[2]; + ndis_80211_ssid nwbx_ssid; + uint32_t nwbx_privacy; + ndis_80211_rssi nwbx_rssi; + uint32_t nwbx_nettype; + ndis_80211_config nwbx_config; + uint32_t nwbx_netinfra; + ndis_80211_rates_ex nwbx_supportedrates; + uint32_t nwbx_ielen; + uint32_t nwbx_ies[1]; +}; + +typedef struct ndis_wlan_bssid_ex ndis_wlan_bssid_ex; + +struct ndis_80211_bssid_list_ex { + uint32_t nblx_items; + ndis_wlan_bssid nblx_bssid[1]; +}; + +typedef struct ndis_80211_bssid_list_ex ndis_80211_bssid_list_ex; + +struct ndis_80211_fixed_ies { + uint8_t nfi_tstamp[8]; + uint16_t nfi_beaconint; + uint16_t nfi_caps; +}; + +struct ndis_80211_variable_ies { + uint8_t nvi_elemid; + uint8_t nvi_len; + uint8_t nvi_data[1]; +}; + typedef uint32_t ndis_80211_fragthresh; typedef uint32_t ndis_80211_rtsthresh; typedef uint32_t ndis_80211_antenna; @@ -429,12 +468,111 @@ #define NDIS_80211_PRIVFILT_8021XWEP 0x00000001 #define NDIS_80211_WEPSTAT_ENABLED 0x00000000 +#define NDIS_80211_WEPSTAT_ENC1ENABLED NDIS_80211_WEPSTAT_ENABLED #define NDIS_80211_WEPSTAT_DISABLED 0x00000001 +#define NDIS_80211_WEPSTAT_ENCDISABLED NDIS_80211_WEPSTAT_DISABLED #define NDIS_80211_WEPSTAT_KEYABSENT 0x00000002 +#define NDIS_80211_WEPSTAT_ENC1KEYABSENT NDIS_80211_WEPSTAT_KEYABSENT #define NDIS_80211_WEPSTAT_NOTSUPPORTED 0x00000003 +#define NDIS_80211_WEPSTAT_ENCNOTSUPPORTED NDIS_80211_WEPSTAT_NOTSUPPORTED +#define NDIS_80211_WEPSTAT_ENC2ENABLED 0x00000004 +#define NDIS_80211_WEPSTAT_ENC2KEYABSENT 0x00000005 +#define NDIS_80211_WEPSTAT_ENC3ENABLED 0x00000006 +#define NDIS_80211_WEPSTAT_ENC3KEYABSENT 0x00000007 #define NDIS_80211_RELOADDEFAULT_WEP 0x00000000 +#define NDIS_80211_STATUSTYPE_AUTH 0x00000000 + +struct ndis_80211_status_indication { + uint32_t nsi_type; +}; + +typedef struct ndis_80211_status_indication ndis_80211_status_indication; + +struct ndis_80211_auth_request { + uint32_t nar_len; + ndis_80211_macaddr nar_bssid; + uint32_t nar_flags; +}; + +typedef struct ndis_80211_auth_request ndis_80211_auth_request; + +struct ndis_80211_key { + uint32_t nk_len; + uint32_t nk_keyidx; + uint32_t nk_keylen; + ndis_80211_macaddr nk_bssid; + uint64_t nk_keyrsc; + uint8_t nk_keydata[256]; +}; + +typedef struct ndis_80211_key ndis_80211_key; + +struct ndis_80211_remove_key { + uint32_t nk_len; + uint32_t nk_keyidx; + ndis_80211_macaddr nk_bssid; +}; + +typedef struct ndis_80211_remove_key ndis_80211_remove_key; + +#define NDIS_80211_AI_REQFI_CAPABILITIES 0x00000001 +#define NDIS_80211_AI_REQFI_LISTENINTERVAL 0x00000002 +#define NDIS_80211_AI_REQFI_CURRENTAPADDRESS 0x00000004 + +#define NDIS_80211_AI_RESFI_CAPABILITIES 0x00000001 +#define NDIS_80211_AI_RESFI_STATUSCODE 0x00000002 +#define NDIS_80211_AI_RESFI_ASSOCIATIONID 0x00000004 + +struct ndis_80211_ai_reqfi { + uint16_t naq_caps; + uint16_t naq_listentint; + ndis_80211_macaddr naq_currentapaddr; +}; + +typedef struct ndis_80211_ai_reqfi ndis_80211_ai_reqfi; + +struct ndis_80211_ai_resfi { + uint16_t nas_caps; + uint16_t nas_statuscode; + uint16_t nas_associd; +}; + +typedef struct ndis_80211_ai_resfi ndis_80211_ai_resfi; + +struct ndis_80211_assoc_info { + uint32_t nai_len; + uint16_t nai_avail_req_fixed_ies; + ndis_80211_ai_reqfi nai_req_fixed_ies; + uint32_t nai_req_ielen; + uint32_t nai_offset_req_ies; + uint16_t nai_avail_resp_fixed_ies; + ndis_80211_ai_resfi nai_resp_fixed_iex; + uint32_t nai_resp_ielen; + uint32_t nai_offset_resp_ies; +}; + +typedef struct ndis_80211_assoc_info ndis_80211_assoc_info; + +struct ndis_80211_auth_event { + ndis_80211_status_indication nae_status; + ndis_80211_auth_request nae_request[1]; +}; + +typedef struct ndis_80211_auth_event ndis_80211_auth_event; + +struct ndis_80211_test { + uint32_t nt_len; + uint32_t nt_type; + union { + ndis_80211_auth_event nt_authevent; + uint32_t nt_rssitrigger; + } u; +}; + +typedef struct ndis_80211_test ndis_80211_test; + /* * Attribures of NDIS drivers. Not all drivers support * all attributes. ==== //depot/projects/netperf+sockets/sys/compat/ndis/subr_ndis.c#7 (text+ko) ==== @@ -31,7 +31,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/compat/ndis/subr_ndis.c,v 1.18 2003/12/28 21:36:03 wpaul Exp $"); +__FBSDID("$FreeBSD: src/sys/compat/ndis/subr_ndis.c,v 1.19 2004/01/02 04:31:06 wpaul Exp $"); /* * This file implements a translation layer between the BSD networking @@ -769,12 +769,13 @@ block = (ndis_miniport_block *)adapter; - printf ("NDIS ERROR: %x\n", code); - printf ("NDIS NUMERRORS: %x\n", numerrors); + device_printf (block->nmb_dev, "NDIS ERROR: %x\n", code); + device_printf (block->nmb_dev, "NDIS NUMERRORS: %x\n", numerrors); va_start(ap, numerrors); for (i = 0; i < numerrors; i++) - printf ("argptr: %p\n", va_arg(ap, void *)); + device_printf (block->nmb_dev, "argptr: %p\n", + va_arg(ap, void *)); va_end(ap); return; @@ -1829,7 +1830,7 @@ block = (ndis_miniport_block *)adapter; *list = block->nmb_rlist; - printf ("assign PCI resources...\n"); + device_printf (block->nmb_dev, "assign PCI resources...\n"); return (NDIS_STATUS_SUCCESS); } ==== //depot/projects/netperf+sockets/sys/compat/ndis/subr_ntoskrnl.c#4 (text+ko) ==== @@ -31,7 +31,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/compat/ndis/subr_ntoskrnl.c,v 1.4 2003/12/25 00:40:02 wpaul Exp $"); +__FBSDID("$FreeBSD: src/sys/compat/ndis/subr_ntoskrnl.c,v 1.5 2003/12/31 04:12:57 wpaul Exp $"); #include <sys/param.h> #include <sys/types.h> @@ -489,8 +489,7 @@ slist_entry *entry; slist_entry *oldhead; - __asm__("movl %%ecx, %%ecx" : "=c" (head)); - __asm__("movl %%edx, %%edx" : "=d" (entry)); + __asm__ __volatile__ ("" : "=c" (head), "=d" (entry)); mtx_lock(&ntoskrnl_interlock); oldhead = head->slh_list.slh_next; @@ -506,7 +505,7 @@ slist_header *head; slist_entry *first; - __asm__("movl %%ecx, %%ecx" : "=c" (head)); + __asm__ __volatile__ ("" : "=c" (head)); mtx_lock(&ntoskrnl_interlock); first = head->slh_list.slh_next; @@ -524,8 +523,7 @@ slist_entry *entry; slist_entry *oldhead; - __asm__("movl %%ecx, %%ecx" : "=c" (head)); - __asm__("movl %%edx, %%edx" : "=d" (entry)); + __asm__ __volatile__ ("" : "=c" (head), "=d" (entry)); mtx_lock((struct mtx *)*lock); oldhead = head->slh_list.slh_next; @@ -542,8 +540,7 @@ kspin_lock *lock; slist_entry *first; - __asm__("movl %%ecx, %%ecx" : "=c" (head)); - __asm__("movl %%edx, %%edx" : "=d" (lock)); + __asm__ __volatile__ ("" : "=c" (head), "=d" (lock)); mtx_lock((struct mtx *)*lock); first = head->slh_list.slh_next; ==== //depot/projects/netperf+sockets/sys/dev/acpica/acpi_thermal.c#3 (text+ko) ==== @@ -26,7 +26,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/dev/acpica/acpi_thermal.c,v 1.33 2003/10/25 05:03:24 njl Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/acpica/acpi_thermal.c,v 1.34 2003/12/31 19:11:19 njl Exp $"); #include "opt_acpi.h" #include <sys/param.h> @@ -50,8 +50,8 @@ #define TZ_KELVTOC(x) (((x) - TZ_ZEROC) / 10), (((x) - TZ_ZEROC) % 10) #define TZ_NOTIFY_TEMPERATURE 0x80 -#define TZ_NOTIFY_DEVICES 0x81 -#define TZ_NOTIFY_LEVELS 0x82 +#define TZ_NOTIFY_LEVELS 0x81 +#define TZ_NOTIFY_DEVICES 0x82 /* Check for temperature changes every 30 seconds by default */ #define TZ_POLLRATE 30 ==== //depot/projects/netperf+sockets/sys/dev/ed/if_ed_pccard.c#3 (text+ko) ==== @@ -24,7 +24,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/sys/dev/ed/if_ed_pccard.c,v 1.54 2003/10/31 18:31:58 brooks Exp $ + * $FreeBSD: src/sys/dev/ed/if_ed_pccard.c,v 1.55 2003/12/31 04:25:00 kato Exp $ */ #include "opt_ed.h" @@ -179,6 +179,7 @@ { PCMCIA_CARD(SVEC, COMBOCARD, 0), 0}, { PCMCIA_CARD(SVEC, LANCARD, 0), 0}, { PCMCIA_CARD(SYNERGY21, S21810, 0), 0}, + { PCMCIA_CARD(TDK, LAK_CD031, 0), 0}, { PCMCIA_CARD(TELECOMDEVICE, TCD_HPC100, 0), NE2000DVF_AX88190 }, { PCMCIA_CARD(XIRCOM, CFE_10, 0), 0}, { PCMCIA_CARD(ZONET, ZEN, 0), 0}, ==== //depot/projects/netperf+sockets/sys/dev/if_ndis/if_ndis.c#7 (text+ko) ==== @@ -31,7 +31,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/dev/if_ndis/if_ndis.c,v 1.16 2003/12/29 23:51:59 wpaul Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/if_ndis/if_ndis.c,v 1.19 2004/01/02 04:31:05 wpaul Exp $"); #include "opt_bdg.h" @@ -53,8 +53,6 @@ #include <net/bpf.h> -#include <vm/vm.h> /* for vtophys */ -#include <vm/pmap.h> /* for vtophys */ #include <machine/bus_memio.h> #include <machine/bus_pio.h> #include <machine/bus.h> @@ -104,6 +102,7 @@ ndis_packet **, uint32_t); static __stdcall void ndis_linksts (ndis_handle, ndis_status, void *, uint32_t); +static __stdcall void ndis_linksts_done (ndis_handle); static void ndis_intr (void *); static void ndis_tick (void *); @@ -142,15 +141,28 @@ }; static driver_t ndis_driver = { +#ifdef NDIS_DEVNAME + NDIS_DEVNAME, +#else "ndis", +#endif ndis_methods, sizeof(struct ndis_softc) }; static devclass_t ndis_devclass; +#ifdef NDIS_MODNAME +#define NDIS_MODNAME_OVERRIDE_PCI(x) \ + DRIVER_MODULE(x, pci, ndis_driver, ndis_devclass, 0, 0) +#define NDIS_MODNAME_OVERRIDE_CARDBUS(x) \ + DRIVER_MODULE(x, cardbus, ndis_driver, ndis_devclass, 0, 0) +NDIS_MODNAME_OVERRIDE_PCI(NDIS_MODNAME); +NDIS_MODNAME_OVERRIDE_CARDBUS(NDIS_MODNAME); +#else DRIVER_MODULE(ndis, pci, ndis_driver, ndis_devclass, 0, 0); DRIVER_MODULE(ndis, cardbus, ndis_driver, ndis_devclass, 0, 0); +#endif /* * Program the 64-bit multicast hash filter. @@ -241,42 +253,43 @@ SYS_RES_IOPORT, &sc->ndis_io_rid, 0, ~0, 1, RF_ACTIVE); if (sc->ndis_res_io == NULL) { - printf("ndis%d: couldn't map " - "iospace\n", unit); + device_printf(dev, + "couldn't map iospace"); error = ENXIO; goto fail; } break; case SYS_RES_MEMORY: - if (sc->ndis_res_altmem != NULL) { - printf ("ndis%d: too many memory " - "resources", sc->ndis_unit); + if (sc->ndis_res_altmem != NULL && + sc->ndis_res_mem != NULL) { + device_printf(dev, + "too many memory resources"); error = ENXIO; goto fail; } - if (sc->ndis_res_mem == NULL) { - sc->ndis_mem_rid = rle->rid; - sc->ndis_res_mem = + if (rle->rid == PCIR_BAR(2)) { + sc->ndis_altmem_rid = rle->rid; + sc->ndis_res_altmem = bus_alloc_resource(dev, SYS_RES_MEMORY, - &sc->ndis_mem_rid, + &sc->ndis_altmem_rid, 0, ~0, 1, RF_ACTIVE); - if (sc->ndis_res_mem == NULL) { - printf("ndis%d: couldn't map " - "memory\n", unit); + if (sc->ndis_res_altmem == NULL) { + device_printf(dev, + "couldn't map alt memory"); error = ENXIO; goto fail; } } else { - sc->ndis_altmem_rid = rle->rid; - sc->ndis_res_altmem = + sc->ndis_mem_rid = rle->rid; + sc->ndis_res_mem = bus_alloc_resource(dev, SYS_RES_MEMORY, - &sc->ndis_altmem_rid, + &sc->ndis_mem_rid, 0, ~0, 1, RF_ACTIVE); - if (sc->ndis_res_altmem == NULL) { - printf("ndis%d: couldn't map " - "alt memory\n", unit); + if (sc->ndis_res_mem == NULL) { + device_printf(dev, + "couldn't map memory"); error = ENXIO; goto fail; } @@ -288,8 +301,8 @@ SYS_RES_IRQ, &rid, 0, ~0, 1, RF_SHAREABLE | RF_ACTIVE); if (sc->ndis_irq == NULL) { - printf("ndis%d: couldn't map " - "interrupt\n", unit); + device_printf(dev, + "couldn't map interrupt"); error = ENXIO; goto fail; } @@ -310,7 +323,7 @@ ndis_intr, sc, &sc->ndis_intrhand); if (error) { - printf("ndis%d: couldn't set up irq\n", unit); + device_printf(dev, "couldn't set up irq\n"); goto fail; >>> TRUNCATED FOR MAIL (1000 lines) <<<
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200401020622.i026MSJC081367>