Commit Graph

25640 Commits

Author SHA1 Message Date
cegger eb7545174c regen. 2009-06-11 12:43:13 +00:00
cegger db97db6aee add ADP2, Marvell and Triones devices.
Taken from mvsata diff from Kiyohara Takashi, resolved apply conflicts.
2009-06-11 12:42:31 +00:00
cegger 535480ccf0 Attach Marvel 88SE6121 SATA II controller on ahci.
W/o this, it attaches on pciide.
2009-06-11 11:02:11 +00:00
pooka 1e115afaf0 Attempt bailout if config_attach_pseudo() fails. Otherwise, a few
moments later, we'll take a fatal plunge because sc_dev is null.
2009-06-10 14:17:13 +00:00
tsutsui 95b2850b42 Split device_t/softc.
Tested on:
emuxki0 at pci2 dev 7 function 0: Creative Labs SBLive! EMU 10000
(audio multimedia, revision 0x05)
2009-06-09 11:01:18 +00:00
jakllsch 5aaada1bec Add atap_max_lba member to ataparams for LBA48 Maximum Address. From OpenBSD.
While here, renumber some __reserved member names to be sequential.
Also, add a member for the World Wide Name.

Use atap_max_lba in wd.c instead of offsets into a __reserved member.
2009-06-08 15:09:35 +00:00
pgoyette 260b6fd907 Correct typo in last so we can #undef the correct macro. 2009-06-08 13:06:33 +00:00
pgoyette f7ad703892 General clean-up and some restructuring of event handling. This is a
precursor to letting sensor drivers actually exchange limits/thresholds
with user-land.
2009-06-08 00:55:35 +00:00
cegger a4c2d5ee50 typo in comment: autconfiguration -> autoconfiguration 2009-06-06 12:56:43 +00:00
haad ea2ba1c77b Fix my previous commit. 2009-06-06 08:10:06 +00:00
haad f5b48500f1 Add support for DIOCGDISKINFO to disk like device drivers. Change
partutil.c::getdiskinfo to use it to get disk geometry info.
Use DIOCGWEDGEINFO ioctl to get information about partition size, if disk
driver doesn't support it use old DIOCGDINFO. This patch adds support for
wedge like devices(lvm logical volumes, ZFS zvol partitions) to newfs and
other tools.

No objections on tech-userlevel@.
2009-06-05 21:52:31 +00:00
haad 62e994ce96 Parse dm param string in libdevmapper and not in a dm target init function.
Create proplib param dictionary entry in libdevmapper and pass it to dm in
dm_ioctl dict.
Param target is then passed to target init function, where is parse. I like
this aproach much better than passing char **argv and trusting to user input.

I have bumped minor lib/driver version.

XXX. Add more sanity checks in kernel.
2009-06-05 19:56:40 +00:00
haad 7147ed320b Add work in support for compiling ccd and cgd drivers as a modules. I forgot
to committ when I have written device module autoloading stuff.
2009-06-05 19:21:02 +00:00
hubertf 1aba70bb8a From the specs: address 0xff gives the die revision 2009-06-05 12:42:43 +00:00
pgoyette 7c25ce0d52 Explicitly set sensor's units to ENVSYS_STEMP rather than having
it work only because ENVSYS_STEMP is #defined to 0
2009-06-03 22:34:18 +00:00
macallan f48726983f make this compile again without tctrl 2009-06-03 16:25:22 +00:00
pgoyette 677e91afbc Don't allocate the private list-threading structure unless we're going
to use it.  Otherwise we end up leaking little bits of memory for each
sensor that is not monitored at time of initial registration.
2009-06-03 11:43:15 +00:00
pgoyette 5a84f3060e Since we no longer have individual events for each sensor value limit,
we don't need individual flag bits.  Clean up extra bit definitions.
Bump kernel version - welcome to 5.99.13
2009-06-01 20:08:44 +00:00
he 6425d6dcfd Don't include <machine/mtpr.h> anymore since it has been removed
(at least from the amiga port) and appears to no longer be required.
2009-05-31 14:11:17 +00:00
tsutsui a6363f7d5a Two fixes for RX hwcsum on DESCV2 chips:
* On checking TCPv4/UDPv4 RX checksum on DESCV2 chips, also check
   RE_RDESC_VLANCTL_IPV4 bit because those DESCV2 chips may also recognize
   IPv6 packets and set RE_PROTOID_TCPIP or RE_PROTOID_UDPIP bits for
   TCPv6/UDPv6 packets.  This may fix PR kern/40605.
 * According to Realtek's Linux driver, DESCV2 chips don't set RE_PROTOID_IP
   for non-TCP/UDP IP packets (set only RE_RDESC_VLANCTL_IPV[46]) so
   remove PROTOID check for IPv4 RX cheksum on DESCV2 chips.
2009-05-31 05:10:47 +00:00
nonaka 84b5216c59 It is avoided that the error occurs when the card attaches it,
when wedge is supported.
2009-05-29 22:27:40 +00:00
rjs 850a493aca Pass correct argument to q_to_b(). 2009-05-29 20:10:39 +00:00
plunky 78fb2cc482 add missing NetBSD RCS ID tags 2009-05-29 18:49:21 +00:00
skrll d73b19cf48 Regen. 2009-05-29 06:13:56 +00:00
skrll 2026f95019 Add a bunch of HP stuff. From OpenBSD. 2009-05-29 06:12:31 +00:00
darran 7dadeaa0c7 Add vlan support and hardware offload capabilities to agr.
These changes allow vlans to be layered above agr, with the attach
and detach propogated to the member ports in the aggregation.
Note the agr interface must be up before the vlan is attached.

Adds SIOCINITIFADDR support to the wm driver for setting the AF_LINK
address, necessary for agr to be able to set the mac addresses of each
port to the agr address (i.e. so it can receive all intended traffic
at the hardware level).

