Commit Graph

18655 Commits

Author SHA1 Message Date
Robert Noland
b2a9095767 Change the logic around to match ati_pcigart.
MFC after:	3 days
2009-03-17 03:36:24 +00:00
Robert Noland
162e0ab8c1 Use flsl() here rather than ffsl()
I discovered that we were computing page_order differently than linux.

MFC after:	3 days
2009-03-17 03:32:12 +00:00
Andrew Thompson
7214348f57 MFp4 //depot/projects/usb 159225,159241,159292
Fix regression issue in the USB file system interface.
 - Use cdev_privdata pointer as indicator of correct file handle.
 - Remove redundant FIFO opened flags.

Don't send ZLP at close for ulpt and uscanner devices as this causes some
models to stop working. This reverts back to the USB1 behaviour.

Submitted by:	Hans Petter Selasky
2009-03-17 01:46:40 +00:00
Andrew Thompson
39fcd91bb5 MFp4 //depot/projects/usb 159238,159275
Add umass quirks.

Submitted by:	Michael Gmelin
2009-03-17 01:42:46 +00:00
Andrew Thompson
d3db083bcc Add Supertop IDE adapter and Quickcam entries. 2009-03-17 01:38:51 +00:00
Jung-uk Kim
c66d2b38c8 Initial suspend/resume support for amd64.
This code is heavily inspired by Takanori Watanabe's experimental SMP patch
for i386 and large portion was shamelessly cut and pasted from Peter Wemm's
AP boot code.
2009-03-17 00:48:11 +00:00
Robert Noland
6443904ee1 Use the right MSI_REARM for RS600.
MFC after:	3 days
2009-03-16 19:09:59 +00:00
Alexander Motin
83c59ed283 Remove CD input hack for ALC268 based Acer systems. Latest systems does not
implement CD input in hardware, while unconditional showing it confuse users.
Also it was made in the way that sometimes improper with present driver.

Add patch for ALC268 based Acer TM5320 to make headphones jack sensing work.
Default configuration defines two separate playback associations, which
current driver unable to trace properly due to order they are defined and
limited codec uniformity.

Submitted by:	G. Mirov <g.mirov AT gmail.com>
2009-03-16 15:50:29 +00:00
Alexander Motin
ad7de3aafb Fix spelling in message. 2009-03-16 12:42:23 +00:00
Robert Noland
910ac6da21 Teach psm about O_ASYNC
This makes Xorg happy if you aren't using moused.

MFC after:	3 days
2009-03-16 08:21:51 +00:00
Robert Noland
85c5cd4b94 Get rid of any remaining PZERO flags in mtx_sleep()
Also, clean up some ifdef mess while I'm here.

MFC after:	3 days
2009-03-16 08:19:11 +00:00
Robert Noland
96deaed545 Fix R600 writeback across suspend/resume.
This is likely a NOOP for us, since I haven't ported the suspend/resume
code yet.

MFC after:	3 days
2009-03-16 08:15:35 +00:00
Warner Losh
9dffe835eb Don't adjust ranges at all for subtractive bridges. The simple-minded
stuff we're doing is too simple-minded, so back it out for now.
2009-03-15 06:40:57 +00:00
Warner Losh
d557a26b80 Generalize the workaround for the Hitachi HT-4840-11. The Contec
C-NET(PC) has a cfe at location 1 that has both an odd irq mask (it
matches pc98 machines, so maybe it was a flag for pc98 operation) as
well as a memory map.  Since this driver doesn't know how to cope, we
start with cfe2, which is purely an I/O space mapped and that seems to
make it work.  I say 'seems' here, because the card I have doesn't
seem to have the right dongle for full testing...
2009-03-15 02:31:34 +00:00
Warner Losh
795dceffa2 Two fixes:
(1) Fix pcib_read/write_config prototypes.
(2) When contrainting a resource request for a 'subtractive' bridge,
    it is important to select a range outside the base/limit
    registers, since those are the only values known to not
    possibly work.  On my HP laptop, the base bridge excludes I/O
    ports 0xa000-0xafff, however that was the range we were passing
    up the tree.  Instead, when a range spans the "hole" we now
    arbitrarily pick the range just above the hole to allocate from.

