Module Name: src Committed By: jakllsch Date: Wed Jul 2 00:04:18 UTC 2014
Modified Files: src/sys/dev/pci: if_wpi.c if_wpireg.h Log Message: No need to duplicate the members of the wpi_cmd_data structure within the wpi_scan_hdr structure when we can just put the wpi_cmd_data structure within the wpi_scan_hdr structure. This also brings our if_wpireg.h mostly in line with OpenBSD's 1.18. To generate a diff of this commit: cvs rdiff -u -r1.59 -r1.60 src/sys/dev/pci/if_wpi.c cvs rdiff -u -r1.11 -r1.12 src/sys/dev/pci/if_wpireg.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/dev/pci/if_wpi.c diff -u src/sys/dev/pci/if_wpi.c:1.59 src/sys/dev/pci/if_wpi.c:1.60 --- src/sys/dev/pci/if_wpi.c:1.59 Mon Jun 16 22:38:27 2014 +++ src/sys/dev/pci/if_wpi.c Wed Jul 2 00:04:18 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: if_wpi.c,v 1.59 2014/06/16 22:38:27 jakllsch Exp $ */ +/* $NetBSD: if_wpi.c,v 1.60 2014/07/02 00:04:18 jakllsch Exp $ */ /*- * Copyright (c) 2006, 2007 @@ -18,7 +18,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: if_wpi.c,v 1.59 2014/06/16 22:38:27 jakllsch Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_wpi.c,v 1.60 2014/07/02 00:04:18 jakllsch Exp $"); /* * Driver for Intel PRO/Wireless 3945ABG 802.11 network adapters. @@ -2728,9 +2728,9 @@ wpi_scan(struct wpi_softc *sc, uint16_t hdr = (struct wpi_scan_hdr *)cmd->data; memset(hdr, 0, sizeof (struct wpi_scan_hdr)); - hdr->txflags = htole32(WPI_TX_AUTO_SEQ); - hdr->id = WPI_ID_BROADCAST; - hdr->lifetime = htole32(WPI_LIFETIME_INFINITE); + hdr->cmd.flags = htole32(WPI_TX_AUTO_SEQ); + hdr->cmd.id = WPI_ID_BROADCAST; + hdr->cmd.lifetime = htole32(WPI_LIFETIME_INFINITE); /* * Move to the next channel if no packets are received within 5 msecs @@ -2743,11 +2743,11 @@ wpi_scan(struct wpi_softc *sc, uint16_t if (flags & IEEE80211_CHAN_A) { hdr->crc_threshold = htole16(1); /* send probe requests at 6Mbps */ - hdr->rate = wpi_plcp_signal(12); + hdr->cmd.rate = wpi_plcp_signal(12); } else { hdr->flags = htole32(WPI_CONFIG_24GHZ | WPI_CONFIG_AUTO); /* send probe requests at 1Mbps */ - hdr->rate = wpi_plcp_signal(2); + hdr->cmd.rate = wpi_plcp_signal(2); } /* for directed scans, firmware inserts the essid IE itself */ @@ -2797,7 +2797,7 @@ wpi_scan(struct wpi_softc *sc, uint16_t } /* setup length of probe request */ - hdr->paylen = htole16(frm - (uint8_t *)wh); + hdr->cmd.len = htole16(frm - (uint8_t *)wh); chan = (struct wpi_scan_chan *)frm; for (c = &ic->ic_channels[1]; Index: src/sys/dev/pci/if_wpireg.h diff -u src/sys/dev/pci/if_wpireg.h:1.11 src/sys/dev/pci/if_wpireg.h:1.12 --- src/sys/dev/pci/if_wpireg.h:1.11 Mon Jun 30 21:33:40 2014 +++ src/sys/dev/pci/if_wpireg.h Wed Jul 2 00:04:18 2014 @@ -1,5 +1,5 @@ -/* $NetBSD: if_wpireg.h,v 1.11 2014/06/30 21:33:40 jakllsch Exp $ */ -/* $OpenBSD: if_wpireg.h,v 1.17 2007/07/24 16:07:47 damien Exp $ */ +/* $NetBSD: if_wpireg.h,v 1.12 2014/07/02 00:04:18 jakllsch Exp $ */ +/* $OpenBSD: if_wpireg.h,v 1.18 2007/09/10 20:34:43 damien Exp $ */ /*- * Copyright (c) 2006, 2007 @@ -493,25 +493,10 @@ struct wpi_scan_hdr { uint32_t flags; uint32_t filter; - /* wpi_cmd_data structure */ - uint16_t paylen; - uint16_t lnext; - uint32_t txflags; - uint8_t rate; - uint8_t id; - uint8_t tid; - uint8_t security; - uint8_t key[IEEE80211_KEYBUF_SIZE]; - uint8_t tkip[IEEE80211_WEP_MICLEN]; - uint32_t fnext; - uint32_t lifetime; - uint8_t ofdm_mask; - uint8_t cck_mask; - uint8_t rts_ntries; - uint8_t data_ntries; - uint16_t timeout; - uint16_t txop; + /* followed by a struct wpi_cmd_data */ + struct wpi_cmd_data cmd; + /* followed by an array of 4x struct wpi_scan_essid */ struct wpi_scan_essid essid[4]; /* followed by probe request body */