Adds support for disabling the LACP protocol by setting LINK1 on the agr
interface (e.g. ifconfig agr0 link1).

In consultation with tls@.
2009-05-29 04:57:04 +00:00
rjs f4443cd34c Put back CVS header. 2009-05-27 23:01:07 +00:00
macallan b538f79eb0 use pmf, while there do some cleanup, fix typos etc. 2009-05-27 15:13:22 +00:00
macallan 5052b0a047 finally commit a lot of stuff that's been sitting in my source tree for
several ages:
- convert to device_t
- add support for programming colour depth and such, use it to reset the
  console to something usable when we enter ddb or exit X etc.
- basic power management
TODO:
- convert to PMF
- get rid of rconsole code so we don't need to map the framebuffer
- power down the whole DAC when not in use
2009-05-27 00:35:34 +00:00
macallan 991219d617 add a bunch of register definitions 2009-05-27 00:32:10 +00:00
dyoung 588bd8a952 Wrap some long lines. No functional change intended. 2009-05-26 23:57:34 +00:00
macallan 0483b5b9d9 use BUS_SPACE_MAP_LARGE 2009-05-26 03:32:51 +00:00
nisimura 2f739d6166 add VID 0x6011 case to match FT4232H chip. 2009-05-25 11:38:49 +00:00
nisimura 7384fe89d2 regen to sync with new usbdevs file. 2009-05-25 11:36:52 +00:00
nisimura 0a1e3a4113 add VID 0x6011 for FT4232H quad channel chip. 2009-05-25 11:35:10 +00:00
nisimura 44dbe1e84c - detect FTDI chiptype from bcdDevice field to determine the number of
channels.
- tested on 232BM, 232RL and 2232D chips.
- now capable of quad channel FT4232H.
- minor format nit and legacy title comment removal.
- non UART type bit stream (!= ucom) support is under planning.
2009-05-24 16:24:25 +00:00
nonaka b822210843 SDHC card was able to be used. 2009-05-24 12:59:54 +00:00
he c411502583 After the change from "struct device *" to "device_t", we now depend
on the definitions from <sys/device.h>, so include it here.
2009-05-23 19:11:19 +00:00
mrg a149917d19 add two new functions for z8530tty: zs_chan_lock() and zs_chan_unlock(),
and use them instead of various spl's in the zs.c's.

reviewed by ad and martin.
2009-05-22 03:51:30 +00:00
dyoung a0d0f249f9 Let us detach pcmcia0 and cardbus0 at cardslot0, and cardslot0 at
cardbus0.
2009-05-21 17:32:32 +00:00
dyoung 85d8d1fcdd On second thought, let's call disk_predetach() disk_begindetach().
Verbs are good.
2009-05-20 03:26:21 +00:00
dyoung 36ee114227 Use disk_predetach(). 2009-05-19 23:43:44 +00:00
pgoyette 9cce088ba8 When displaying boot-time trip-register settings, shift to exclude
fractional bits.  Otherwise, a setting of 52C reports 832 during
boot, and that's way too hot for any memory!
2009-05-19 23:43:27 +00:00
dyoung 9167c17dd5 Add a detachment hook. Detach md(4) at shutdown. 2009-05-19 20:25:41 +00:00
dyoung a94204e132 Delete wdactivate() and sdactivate(). They were no-ops, but as a
side-effect of registering them, config_detach(9) cleared DVF_ACTIVE
before it called wddetach() or sddetach().  Even though sd(4)'s
detachment may have subsequently failed with EBUSY, we could not
begin new disk I/O on sd(4) because the device had been deactivated.

By analogy to sdstrategy(), test device_is_active() in wdstrategy()
and if it is false set b_errno to EIO instead of initiating new
disk I/O.

XXX We should decline more politely to start new I/O, since
XXX !device_is_active() may mean simply that the device is suspended.
XXX I suppose that EIO is safe as long as system suspension is
XXX all-or-nothing.
2009-05-19 19:56:10 +00:00
ad 610bc1e5aa Don't pass a buffer to physio(), let it be allocated dynamically.
This leaves only scsipi and atapi doing the same.
2009-05-18 20:41:57 +00:00
skrll 58cfbf9fac Regen 2009-05-18 09:06:54 +00:00
skrll f9f90e394b Add more devices in my c3700. 2009-05-18 09:06:22 +00:00
he df7cd4eea6 Complete the device_t / softc split by changing the sc_dev member
from "struct device" to "device_t".  Commit overlooked when tga.c was
changed?
2009-05-18 00:14:27 +00:00
dyoung 776b6e11bf Reverse the sense of the DETACH_FORCE check so that we return EBUSY in
the correct circumstances.
2009-05-17 18:11:34 +00:00
cegger 82fdd59cb5 fix crash with LOCKDEBUG+DIAGNOSTIC kernels:
sdhc_bus_clock() calls mutex_enter().
then in DIAGNOSTIC section, sdhc_bus_clock() calls sdhc_card_detect().
sdhc_card_detect() calls mutex_enter() on the same mutex again.
when LOCKDEBUG is enabled, you get