All of my rl and xl cards, at a minimum, started working again on this
laptop with those fixes.
2009-03-14 14:08:53 +00:00
Andrew Thompson
3f67dc0f46 HID usage minimum can be equal to the maximum.
Submitted by:	Hans Petter Selasky
Tested by:	Andreas Tobler
2009-03-13 22:28:37 +00:00
Rui Paulo
869041cd77 Fix comment explaining where this driver came from.
MFC after:	2 weeks
2009-03-13 16:43:31 +00:00
Rui Paulo
454e82d77e Rename all the variables/function names/structs/etc. to reflect the
driver name change.
While there, update copyright.

MFC after:	2 weeks
2009-03-13 16:28:25 +00:00
Rui Paulo
fc1f75e512 Rename the k8temp driver to amdtemp.
MFC after:	2 weeks
2009-03-13 16:08:08 +00:00
Warner Losh
e6d3b1bd2a Minorly improved debugging. Use the DEVPRINTF macro and report the
offset for memory when mapping in the CIS.
2009-03-13 05:31:27 +00:00
Warner Losh
3fdd7f1605 We need to initialize the console for dcons to work.
Submitted by:	nork@
2009-03-13 02:15:49 +00:00
Rui Paulo
834772014b Add support for 10h and 11h family of processors. Also, make the sysctl
look like a temperature.

This driver will most likely be renamed to something more meaningful in
the near future.

Submitted by:	nork
MFC after:	2 weeks
2009-03-12 18:59:39 +00:00
Sam Leffler
4a948799c2 preliminary ar9280 support:
o add 9280 attach that sets up ini, cal, etc.
o new rf backend for 9280 and later parts
o split ini setup and spur mitigation support out to methods
  and provide 9280-specific support
o minor fixups to shared code to handle 9280-specific work

Obtained from:	Atheros (ini values and some code)
2009-03-12 18:18:28 +00:00
Warner Losh
afb1ec6d56 Move the deactivation of the device's BAR to before the loop where we
turn deactivate the resources.  While this likely doesn't matter, it
is likely to be safer.
2009-03-12 08:42:27 +00:00
Warner Losh
b1db3b7a40 Fix the whitespace in this file to be consistent with itself and with
the rest of the project's files.

s/sn_/fe_/ in a routine name that I copied from sn.
2009-03-12 07:18:27 +00:00
Warner Losh
125da88acd read_ivar takes a uintptr_t * not a u_char *. 2009-03-12 06:36:44 +00:00
Warner Losh
bb7cc1aa22 o writereg needs to return a vlue.
o Add TJ PTJ-LAN_T card.  Some more work may be needed to make this
  actually function correctly.
2009-03-12 06:35:00 +00:00
Warner Losh
34a53f3f6b Make the bit-bang callbacks for i2c implementation match their prototypes. 2009-03-12 06:32:30 +00:00
Warner Losh
aef30cdbf5 Check the Disk FUNCE recorded in the CIS to see if we should probe for
both disks, or if we should suppress the slave drive.  Default to
suppressing the slave, in the case that this REQIURED tuple turns out
to not actually be present...
2009-03-12 06:30:59 +00:00
Warner Losh
bca6fb928e Better name for this routine... it doesn't reset the card, but resets
the power to the card...
2009-03-12 06:25:30 +00:00
Weongyo Jeong
2c964f43b6 o change a lock model based on HAL preemption lock to a normal mtx.
Based on the HAL preemption lock there is a problem on SMP machines
  and causes a panic.
o When a device detached the current tactic to detach NDIS USB driver is
  to call SURPRISE_REMOVED event.  So it don't need to call
  ndis_halt_nic() again.  This fixes some page faults when some drivers
  work abnormal.
o it assumes now that URB_FUNCTION_BULK_OR_INTERRUPT_TRANSFER is in
  DISPATCH_LEVEL (non-sleepable) and as further work
  URB_FUNCTION_VENDOR_XXX and URB_FUNCTION_CLASS_XXX should be.

