Commit Graph

65 Commits

Author SHA1 Message Date
ad a2a3828545 machine/{bus,cpu,intr}.h -> sys/{bus,cpu,intr}.h 2007-10-19 11:59:34 +00:00
dyoung dcd8923429 Change a bazillion occurrences of code resembling this,
error = (cmd == SIOCADDMULTI) ?
	    ether_addmulti(ifr, &sc->sc_ec) :
	    ether_delmulti(ifr, &sc->sc_ec);

	if (error == ENETRESET) {

to this,

	if ((error = ether_ioctl(ifp, cmd, data)) == ENETRESET) {

which does the same thing.

(A bazillion is a very large number.  This seems to make the i386
ALL kernel smaller by 3kB to 4kB.)

Use ifreq_getaddr() twice in es(4).

Whitespace nits.
2007-09-01 07:32:22 +00:00
dyoung 71e77a61b4 Constify: LLADDR -> CLLADDR. I'm aiming here to make it easier to
identify sockaddr_dl abuse that remains in the kernel, especially
the potential for overwriting memory past the end of a sockaddr_dl
with, e.g., memcpy(LLADDR(), ...).
2007-08-26 22:45:55 +00:00
sketch cbbf3374dd Put unformatted firmware version output behind IWI_DEBUG 2007-03-04 19:14:25 +00:00
christos 53524e44ef Kill caddr_t; there will be some MI fallout, but it will be fixed shortly. 2007-03-04 05:59:00 +00:00
skrll 65cd49f99e Pass the right pointer to firmware_free.
Fixes the DIAGNOSTIC panic reported by Sverre Froyen on current-users.
2007-01-23 15:02:50 +00:00
skrll be0d7b99e3 - Upgrade to the latest firmware and as a result remove the error log dump.
- Mostly sync with OpenBSD
	- Serialise sending commands to the firmware
	- Remove redundant calls to bpfdetach.
	- use bus_size_t where appropriate and not fetch iobase as it's not
	  used.
	- improve 802.11 radiotap support (correct rx rate)
	- add short preamble flag
	- add short slot time support
	- ignore parity errors (as per the Linux driver)
	- Set Tx power for all channels.
	- disable bluetooth co-existance
	- Check that ni->ni_rates.rs_nrates is not greater than the maximum
	  handled by the firmware.
- Begin syncing with the FreeBSD driver by renaming a few things.
2006-12-20 16:30:20 +00:00
christos 168cd830d2 __unused removal on arguments; approved by core. 2006-11-16 01:32:37 +00:00
christos 4d595fd7b1 - sprinkle __unused on function decls.
- fix a couple of unused bugs
- no more -Wno-unused for i386
2006-10-12 01:30:41 +00:00
jmcneill f135e0d607 Add "name" parameter to powerhook_establish, to aid debugging. No objections
on tech-kern@
2006-09-24 03:53:07 +00:00
christos 26f4467d26 fix initializers. 2006-08-30 16:43:56 +00:00
skrll 326bcc171a Add some sysctl knobs to bring us closer to the FreeBSD driver.
Also sysctl enable the debug message printing (if IWI_DEBUG) is defined.
2006-08-19 06:32:52 +00:00
skrll 7274555f30 s/printf/aprint_error/ for one message. 2006-08-09 11:49:41 +00:00
skrll 6458f6d488 Adapt iwi(4) to use firmload(9) and remove firmware loading from
iwictl(8).
2006-08-09 11:35:59 +00:00
ad 3029ac48c7 - Use the LWP cached credentials where sane.
- Minor cosmetic changes.
2006-07-21 16:48:45 +00:00
christos 63bbcb495a re-factor the pci powestate api. reviewed by gimpy 2006-06-17 23:34:26 +00:00
blymn 3a0170518a Clean up bogus whitespace 2006-05-28 13:12:42 +00:00
elad 2867b68bc3 integrate kauth. 2006-05-14 21:42:26 +00:00
rpaulo 3fd310011d Coverity ID 2442: check if one can dereference ifp before calling
iwi_stop() in iwi_detach().
2006-04-11 15:42:56 +00:00
jmcneill 777ce723e2 Save and restore PCI configuration state on suspend/resume. 2006-03-09 16:02:55 +00:00
skrll 14041a25af Fix from Sam Leffler "correct check for whether wpa is enabled".
wpa_supplicant and static WEP doesn't crash the firmware now. YAY!
2006-02-21 07:24:07 +00:00
perry 93124077ae Remove leading __ from __(const|inline|signed|volatile) -- it is obsolete. 2005-12-24 20:27:29 +00:00
skrll a599d2ebb4 Finally (I hope) fix iwi_ioctl:
- handle SIOCADDMULTI/SIOCDELMULTI properly, i.e. no need to reset
	  anything as we don't do multicast filters (yet)
	- restructure some code and use an IS_RUNNING macro

Fix iwi_init to set if_flags before the net80211 state machine is kicked
and init to IEEE80211_S_INIT.
2005-12-05 09:24:54 +00:00
rpaulo ff67bb3168 Add support for software controlled LEDs as found on some
boards. Currently, only the associated LED is being used because
that's the only LED my card has. The other two LEDs (OFDM and
activity) can later be set by someone, easily, who owns some board
with that LEDs.

Reviewed by Nick Hudson.
2005-11-29 13:57:00 +00:00
skrll 535aed4540 Fixes from Steve Woodford:
- add some missing bus_dmamap_sync operations.
	- don't process other interrupts if we get an error/radio off
	  interrupt.
	- improve command handling - sleep against the descriptor instead
	  of the descriptor set.
2005-11-26 07:42:10 +00:00
skrll 3b6e301485 Fix the handling of ENETRESET in iwi_ioctl.
This fixes PR 32143
2005-11-23 20:35:54 +00:00
skrll d40d6be769 Correct a bpf tap. 2005-11-23 20:08:29 +00:00
skrll 38d4ca67e5 Resolve conflicts. Changelog to follow. 2005-11-18 16:42:22 +00:00
skrll 1f381351c3 Don't use DPRINTF for previous. Doh! 2005-11-14 12:07:33 +00:00
skrll 5349e12d67 Dump the error log if we get an IWI_INTR_FATAL_ERROR interrupt. 2005-11-14 11:58:52 +00:00
scw aee1af1ef4 Expunge an extraneous bus_dmamap_sync() call in iwi_frame_intr(). The entire
frame has already been sync'd by iwi_rx_intr().
2005-10-29 11:00:17 +00:00
scw b6845ed55f - Use the DMA map size when calling bus_dmamap_sync(), instead of
blindly assuming MCLBYTES will DTRT.
- Use bus_dmamap_load_mbuf() instead of bus_dmamap_load() where
  appropriate.
- If we have to coalesce a Tx mbuf chain comprised of more than IWI_MAX_NSEG
  segments, allocate a cluster iff the payload won't fit in the header.
2005-10-29 10:48:02 +00:00
skrll 22049753c1 Don't byte swap unnecessarily in iwi_read_prom_word. Fix the user instead. 2005-10-29 08:44:28 +00:00
scw 842139fe29 Support big-endian hosts:
- Always byte-swap data read from EEPROM.
- Byte-swap firmware image when host is big-endian.

In iwi_tx_start():
- Fix descriptor initialisation bogon (only problematic on big-endian hosts).
- Fix bus_dmamap_sync() 'len' parameter..
2005-10-29 08:10:38 +00:00
joerg 35b726a534 Fix a kernel segfault when a RX interrupt can't allocate a new mbuf.
The change adopts the idea of fxp to drop the incoming packet and panic
if the old mbuf cannot be reloaded. Since the bus_dmamap is allocated
during attach, this is not supposed to happen. Since a lot of code moves
anyway, factor out the allocation of RX ring elements, which is shared
between the init path and the RX interrupt path.

XXX A better fix might be to borrow the mbuf from the logic end of the
XXX ring buffer, but that needs more involved driver changes.

Reviewed by dyoung@ and nick@
2005-10-19 20:18:00 +00:00
skrll 69c3b1813e Use the new scan command for monitor mode as well. 2005-10-08 06:19:46 +00:00
skrll 0063b53d7b Improve interrupt handling:
- don't disable/enable as we're already at splnet()
	- ack the interrupts early

Fixes my "lost interrupt" problem.

Thanks to dyoung and scw for the suggestions.
2005-09-29 19:57:36 +00:00
skrll a626c5afb2 Whitespace and change a comment slightly. 2005-09-25 15:29:37 +00:00
skrll 443f1937a0 Don't try to bus_dmamem_alloc everytime we want to load the firmware as
it can fail all too easily. Instead bus_dmamap_load the cached copy and
create the command blocks for the device to load it accordingly.

Thanks to scw and mrg for reviewing this.

Closes PR 29892 (I hope).
2005-09-25 15:18:21 +00:00
skrll 1d01574af3 Support hidden ESSID APs.
Use the newer scan command as this one doesn't crash the firmware when
scanning 802.11a channels.

Thanks to scw and blymn for testing.

Closes PR 31295.
2005-09-25 11:55:05 +00:00
skrll b453f6ca4f Resolve conflicts. 2005-09-25 06:49:54 +00:00
skrll fbe43fd3d2 KNF. That is change u_intN_t to uintN_t. 2005-09-17 12:40:27 +00:00
skrll 609c167c77 Correct a debug message. 2005-09-15 19:56:50 +00:00
skrll 81eeab7ea5 Fix spello. 2005-09-12 21:15:04 +00:00
skrll 180eb637a5 Use the correct length parameter when capturing rx packets. 2005-09-12 21:11:11 +00:00
skrll d465bfe236 Re-organise a bit to reduce diff to FreeBSD. 2005-09-04 06:58:20 +00:00
skrll 3a28b8e5de Let the net80211 layer handle the transition to INIT as well.
Testing by salo and me suggests that PR 31010 is fixed.
2005-08-30 21:18:47 +00:00
skrll 95c40e1648 Disestablish the power and shutdown hooks when detaching. 2005-08-30 21:14:29 +00:00
skrll acd9563ce6 KNF (and reduced diff to FreeBSD) 2005-08-30 21:05:47 +00:00
skrll d308c43536 Be explicit about which cards to setup .11a rates for.
hi matt.
2005-08-27 07:26:47 +00:00