Mutex error: lockdebug_wantlock: locking against myself
2009-05-17 14:36:46 +00:00
tsutsui cb5bffc5fa Split device_t/softc. Tested on D-Link DL-4000. 2009-05-17 02:08:35 +00:00
tsutsui f84df6daef u_intNN_t -> uintNN_t 2009-05-17 01:33:24 +00:00
tsutsui e298c1144d Split device_t/softc.
Tested PCI HME on i386.  Sbus HME is compile test only.
2009-05-17 00:40:43 +00:00
tsutsui 420c7350fb Use device_private() to get struct sbus_softc from device_t parent.
XXX: sbus_softc has been split from device_t on sparc, but not on sparc64!?
2009-05-17 00:28:35 +00:00
dyoung 0f04ad55b3 Do not detach a sd(4) instance if it is open, but return EBUSY,
instead.  If the detach is forced, do what sdclose() does on the
last close: flush the cache, delete our reference to the SCSI bus
device, et cetera.
2009-05-16 20:10:52 +00:00
martin a6eabcae57 we can not free() a dmamap! 2009-05-16 18:24:44 +00:00
tsutsui 87e79748d0 KNF and misc cosmetics. 2009-05-16 14:27:30 +00:00
tsutsui 844c127c73 Split device_t/softc. Tested on arc:
tga0 at pci0 dev 3 function 0: DC21030 step C, board type T8-02
2009-05-16 13:04:26 +00:00
tsutsui d8c545cc8c Split device_t/softc split, tested on VT6212L. 2009-05-16 07:34:05 +00:00
tsutsui d2452bef38 Make ahc_detach() take struct ahc_softc * as well as ahc_attach()
and remove bogus casts around ahc_detach().

XXX: There is a pmf_device_deregister(9) call in ahc_detach()
XXX: while there is no pmf_device_register(9) in ahc_attach().
XXX: It looks more pmf(9) stuff is required for cardbus detach.
2009-05-16 06:44:05 +00:00
tsutsui 7882b9d224 - fix one more device_t/softc split botch in debug code
- use sc->sc_dev to get device_t
- fix inconsistent aprint_error_dev(9) usage
- some KNF and wrap long lines
2009-05-16 05:51:58 +00:00
tsutsui db656c02e4 Fix botch on device_t/softc split.
XXX: still doesn't work (command timeout on data xfer).
2009-05-16 05:26:31 +00:00
tsutsui 49d9fc80f4 Misc cleanup:
- some KNF
- u_intNN_t -> uintNN_t
- wrap long lines and fix indent
- remove return statements at the end of void functions
- use __arraycount()

XXX: many inconsistent aprint_error_dev(9) vs printf(9)
2009-05-16 03:57:57 +00:00
dyoung 0ee9d37122 Do not detach a wd(4) instance if it is open, but return EBUSY,
instead.  If the detach is forced, do what wdclose() does on the
last close: flush the cache, clear the flag WDF_LOADED, and delete
our reference to the ATA bus device.
2009-05-15 23:49:28 +00:00
tsutsui 31ec75e9f1 Split device_t/softc.
No crash on:
esiop0 at pci0 dev 11 function 0: Symbios Logic 53c875 (ultra-wide scsi)
siop0 at pci0 dev 9 function 0: Symbios Logic 53c810a (fast scsi)
siop0 at gsc0 hpa 0xf0830000 path 2/0/7 irq 3 ipl 6: NCR53C720 rev 2
2009-05-15 17:55:44 +00:00
pgoyette 40dfc68c05 Ooops - sdtemp(4) driver requires sysmon. 2009-05-14 13:22:26 +00:00
cegger 76480e5237 regen. 2009-05-13 14:49:57 +00:00
cegger eb3bf0c3e4 add RX780/RX790 chipset host bridge and Radeon X1600 2009-05-13 14:49:20 +00:00
tsutsui 4890eaf0d8 Pass correct size (after padding) to bus_dmamap_sync(9) for RX mbufs
in iee_intr().  Fixes panic on DIAGNOSTIC kernel reported by skrll@.
2009-05-13 13:12:06 +00:00
christos 467b3dd79a sprinkle #ifdef _KERNEL to make scsictl compile. 2009-05-13 02:35:25 +00:00
cegger 7cf2991222 struct device * -> device_t, no functional changes intended. 2009-05-12 14:38:26 +00:00
cegger 99747a8099 struct device * -> device_t, no functional changes intended. 2009-05-12 14:28:22 +00:00
cegger 529e91fca1 struct device * -> device_t, no functional changes intended. 2009-05-12 14:16:35 +00:00
cegger 22f40c6af4 KNF 2009-05-12 14:07:01 +00:00
cegger d16a259fe3 struct cfdata * -> cfdata_t, no functional changes intended. 2009-05-12 13:15:24 +00:00
cegger 32c4940900 struct cfdata * -> cfdata_t, no functional changes intended. 2009-05-12 12:10:29 +00:00
cegger 288e30b1ba undo my previous changes.
unbreaks build of acorn32.
2009-05-12 10:22:31 +00:00
cegger df73a4b15e struct device * -> device_t, no functional changes intended. 2009-05-12 10:16:35 +00:00
cegger 67c088a49a struct cfdata * -> cfdata_t, no functional changes intended. 2009-05-12 10:07:55 +00:00
cegger 93dfc06da9 struct device * -> device_t, no functional changes intended. 2009-05-12 09:50:28 +00:00
cegger e5339e11d4 struct cfdata * -> cfdata_t, no functional changes intended. 2009-05-12 09:29:46 +00:00
cegger ab57cc6f1b struct device * -> device_t, no functional changes intended. 2009-05-12 09:10:15 +00:00
cegger 8a46564d1d struct cfdata * -> cfdata_t, no functional changes intended. 2009-05-12 08:44:19 +00:00
cegger b8169823d2 use device_private().
"looks good" ad@
XXX for the device_t/softc split, please check the driver that no cases have been missed.
2009-05-12 08:22:59 +00:00
cegger 2dc0e43978 use device_xname() 2009-05-11 20:53:47 +00:00
bjh21 7f79b2d5f7 Replace shutdownhooks with pmf in sec(4). 2009-05-11 20:13:49 +00:00
cegger fcd92f8a6e use device_xname() 2009-05-11 17:14:31 +00:00
tsutsui aac17e82ae - rename RTK_HWREV_8102EL_SPIN2 -> RTK_HWREV_8103E
- add a HWREV value for 8168DP
Per Realtek's Linux drivers.
2009-05-11 15:42:33 +00:00
tsutsui 84e868b269 - adjust comments for the previous change
- wrap a long comment
- remove a trailing whitespace
2009-05-10 04:36:58 +00:00
tsutsui f76d0651b7 Misc bus_dma(9) related cleanup:
- calculate each descriptor sizes and offsets in iee_attach() and store them
  into softc, rather than re-calculating them everywhere via macros