Reviewed by:	Hans Petter Selasky <hselasky_at_freebsd.org>
Tested by:	Paul B. Mahol <onemda_at_gmail.com>
2009-03-12 02:51:55 +00:00
Andrew Thompson
46364b29a8 MFp4 //depot/projects/usb 159004,159053,159091
More HID parsing fixes for usb mice.
 - be less strict on the last HID item usage.
 - preserve item size and count accross items
 - improve default HID usage selection.

Tested by:	ache
Submitted by:	Hans Petter Selasky
2009-03-12 02:32:54 +00:00
Pyun YongHyeon
c92b9c8898 bus_dma(9) conversion and make txp(4) work on all architectures.
o Header file cleanup.
o bus_dma(9) conversion.
  - Removed all consumers of vtophys(9) and converted to use
    bus_dma(9).
  - Typhoon2 functional specification says the controller supports
    64bit DMA addressing. However all Typhoon controllers are known
    to lack of DAC support so 64bit DMA support was disabled.
  - The hardware can't handle more 16 fragmented Tx DMA segments so
    teach txp(4) to collapse these segments to be less than 16.
  - Added Rx buffer alignment requirements(4 bytes alignment) and
    implemented fixup code to align receive frame. Previously
    txp(4) always copied Rx frame to align it on 2 byte boundary
    but its copy overhead is much higher than unaligned access on
    i386/amd64. Alignment fixup code is now applied only for
    strict-alignment architectures. With this change i386 and
    amd64 will get instant Rx performance boost. Typhoon2 datasheet
    mentions a command that pads arbitrary bytes in Rx buffer but
    that command does not work.
  - Nuked pointer trick in descriptor ring. This does not work on
    sparc64 and replaced it with bcopy. Alternatively txp(4) can
    embed a 32 bits index value into the descriptor and compute
    real buffer address but it may make code complicated.
  - Added endianness support code in various Tx/Rx/command/response
    descriptor access. With this change txp(4) should work on all
    architectures.
o Added comments for known firmware bugs(Tx checksum offloading,
  TSO, VLAN stripping and Rx buffer padding control).
o Prefer faster memory space register access to I/O space access.
  Added fall-back mechanism to use alternative I/O space access.
  The hardware supports both memory and I/O mapped access. Users
  can still force to use old I/O space access by setting
  hw.txp.prefer_iomap tunable to 1 in /boot/loader.conf.
o Added experimental suspend/resume methods.
o Nuke error prone Rx buffer handling code and implemented local
  buffer management with TAILQ. Be definition the controller can't
  pass the last received frame to host if no Rx free buffers are
  available to use as head and tail pointer of Rx descriptor ring
  can't have the same value. In that case the Rx buffer pointer in
  Rx buffer ring still holds a valid buffer and txp_rxbuf_reclaim()
  can't fill Rx buffers as the first buffer is still valid. Instead
  of relying on the value of Rx buffer ring, introduce local buffer
  management code to handle empty buffer situation. This should fix
  a long standing bug which completely hangs the controller under
  high network load. I could easily trigger the issue by sending 64
  bytes UDP frames with netperf. I have no idea how this bugs was
  not fixed for a long time.
o Converted ithread interrupt handler to filter based one.
o Rearranged txp_detach routine such that it's now used for general
  clean-up routine.
o Show sleep image version on device attach time. This will help
  to know what action should be taken depending on sleep image
  version. The version information in datasheet was wrong for newer
  NV images so I followed Linux which seems to correctly extract
  version numbers from response descriptors.
o Firmware image is no longer downloaded in device attach time. Now
  it is reloaded whenever if_init is invoked. This is to ensure
  correct operation of hardware when something goes wrong.
  Previously the controller always run without regard to running
  state of firmware. This change will add additional controller
  initialization time but it give more robust operation as txp(4)
  always start off from a known state. The controller is put into
  sleep state until administrator explicitly up the interface.
o As firmware is loaded in if_init handler, it's now possible to
  implement real watchdog timeout handler. When watchdog timer is
  expired, full-reset the controller and initialize the hardware
  again as most other drivers do. While I'm here use our own timer
  for watchdog instead of using if_watchdog/if_timer interface.