- prepare macros to sync DMA shmem per each descriptor
- sync only necessary descriptors in iee_intr() and iee_start()
- make sure SCB_FOO macros take softc as an arg properly
- use bus_dmamap_load_mbuf(9) for RX mbufs
- put 2 byte alignments to RX mbufs

XXX: still slower than ie(4) in i82586 compat mode on HP9000 735/125.
2009-05-10 04:26:19 +00:00
tsutsui 3ec7e0d881 Fix more pasto botch. 2009-05-09 20:44:56 +00:00
tsutsui f8a52a52cb Remove (wrong) function names by pasto from attach failure messages. 2009-05-09 20:42:09 +00:00
pgoyette 465d8da77a Minor white-space KNF nit. No functional change. 2009-05-09 17:32:27 +00:00
sborrill 9ea64db0b6 regen 2009-05-09 15:16:42 +00:00
sborrill 2336481d62 Add alternative product ID for VIA VT8237A Integrated SATA Controller 2009-05-09 15:15:50 +00:00
pgoyette b3c79debe6 Initial implementation of sdtemp(4) driver for on-DIMM temp sensor.
(These optional sensors are specified by JEDEC Standard No. 21-C
Section 4-7 and implemented by multiple vendors.  Tested on my
amd64 machine with Kingston KVR1066D3E7S/2G memory which includes
a STMicro STTS424E02 sensor.)
2009-05-09 15:04:25 +00:00
pgoyette 7450d74baf For multi-byte transfers, the bytes need to be written to or read from
consecutive data registers.  Discovered while debugging sdtemp(4) driver
which does _only_ 16-bit transfers!
2009-05-09 07:13:57 +00:00
pgoyette bbb7ea8f3e You can't use a BYTE protocol to read 16-bits worth of data from the
i2c bus.  Discovered while debugging my sdtemp(4) driver.
2009-05-09 04:56:39 +00:00
tsutsui 8de92473d5 Also check if cache line alignment is power of two in KASSERT(). 2009-05-09 03:54:10 +00:00
tsutsui 42731279ac Use roundup2() macro to calculate cache line aligned offsets of
DMA descriptor members in shared memory.
The previous ones could return wrong values if cache line size is
smaller than structures, and we can assume cache line size is
power of two to avoid division ops.
2009-05-09 03:50:16 +00:00
tsutsui 0eda417b19 Move allocation of DMA shared memory with bus_dma(9) ops
from MD attachments to MI iee_attach().
Tested on HP9000 735/125. Compile test only on ews4800mips.

XXX: more strict bus_dmamap_sync(9) calls are required in various places.
2009-05-09 03:22:20 +00:00
elad b853042065 Introduce actions/requests to handle authorization for ppp(4), sl(4),
strip(4), btuart(4) and bcsp(4) network interfaces and devices.

Mailing list reference:

	http://mail-index.netbsd.org/tech-kern/2009/04/27/msg004955.html
2009-05-07 18:01:56 +00:00
mjacob 30611ba7e0 update firmware 2009-05-07 15:55:18 +00:00
mjacob c83986a8bd Add firmware set for 8Gb card. 2009-05-07 15:54:20 +00:00
skrll 7ab26758f5 device_t/softc split
struct device * -> device_t
struct cfdata * -> cfdata_t
Use aprint*

There are a couple of MI drivers with MD attachments left.
2009-05-07 15:34:49 +00:00
rjs 4179d32aff Use device_private(). 2009-05-07 13:06:11 +00:00
cegger bc33dc599e struct device * -> device_t, no functional changes intended. 2009-05-07 12:15:33 +00:00
cegger 2641fe2fb7 struct device * -> device_t
comment says, first argument of audiobell is a device, so make it a device.
2009-05-07 09:23:01 +00:00
cegger ed4086f2eb struct cfdata * -> cfdata_t, no functional changes intended. 2009-05-07 09:13:13 +00:00
cegger 5496566c68 struct device * -> device_t, no functional changes intended. 2009-05-07 09:11:42 +00:00
cegger 6ee74bfd56 struct device * -> device_t, no functional changes intended. 2009-05-07 08:03:23 +00:00
cegger 602c27254b use device_private() 2009-05-07 07:56:03 +00:00
cegger 930db79c5b struct device * -> device_t, no functional changes intended. 2009-05-07 07:33:05 +00:00
jdc c10e3b28bd Add extra counter definitions (pointed out by Geoff Wing). 2009-05-07 06:46:54 +00:00
cegger 73144fe522 device_t/softc split
patch presented on tech-kern@, no comments on it
2009-05-07 06:08:02 +00:00
ad b5dc34151d Unneeded LK_CANRECURSE. 2009-05-06 22:38:42 +00:00
jdc 6e8d1a982c Check for internal PHY first, so that it always attaches first, even when
we have an MII transeiver attached.
Count all collision and error counters.
Handle counter overflow and RXTERR.

Tested on U60 HME, PCI HME (501-5019) and SBus Sunswift (501-2739)
2009-05-06 20:40:19 +00:00
elad 105d9a093d Replace curlwp->l_cred with kauth_cred_get().
Mailing list reference:

	http://mail-index.netbsd.org/tech-kern/2009/05/05/msg005038.html