o Instead of masking specific interrupts with TXP_IMR register,
  program TXP_IER register with the interrupts to be raised and
  use TXP_IMR to toggle interrupt generation.
o Implemented txp_wait() to wait a specific state of a controller.
o Separate boot related code from txp_download_fw() and name it
  txp_boot() to handle boot process.
o Added bus_barrier(9) to host to ARM communication.
o Added endianness to all typhoon command processing. The ARM93C
  always expects little-endian format of command/data.
o Removed __STRICT_ALIGNMENT which is not valid on FreeBSD.
  __NO_STRICT_ALIGNMENT is provided for that purpose on FreeBSD.
  Previously __STRICT_ALIGNMENT was unconditionally defined for
  all architectures.
o Rewrote SIOCSIFCAP ioctl handler such that each capability can be
  controlled by ifconfig(8). Note, disabling VLAN hardware tagging
  has no effect due to the bug of firmware.
o Don't send TXP_CMD_CLEAR_STATISTICS to clear MAC statistics in
  txp_tick(). The command is not atomic. Instead, just read the
  statistics and reflect saved statistics to the statistics.
  dev.txp.%d.stats sysctl node provides detailed MAC statistics.
  This also reduces a lot of waste of CPU cycles as processing a
  command ring takes a very long time on ARM93C. Note, Rx
  multicast and broadcast statistics does not seem to right. It
  might be another bug of firmware.
o Implemented link state change handling in txp_tick(). Now sending
  packets is allowed only after establishing a valid link. Also
  invoke link state change notification whenever its state is
  changed so pseudo drivers like lagg(4) that relies on link state
  can work with failover or link aggregation without hacks.
  if_baudrate is updated to resolved speed so SNMP agents can get
  correct bandwidth parameters.
o Overhauled Tx routine such that it now honors number of allowable
  DMA segments and checks for 4 free descriptors before trying to
  send a frame. A frame may require  4 descriptors(1 frame
  descriptor, 1 or more frame descriptors, 1 TSO option descriptor,
  one free descriptor to prevent descriptor wrap-around) at least
  so it's necessary to check available free descriptors prior to
  setting up DMA operation.
o Added a sysctl variable dev.txp.%d.process_limit to control
  how many received frames should be served in Rx handler. Valid
  ranges are 16 to 128(default 64) in unit of frames.
o Added ALTQ(4) support.
o Added missing IFCAP_VLAN_HWCSUM as txp(4) can offload checksum
  calculation as well as VLAN tag insertion/stripping.
o Fixed media header length for VLAN.
o Don't set if_mtu in device attach, it's already set in
  ether_ifattach().
o Enabled MWI.
o Fixed module unload panic when bpf listeners are active.
o Rearranged ethernet address programming logic such that it works
   on strict-alignment architectures.
o Removed unused member variables in softc.
o Added support for WOL.
o Removed now unused TXP_PCI_LOMEM/TXP_PCI_LOIO.
o Added wakeup command TXP_BOOTCMD_WAKEUP definition.
o Added a new firmware version query command, TXP_CMD_READ_VERSION.
o Removed volatile keyword in softc as bus_dmamap_sync(9) should
  take care of this.
o Removed embedded union trick of a structure used to to access
  a pointer on LP64 systems.
o Added a few TSO related definitions for struct txp_tcpseg_desc.
  However TSO is not used at all due to the limitation of hardware.
o Redefined PKT_MAX_PKTLEN to theoretical maximum size of a frame.
o Switched from bus_space_{read|write}_4 to bus_{read|write}_4.
o Added a new macro TXP_DESC_INC to compute next descriptor index.

Tested by:	don.nasco <> gmail dot com
2009-03-12 01:14:47 +00:00
Sam Leffler
d9bde68623 add asserts 2009-03-12 00:09:29 +00:00
Doug Rabson
1267802438 Merge in support for Xen HVM on amd64 architecture. 2009-03-11 15:30:12 +00:00
John Baldwin
33fc362512 Add a new internal mount flag (MNTK_EXTENDED_SHARED) to indicate that a
filesystem supports additional operations using shared vnode locks.
Currently this is used to enable shared locks for open() and close() of
read-only file descriptors.
- When an ISOPEN namei() request is performed with LOCKSHARED, use a
  shared vnode lock for the leaf vnode only if the mount point has the
  extended shared flag set.
- Set LOCKSHARED in vn_open_cred() for requests that specify O_RDONLY but
  not O_CREAT.
- Use a shared vnode lock around VOP_CLOSE() if the file was opened with
  O_RDONLY and the mountpoint has the extended shared flag set.
- Adjust md(4) to upgrade the vnode lock on the vnode it gets back from
  vn_open() since it now may only have a shared vnode lock.
- Don't enable shared vnode locks on FIFO vnodes in ZFS and UFS since
  FIFO's require exclusive vnode locks for their open() and close()
  routines.  (My recent MPSAFE patches for UDF and cd9660 already included
  this change.)
- Enable extended shared operations on UFS, cd9660, and UDF.

Submitted by:	ups
Reviewed by:	pjd (ZFS bits)
MFC after:	1 month
2009-03-11 14:13:47 +00:00
Pyun YongHyeon
05dc172526 Replace local CRC32 routine with ether_crc32_be(). This should
have happened long time ago. Also simplify Rx filter logic.
2009-03-11 09:57:11 +00:00
Pyun YongHyeon
017bb6e5ee s/u_int8_t/uint8_t/g
s/u_int16_t/uint16_t/g
s/u_int32_t/uint32_t/g
s/u_int64_t/uint64_t/g
2009-03-11 09:06:39 +00:00
Pyun YongHyeon
40b9562f15 style(9) - space after keywords. 2009-03-11 08:49:17 +00:00
Pyun YongHyeon
223de9429e Remove return statement at the end of function that returns void. 2009-03-11 08:41:57 +00:00
Pyun YongHyeon
2c81d278e7 Remove extra tab characters. 2009-03-11 08:28:24 +00:00
Pyun YongHyeon
9475e437a3 K&R -> ANSI C function definitions. 2009-03-11 08:25:18 +00:00
Warner Losh
381bbcb826 Remove old compat method that's no longer needed (and hasn't been
since just before 6.0).
2009-03-11 08:15:17 +00:00
Warner Losh
3ef22bdd2f Allow zero length memroy space descriptor sections. It is apparently
legal in the spec.  Add newline to the verbose messages we print when
debugging when this happens.  The Hitachi HT-4840-11 is the only card
to hit these in years, and it works well enough if we're liberal about
what we accept.
2009-03-11 08:14:44 +00:00
Warner Losh
3ca789f14a Add support for Hitachi HT-4840-11. This card is supposedly just like
the J181, but not quite.  This card's CIS has some quirks that means
we have to ignore CFE's 1-9.
2009-03-11 08:12:28 +00:00
Warner Losh
ccd1b0f54d Add entry for Hitachi HT-4840-11, which is a fe-based card. 2009-03-11 08:11:11 +00:00
Warner Losh
edee63f77b Add 3 new cards that I found today in akihabara...
Toshiba LANCT00A
TDK LAK-CD011
TJ PTJ-LAN/T PC-NIC ENCC 990010759-001A
2009-03-11 07:22:11 +00:00
Andrew Thompson
d59dbd0a3d MFp4 //depot/projects/usb 158981,159016,159024
Sync support for ATMEGA DCI parts.

Submitted by:	Hans Petter Selasky
2009-03-11 04:58:21 +00:00
Andrew Thompson
1be5bf51d3 Fix a possible NULL pointer access at controller attach.
Submitted by:	Hans Petter Selasky
2009-03-11 04:56:30 +00:00
Robert Watson
a6c19108c5 Prefer ENETDOWN to ENXIO when returning queuing errors due to a link
down, interface down, etc, with if_cxgb's if_transmit routine.

MFC after:	3 days
Reviewed by:	kmacy
2009-03-10 22:35:45 +00:00