2009-05-06 18:41:54 +00:00
cegger af1172fad0 device_t/softc split
tested by jakllsch@
2009-05-06 18:25:28 +00:00
cegger a591bc88dd struct device * -> device_t, no functional changes intended. 2009-05-06 10:34:32 +00:00
cegger 6b9f9b8644 use device_private() 2009-05-06 09:32:52 +00:00
cegger 59717d7121 struct cfdata * -> cfdata_t, no functional changes intended. 2009-05-06 09:25:14 +00:00
cegger 3261738b4d struct cfdata * -> cfdata_t, no functional changes intended. 2009-05-06 08:20:49 +00:00
cegger 6d542a9a5c add KASSERT to identify when PR kern/40734 happens again.
It happened to me twice and to Emmanuel Dreyfus (reported on port-amd64 ML)
2009-05-06 07:27:42 +00:00
mrg a35a651446 you can now easily select trying external drm with "options DRM_EXTERNAL". 2009-05-06 01:33:24 +00:00
macallan 08f5b97b95 clear screen on attach 2009-05-05 23:55:04 +00:00
cegger 52b1d2aee7 struct cfdata * -> cfdata_t 2009-05-05 21:47:49 +00:00
dyoung e470d88889 Change struct cfdata * to cfdata_t. No functional change intended. 2009-05-05 21:34:13 +00:00
cegger 4474fa75b2 device_t/softc split
tested by and ok dyoung@
2009-05-05 21:33:21 +00:00
elad b50c4b9e09 Add device scope actions for rnd(4) and use them.
Mailing list reference:

	http://mail-index.netbsd.org/tech-kern/2009/04/27/msg004953.html
2009-05-05 21:03:28 +00:00
msaitoh b25f90b108 Doesn't print error message only when the register is BGE_SRS_MODE.
It occurs on some environment (and once after boot?). Other *BSDs and
Linux don't print the error message for all registers.
2009-05-05 18:08:28 +00:00
tsutsui 1ad413250a Add support for i82596 Rev A chip which doesn't have the enhanced 32 bit
big endian mode:
- add IEE_REV_A flag to indicate if chip support the 32 bit BE mode or not
- add IEE_SWAPA32() macro and use it on necessary 32 bit DMA pointers
- rename IEE_SWAP() macro for the SCP address pointer and statistics
  counters which require word swap even on Rev B/C chips to IEE_SWAP32()
  for clarification
- add comments about these BE mode quirks

Tested on HP9000 735/125 by me and also tested on 715/50 by skrll@
with netbsd-5 branch, and fixes MI part of PR port-hp700/35531.
2009-05-05 15:47:35 +00:00
nonaka 6cb21f59ee Added NE2000 with 8bit bus width support.
reviewd by tsutsui@ at tech-kern ML.
2009-05-05 12:37:24 +00:00
cegger 06e69f3860 struct device * -> device_t 2009-05-05 12:10:07 +00:00
cegger f2bccc0a8e struct device * -> device_t, use device_private() 2009-05-05 12:07:15 +00:00
cegger 73af259591 Attach on BCM5709 chip.
XXX Firmware fails to complete initialization on this chip.
2009-05-05 10:21:22 +00:00
cegger dc97f7f624 print autoconf error message with aprint_error 2009-05-05 10:02:52 +00:00
cegger 6a970ea21d device_t/softc split 2009-05-05 09:51:23 +00:00
manu c328d568d4 TFTPROOT loads the RAMdisk through TFTP at boot time. It needs the
network to be functionnal, and therefore must be called after
config_finalize(). Unfortunately, config_finalize() attaches md0
through mdattach(), and when tftproot_getfile() attempts to attach it
later by calling mdattach() again, it gets a failure.

This change checks for the RAMdisk size in mdattach(). If it is zero, then
the RAMdisk has not been loaded yet, and nothing is done. It will be
attached later when tftproot_getfile() will call mdattach()
2009-05-04 16:20:41 +00:00
markd a44286a718 Treat G4X like I915 and G33 for MSAC. Fixes aperture setting.
Has been working successfully for me and snj for the last few months.
2009-05-04 11:05:45 +00:00
tsutsui cf78f721dd Make COM_RING_SIZE configurable by kernel config(5). 2009-05-03 13:52:36 +00:00
tsutsui 8fa3bb31fc Remove unused sc_rev settings (all quirks are handled by sc_quirk)
and merge HWREV cases which have the same quirks.
2009-05-03 13:49:07 +00:00
dyoung 85d5fd7b83 In pccbb_pci_callback(), set CBB_SPECMAPPED in sc_flags if we've
acquired bus space from bus_space_alloc(9) or from rbus_space_alloc(),
so that we use the appropriate routine to release the bus space in
pccbbdetach().  This stops panics during cbb(4) detachment (esp. at
shutdown) on some systems.

Thanks to Kurt Schreiner for testing the fix, Kurt, Patrick Welche,
Pouya D. Tafti, and Matt Green for reporting.
2009-05-03 00:31:12 +00:00
martin 1e54487f2a Correct previous: detaching uhubN makes the bus pointer NULL 2009-05-02 22:28:41 +00:00
martin 9b2932709e If we are unlucky, during detach of child devices, after a uhub has detached,
our uhci_poll_hub callout might strike. The detaching of the uhub has left
the device member in the pipe NULL, so make sure we do not dereference it.

We could halt the callout before detaching child devices, but it this
would likely interfere with proper servicing the child devices while
they are still around.
2009-05-02 22:09:39 +00:00
oster 62f6e89480 Fix assignment of SUsPerPU and add SUsPerRU assignment. Reported by
and fix from Anthony Mallet in PR#41328.  Thanks!
2009-05-02 21:11:26 +00:00
dyoung aaa0eb2937 Use device_t, cfdata_t, device_private(). 2009-05-01 20:43:41 +00:00
martin cb13eee90c Add missing braces - patch from Kurt Lidl in PR port-vax/41314. 2009-05-01 03:18:20 +00:00
nonaka a6a538b335 compile again. 2009-05-01 00:15:57 +00:00
dyoung ee9d8d96c8 Straggler from last vnd(4) commit: #define VNF_CLEARING. 2009-04-30 22:36:10 +00:00
dyoung c968789de1 Flesh out vnd_detach(). Let the system detach vnd(4) at shutdown. Stop
vnd_ioctl(VNDIOCCLR) from racing with vndopen() to call vndclear().
2009-04-30 20:34:08 +00:00
dyoung b44d7cdf40 Fix spelling. if( -> if (. No functional change intended. 2009-04-30 16:38:12 +00:00
dyoung 114a99200c Use NULL instead of (type *)0. Delete extraneous parentheses. No
functional change intended.
2009-04-30 16:07:50 +00:00
skrll 51d0553d6a Regen (again) 2009-04-30 15:14:49 +00:00
skrll 6cc4b39756 Add another NS product found in hppa machines. 2009-04-30 15:13:58 +00:00
skrll 9763c0c6d8 Regen. 2009-04-30 15:07:44 +00:00
skrll c026dcb4aa Add the National Semiconductor PC87560 Legacy IO chip on systems with
PA-8500 and later 64-bit CPUs.
2009-04-30 15:03:30 +00:00
tsutsui f6e36a0172 Pull some changes for newer chips from FreeBSD:
- pull MACSTAT and CMDSTOP quirks for 8168/8111 chips
- always set CPLUSCMD_PCI_MRW on reset
- set VLANSTRIP and RXCSUM_ENB bits on CPLUS register per if_capenable

Tested on 8111C and 8111D by several users, and
no bad side effect on my old 8169S.
2009-04-29 15:10:57 +00:00
dyoung d446e68bf2 Use device_t, cfdata_t, and device_private(). 2009-04-28 22:43:50 +00:00
ginsbach 6be6867d6d Regen for Mellanox additions. 2009-04-28 14:32:43 +00:00
ginsbach ea30fa5024 Add Mellanox Technologies Infiniband devices. 2009-04-28 14:27:16 +00:00
tsutsui da88f224b7 Remove magic reset sequence except wakeup for rev 2 chips which breaks 8111D.
Problem reported and fix confirmed by Thomas Bieg on current-users.

Also tested on 8111C (no bad side effect) by several users privately.
2009-04-28 13:25:17 +00:00
cegger a4aa7dace4 on detach, deregister from pmf 2009-04-28 11:49:15 +00:00
cegger 9bb7df81f0 on detach, deregister from pmf and free resource 2009-04-28 11:47:56 +00:00
tsutsui 9998edcec4 Wrap one more printf() with #ifdef DEBUG, which was missed on rev 1.52. 2009-04-27 14:52:50 +00:00
tsutsui 70dab57692 Always make local functions static. Local symbols are still preserved
on link by ld(1) with -X option on most ports for debug.
2009-04-26 16:17:08 +00:00
nonaka 35df2d384d fix build broken.
Pointed by Takeshi Nakayama.
2009-04-26 13:05:55 +00:00
cegger 2cae64a195 check error code from bwi_attach() 2009-04-26 10:45:19 +00:00
cegger 394d81abd5 fix error handling 2009-04-26 10:26:54 +00:00
cegger 57fb22a89c device_t/softc split 2009-04-26 10:07:48 +00:00
cegger c6c48498e2 prepare device_t/softc split 2009-04-26 09:56:46 +00:00
cegger 32e56df1e0 u_intNN_t -> uintNN_t 2009-04-26 09:47:31 +00:00
cegger 60326e09a5 - Fix error handling in attachment
- use aprint_*_dev
2009-04-26 09:12:33 +00:00
cegger 1ab9e723df detach ohci on shutdown 2009-04-26 08:54:13 +00:00
cegger c398d65d42 Fix error handling. 2009-04-26 08:46:10 +00:00
elad 03d23b4d6b Authorizing actions from the generic scope using a device scope wrapper
is a big no-no.

As painful as it is, use kauth_authorize_generic() for now.
2009-04-26 07:53:43 +00:00
nonaka 9445e9e796 Added some command definitions. 2009-04-26 07:21:13 +00:00
cegger c1bf5ecbc4 age_intr: don't return w/o ack. the interrupt.
Add a comment when this special case can happen.
2009-04-26 07:01:29 +00:00
cegger f8c09ed139 fix error handling in lii_attach()
ok jmcneill@
2009-04-26 06:56:46 +00:00
tsutsui d7ac09b75f - use (uint8_t *) for RX buffer
- remove unnecessary pointer casts
2009-04-26 02:25:57 +00:00
pgoyette 5dd6c0425b When drm is compiled in only for PCI devices, agp_flush_cache() is not
defined.  Wrap the call to it with #ifndef DRM_NO_AGP to avoid link
errors.
2009-04-26 02:23:26 +00:00
tsutsui 378ce951b9 Use roundup2() macro. 2009-04-25 18:27:39 +00:00
tsutsui 76e4602ef6 Add RCS Id. 2009-04-25 17:04:40 +00:00
tsutsui be608a6ecc Regen from pcidevs rev 1.983:
> Tweak some Realtek re(4) device names.
2009-04-25 15:30:17 +00:00
tsutsui 0ea749c026 Tweak some Realtek re(4) device names. 2009-04-25 15:29:18 +00:00
tsutsui 90c44cfe77 Remove suffix "B" from rtk_name of PCI_PRODUCT_REALTEK_RT8168 devices.
All 8168/8111 variants (8168/8168B/8168C/8168CP/8168D/8111B/8111C/8111CP)
have the same PCI device ID.
2009-04-25 06:16:12 +00:00
jakllsch abf7e840eb Add Microchip PICkit 1 to HID blacklist. 2009-04-24 14:16:50 +00:00
jakllsch e75d76046a regen. 2009-04-24 14:07:36 +00:00
jakllsch 1cdfeda3ef Add Microchip Technology vendor ID and two PICkit device IDs thereof. 2009-04-24 14:06:22 +00:00
macallan c7d8ba2450 Add wscons support 2009-04-23 20:46:49 +00:00
kefren 02190332dd Add power hooks. Proposed a couple of days ago on tech-kern@, no
objections received. Tested on Dell Inspiron 2200 with BCM4318
2009-04-23 20:24:23 +00:00
msaitoh e447a613d9 use proplib 2009-04-23 10:47:43 +00:00
msaitoh 278d80cb78 remove obsolete code. 2009-04-23 10:43:31 +00:00
kefren 62e6076ccd Add pmf hooks. Proposed two days ago on tech-kern@, no objections.
Tested on amd64 with Asus P5Q-E mainboard with onboard Yukon Lite
2009-04-23 09:18:25 +00:00
cube 418489f555 Regen. 2009-04-21 16:36:06 +00:00
cube 25c5d062fb Add a number of products that use Realtek's RTL8187 802.11 chip. 2009-04-21 16:34:41 +00:00
taca aa7979227e Add support for USB serial adapter REX-USB60F which I tested. 2009-04-21 16:26:01 +00:00
taca 90b2a1c26b Regen. 2009-04-21 16:24:37 +00:00
taca 663028896a Add product id for RATOC USB serial adapter REX-USB60F. 2009-04-21 16:23:36 +00:00
tsutsui 34ef135b8c Fix wrong arguments of bus_dmamem_free(9).
XXX: not all resouces are freed properly on error path in age_dma_alloc().
2009-04-21 13:16:36 +00:00
nonaka e1c4491975 regen 2009-04-21 03:10:41 +00:00
nonaka e0297d1ead Added SD/MMC support from OpenBSD.
tested on i386, amd64 at current-users ML by pgoyette@.
tested on zaurus by myself.
2009-04-21 03:00:29 +00:00
rafal a566e67fbe Rework scatter / gather page allocation inspired by r186295 of FreeBSD SVN:
rework drm_scatter.c which allocates scatter / gather pages for use by
    ati pci gart to use bus_dma to handle the allocations.  This fixes
    a garbled screen issue on at least some radeons (X1400 tested).  It is
    also likely that this is the correct fix for PR# 119324, though that
    is not confirmed yet.

Fixes similar issues on a Radeon Mobility X300, non-Mobility X800 (including
a hard-lock of the machine).

With feedback from ad@, ok mrg@
2009-04-21 01:15:37 +00:00
cegger 85620a64b2 Add ale(4), a driver for Attansic/Atheros L1E gigabit ethernet device.
Ported by me from OpenBSD, improvements from Kevin Lahey,
successfully tested by Kevin Lahey and Stephen Borrill.
2009-04-20 20:10:23 +00:00
mschuett 0d53a16d76 Add queue macros SLIST_FOREACH_SAFE, STAILQ_FOREACH_SAFE, STAILQ_LAST,
SIMPLEQ_CONCAT, and SIMPLEQ_LAST.

Remove seperate definitions outside of queue.h.
2009-04-20 09:56:07 +00:00
ad e2c5e0a204 In this case "XXX free other data structures XXX" includes stopping and
destroying the callout.
2009-04-19 12:32:52 +00:00
msaitoh 3322726436 regen. 2009-04-19 11:18:07 +00:00
msaitoh 2449d3efc1 Oooops. Back out some of previous my commit. 2009-04-19 11:17:46 +00:00
msaitoh 4d9e9f6912 Some fixes and enhancements:
Both if_bge* and brgphy.[ch]:
    Check the parent's MAC and use the quirk code for the bug like OpenBSD and
    FreeBSD. Some bugs can't identify the PHY ID. For example, 5704 Ax has the
    ADC bug, but 5704 A3 and 5704 B0 have the same PHY ID and revision. Add
    BGE_PHY_CRC_BUG, BGE_PHY_ADC_BUG, BGE_PHY_5704_A0_BUG, BGE_PHY_JITTER_BUG,
    BGE_PHY_ADJUST_TRIM and BGE_PHY_BER_BUG for this flag. Some of the DSP
    patches are newly taken from OpenBSD and FreeBSD.

  if_bge*:
    Remove duplicated BGE_CHIPID_BCM5714_A0 entry in the known CHIPID table.
    Fix obsolete comments.

  brgphy.[ch]:
    Add some PHY IDs.

TODO:
  Add more three quirk code into bge and brgphy (the brgphy side's are
  currently #if0'ed).
  Add support for bnx into brgphy (currently #if0'ed)
2009-04-19 11:10:36 +00:00
msaitoh 559b0165b6 Add mii_mpd_rev to keep MII PHY revision. 2009-04-19 10:47:48 +00:00
msaitoh ed6e698500 regen 2009-04-19 10:25:48 +00:00
msaitoh a57ebfe2e5 Add some boradcom's PHYs.
Sort.
2009-04-19 10:25:25 +00:00
tsutsui d24f7d6156 Revert bcopy -> memcpy change inside #ifdef BCOPY_FASTER block. 2009-04-18 15:04:26 +00:00
tsutsui d779b85d3e Remove extra whitespace added by a stupid tool.
XXX: more in src/sys/arch
2009-04-18 14:58:02 +00:00
cegger 217d969936 Initialize callout and lists before we check for errors.
This fixes crashes in ohci_detach() when ohci_init() failed.
2009-04-18 06:27:17 +00:00
dyoung 2e016b467d Bug fix: don't release the Rx DMA maps twice. 2009-04-17 23:23:23 +00:00
dyoung 64670508f7 Detach pcppi0 at isa0 during shutdown. 2009-04-17 20:46:37 +00:00
christos dbbba1ac10 appease gcc 2009-04-17 20:32:27 +00:00
dyoung 9c07c1c9a8 Detach audio(4) during shutdown. 2009-04-17 20:04:35 +00:00
dyoung a3a7e82760 Use device_t instead of 'struct device *' or device_ptr_t. Use cfdata_t
instead of 'struct cfdata *'. Delete some gratuitous parentheses.
2009-04-17 19:44:13 +00:00
cegger 7844441cd2 backout rev. 1.112. I was misleaded by the wrong pci(9) manpage. 2009-04-17 19:04:20 +00:00
joerg 95021059eb Move initialisation of the irq spinlock into the device handling code,
at least the Intel driver depends on it whether the IRQ is currently
enabled or not.
2009-04-17 19:02:33 +00:00
cegger 7bd8016175 pci_activate() wants a softc and not a device 2009-04-17 18:43:53 +00:00
dyoung 40bf52a73b Disable interrupts on the h/w before disestablishing the PCI interrupt
handler.
2009-04-17 17:31:01 +00:00
dyoung d792f4788e Disable interrupts on the h/w before detaching the interrupt
handler.  Protects against the problem described in
<http://mail-index.netbsd.org/port-i386/2009/04/10/msg001317.html>,
Xintr_ioapic_levelN jumps to 0 during shutdown.
2009-04-17 17:21:31 +00:00
cegger adee6ed051 check return code of tlp_attach() 2009-04-17 16:57:37 +00:00
tsutsui 25e0185c3d Check revisions and print names of i82551/i82551ER, per Intel manual. 2009-04-17 15:37:43 +00:00
cegger 5f4ec2a0a9 change tlp_attach() to return an error code on failure. 2009-04-17 15:22:35 +00:00
cegger 0cdcfeb162 set dmamap to NULL when bus_dmamap_create() fails to prevent bus_dmamap_destroy to be called with an invalid dmamap in error path. 2009-04-17 15:16:52 +00:00
cegger bb95b8c8db Free resources in error path.
While here, fix copy&paste error I introduced in rev. 1.108.
2009-04-17 14:07:32 +00:00
cegger 65e67e65cc use aprint_* 2009-04-17 13:15:53 +00:00
cegger f52d4b8ffb Detach tlp(4) during shutdown.
Free unused resources on attachment.
2009-04-17 12:59:19 +00:00
cegger c455042514 device_t/softc split. Tested with tlp at pci 2009-04-17 10:20:32 +00:00
cegger dc79b83a9a struct device * -> device_t
u_intNN_t -> uintNN_t
2009-04-17 08:30:55 +00:00
cegger bb47f93acf use device_private 2009-04-17 08:19:09 +00:00
cegger 4815538f3f struct device * -> device_t
u_intNN_t -> uintNN_t
2009-04-17 08:04:49 +00:00
macallan 9757abaa0c use sparc_bus_map_large() to map the I128 framebuffer 2009-04-16 17:00:39 +00:00
tsutsui 89de08c2ca - remove a redundant decl of boothowto; it's in <sys/systm.h>
- replace a magic number passed to format_bytes(9) with explicit strings
- some KNF
2009-04-16 14:46:33 +00:00
tsutsui a8ca89b280 Some cosmetics in rxcsum code. Tested on i386. 2009-04-16 14:39:11 +00:00
tsutsui 04a4566ade u_intNN_t -> uintNN_t 2009-04-16 14:08:18 +00:00
tsutsui 390140016b - remove an extra decl of cn_tab, which is in <dev/cons.h>
- some KNF
2009-04-16 12:57:22 +00:00
tsutsui 859579fb10 There is a report that 82559ER doesn't have RX hardware checksum support
(even though it has a newer revision number than 82559_A0),
so handle it separately per its own PCI device ID.
2009-04-16 12:41:51 +00:00
msaitoh 8dc86612ab Take some code from FreeBSD and OpenBSD:
Fix some bugs that the driver unable to detect link loss (OpenBSD 1.135,
  FreeBSD 1.102)

  bge_tick(): fix some extra input error (OpenBSD 1.221 FreeBSD 1.212)

  Acknowledge link change interrupts by setting the 'link changed' bit
  in the status register (used to have no effect). FreeBSD 1.44 (OpenBSD 1.21)

  Add some fiber support (OpenBSD 1.220)

  Set BGE_MISCCFG_KEEP_GPHY_POWER as {Open,Free}BSD and linux.

  Add special case code to fix a problem with the BCM5704 in TBI mode
  (FreeBSD rev. 1.71, OpenBSD rev. 1.35)

  Force an interrupt in bge_ifmedia_upd (FreeBSD rev. 1.205, OpenBSD rev.
  1.242)

  Add missing workaround for 5705 (FreeBSD rev. 1.44, OpenBSD rev. 1.21)

  Add some known CHIPID entries.
2009-04-16 01:38:34 +00:00
msaitoh e8e69d0b8b Fix the case of setting a flag in BGE_PCI_DMA_RW_CTL (on conventional PCI)
again.
2009-04-16 01:35:24 +00:00
elad 2d1c968399 Remove a few KAUTH_GENERIC_ISSUSER in favor of more descriptive
alternatives.

Discussed on tech-kern:

	http://mail-index.netbsd.org/tech-kern/2009/04/11/msg004798.html

Input from ad@, christos@, dyoung@, tsutsui@.

Okay ad@.
2009-04-15 20:44:24 +00:00
dyoung 773ba4e409 Delete two unused data members, the powerhook and the shutdownhook
handles.
2009-04-14 20:17:15 +00:00
haad 33e2a4a918 Destroy locks in dm_dev_free, do not allocate struct disk twice. 2009-04-13 18:51:54 +00:00
haad a650e4b356 Update to reality. 2009-04-13 16:12:27 +00:00
tsutsui bd151a8481 Assume an unknown HWREV chip has the same features with the latest one. 2009-04-13 12:38:06 +00:00