freebsd-dev/sys/dev
Pyun YongHyeon f2ff94851b Overhaul sf(4) to make it run on all architectures and implement
checksum offoload by downloading AIC-6915 firmware. Changes are
 o Header file cleanup.
 o Simplified probe logic.
 o s/u_int{8,16,32}_t/uint{8,16,32}_t/g
 o K&R -> ANSI C.
 o In register access function, added support both memory mapped and
   IO space register acccess. The function will dynamically detect
   which method would be choosed.
 o sf_setperf() was modified to support strict-alignment
   architectures.
 o Use SF_MII_DATAPORT instead of hardcoded value 0xffff.
 o Added link state/speed, duplex changes handling task q. The task q
   is also responsible for flow control settings.
 o Always hornor link up/down state reported by mii layers. The link
   state information is used in sf_start() to determine whether we
   got a valid link.
 o Added experimental flow-control setup. It was commented out but
   will be activated once we have flow-cotrol infrastructure in mii
   layer.
 o Simplify IFF_UP/IFCAP_POLLING and IFF_PROMISC handling logic. Rx
   filter always honors promiscuous mode.
 o Implemented suspend/resume methods.
 o Reorganized Rx filter routine so promiscuous mode changes doesn't
   require interface re-initialization.
 o Reimplemnted driver probe routine such that it looks for matching
   device from supported hardware list table. This change will help to
   add newer hardware revision to the driver.
 o Use ETHER_ADDR_LEN instead of hardcoded value.
 o Prefer memory space register mapping over I/O space as the hardware
   requires lots of register access to get various consumer/producer
   index. Failing to get memory space mapping, sf(4) falls back to I/O
   space mapping. Use of memory space register mapping requires
   somewhat large memory space(512K), though.
 o Switch to simpler bus_{read,write}_{1,2,4}.
 o Use PCIR_BAR macro to get BARs.
 o Program PCI cache line size if the cache line size was set to 0
   and enable PCI MWI.
 o Add a new sysctl node 'dev.sf.N.stats' that shows various MAC
   counters for Rx/Tx statistics.
 o Add a sysctl node to configure interrupt moderation timer. The
   timer defers interrupts generation until time specified in timer
   control register is expired. The value in the timer register is in
   units of 102.4us. The allowable range for the timer is 0 - 31
   (0 ~ 3.276ms).
   The default value is 1(102.4us). Users can change the timer value
   with dev.sf.N.int_mod sysctl(8) variable/loader(8) tunable.
 o bus_dma(9) conversion
    - Enable 64bit DMA addressing.
    - Enable 64bit descriptor format support.
    - Apply descriptor ring alignment requirements(256 bytes alignment).
    - Apply Rx buffer address alignment requirements(4 bytes alignment).
    - Apply 4GB boundary restrictions(Tx/Rx ring and its completion ring
      should live in the same 4GB address space.)
    - Set number of allowable number of DMA segments to 16. In fact,
      AIC-6915 doesn't have a limit for number of DMA segments but it
      would be waste of Tx descriptor resource if we allow more than 16.
    - Rx/Tx side bus_dmamap_load_mbuf_sg(9) support.
    - Added alignment fixup code for strict-alignment architectures.
    - Added endianness support code in Tx/Rx descriptor access.
    With these changes sf(4) should work on all platforms.
 o Don't set if_mtu in device attach, it's handled in ether_ifattach.
 o Use our own callout to drive watchdog timer.
 o Enable VLAN oversized frames and announce sf(4)'s VLAN capability
   to upper layer.
 o In sf_detach(), remove mtx_initialized KASSERT as it's not possible
   to get there without initialzing the mutex. Also mark that we're
   about to detaching so active bpf listeners do not panic the system.
 o To reduce PCI register access cycles, Rx completion ring is
   directly scanned instead of reading consumer/producer index
   registers. In theory, Tx completion ring also can be directly
   scanned. However the completion ring is composed of two types
   completion(1 for Tx done and 1 and DMA done). So reading producer
   index via register access would be more safer way to detect the
   ring wrap-around.
 o In sf_rxeof(), don't use m_devget(9) to align recevied frames. The
   alignment is required only for strict-alignment architectures and
   now the alignment is handled by sf_fixup_rx() if required. The
   removal of the copy operation in fast path should increase Rx
   performance a lot on non-strict-alignemnt architectures such as
   i386 and amd64.
 o In sf_newbuf(), don't set descriptor valid bit as sf(4) is
   programmed to run with normal mode. In normal mode, the valid bit
   have no meaning. The valid bit should be used only when the
   hardware uses polling(prefetch) mode. The end of descriptor queue
   bit could be used if needed, but sf(4) relys on auto-wrapping of
   hardware on 256 descriptor queue entries so both valid and
   descriptor end bit are not used anymore.
 o Don't disable generation of Tx DMA completion as said in datasheet
   and use the Tx DMA completion entry instead of relying on Tx done
   completion entry. Also added additional Tx completion entry type
   check in Tx completion handler.
 o Don't blindly reset watchdog timer in sf_txeof(). sf(4) now unarm
   the the watchdog only if there are no active Tx descriptors in Tx
   queue.
 o Don't manually update various counters in driver, instead, use
   built-in MAC statistic registers to update them. The statistic
   registers are updated in every second.
 o Modified Tx underrun handlers to increase the threshold value
   in units of 256 bytes. Previously it used to increase 16 bytes
   at a time which seems to take too long to stabalize whenever Tx
   underrun occurrs.
 o In interrupt handler, additional check for the interrupt is
   performed such that interrupts only for this device is allowed to
   process descriptor rings. Because reading SF_ISR register clears
   all interrtups, nuke writing to a SF_ISR register.
 o Tx underrun is abonormal condition and SF_ISR_ABNORMALINTR includes
   the interrupt. So there is no need to inspect the Tx underrun again
   in main interrupt loop.
 o Don't blindly reinitialize hardware for abnormal interrupt
   condition. sf(4) reintializes the hardware only when it encounters
   DMA error which requires an explicit hardware reinitialization.
 o Fix a long standing bug that incorrectly clears MAC statistic
   registers in sf_init_locked.
 o Added strict-alignment safe way of ethernet address reprogramming
   as IF_LLADDR may return unaligned address.
 o Move sf_reset() to sf_init_locked in order to always reset the
   hardware to a known state prior to configuring hardware.
 o Set default Rx DMA, Tx DMA paramters as shown in datasheet.
 o Enable PCI busmaster logic and autopadding for VLAN frames.
 o Rework sf_encap.
     - Previously sf(4) used to type 0 of Tx descriptor with padding
       enabled to store driver private data. Emebedding private data
       structures into descriptors is bad idea as the structure size
       would be different between 64bit and 32bit architectures. The
       type 0 descriptor allows fixed number of DMA segments in
       a descriptor format and provides relatively simple interface to
       manage multi-fragmented frames.
       However, it wastes lots of Tx descriptors as not all frames are
       fragmented as the number of allowable segments in a descriptor.
     - To overcome the limitation of type 0 descriptor, switch to type
       2 descriptor which allows 64bit DMA addressing and can handle
       unliumited number of fragmented DMA segments. The drawback of
       type 2 descriptor is in its complexity in managing descriptors
       as driver should handle the end of Tx ring manually.
    -  Manually set Tx desciptor queue end mark and record number of
       used descriptors to reclaim used descriptors in sf_txeof().
 o Rework sf_start.
     - Honor link up/down state before attempting transmission.
     - Because sf(4) uses only one of two Tx queues, use low priority
       queue instead of high one. This will remove one shift operation
       in each Tx kick command.
     - Cache last produder index into softc such that subsequenet Tx
       operation doesn't need to access producer index register.
 o Rewrote sf_stats_update to include all available MAC statistic
   counters.
 o Employ AIC-6915 firmware from Adaptec and implement firmware
   download routine and TCP/UDP checksum offload.
   Partial checksum offload support was commented out due to the
   possibility of firmware bug in RxGFP.
   The firmware can strip VLAN tag in Rx path but the lack of firmware
   assistance of VLAN tag insertion in transmit side made it useless
   on FreeBSD. Unlike checksum offload, FreeBSD requires both Tx/Rx
   hardware VLAN assistance capability. The firmware may also detect
   wakeup frame and can wake system up from states other than D0.
   However, the lack of wakeup support form D3cold state keep me from
   adding WOL capability. Also detecting WOL frame requires firmware
   support but it's not yet known to me whether the firmware can
   process the WOL frame.
 o Changed *_ADDR_HIADDR to *_ADDR_HI to match other definitions of
   registers.
 o Added definitioan to interrupt moderation related constants.
 o Redefined SF_INTRS to include Tx DMA done and DMA errors. Removed
   Tx done as it's not needed anymore.
 o Added definition for Rx/Tx DMA high priority threshold.
 o Nuked unused marco SF_IDX_LO, SF_IDX_HI.
 o Added complete MAC statistic register definition.
 o Modified sf_stats structure to hold all MAC statistic regiters.
 o Nuke various driver private padding data in Tx/Rx descriptor
   definition. sf(4) no longer requires private padding. Also remove
   unused padding related definitions. This greatly simplifies
   descriptor manipulation on 64bit architectures.
 o Becase we no longer pad driver private data into descriptor,
   remove deprecated/not-applicable comments for padding.
 o Redefine Rx/Tx desciptor status. sf(4) doesn't use bit fileds
   anymore to support endianness.

Tested by:	bruffer (initial version)
2008-01-21 06:38:23 +00:00
..
aac Avoid holding the aac_io_lock over copyout. 2007-12-20 21:13:58 +00:00
acpi_support Don't attach to the "IBM0057" ID. This ID is used by IBM machines for 2007-10-25 17:30:18 +00:00
acpica Add a header containing constants for the various HPET registers and their 2008-01-16 18:47:07 +00:00
adlink Set D_NEEDGIANT. 2007-08-04 17:43:11 +00:00
advansys Prepare for future integration between CAM and newbus. xpt_bus_register 2007-06-17 05:55:54 +00:00
agp Add the 845M GMCH controller. 2007-11-26 18:17:07 +00:00
aha Prepare for future integration between CAM and newbus. xpt_bus_register 2007-06-17 05:55:54 +00:00
ahb Fix a compile error from the last change. 2007-06-17 15:21:09 +00:00
aic Prepare for future integration between CAM and newbus. xpt_bus_register 2007-06-17 05:55:54 +00:00
aic7xxx fix up some code for older systems changed by accident in the last commit 2007-10-21 04:11:13 +00:00
amd Prepare for future integration between CAM and newbus. xpt_bus_register 2007-06-17 05:55:54 +00:00
amr Rewrite the DMA code paths from being an impenitrable maze of special cases 2007-12-12 05:55:03 +00:00
an Style changes from avatar. 2008-01-18 16:34:18 +00:00
ar
arcmsr Fix an incorrect FreeBSD version test. 2007-12-09 19:24:27 +00:00
arl
asmc Move ASMC_FAN_FUNCS in the Macmini structure declaration one line up 2007-11-22 23:38:24 +00:00
asr Prepare for future integration between CAM and newbus. xpt_bus_register 2007-06-17 05:55:54 +00:00
ata If the disk reports that it support the Compact Flash Association command 2008-01-02 20:33:54 +00:00
ath promote ath_defrag to m_collapse (and retire private+unused 2008-01-17 21:25:09 +00:00
atkbdc Remove explicit calls to keyboard methods with their respective variants 2007-12-29 21:55:25 +00:00
auxio
awi o add 802.11 state machine states for DFS and client-side power save 2007-09-05 21:31:32 +00:00
bce Fix function prototype for device_shutdown method. 2007-11-22 02:45:00 +00:00
bfe Fix function prototype for device_shutdown method. 2007-11-22 02:45:00 +00:00
bge Add a flag for Ethernet@WireSpeed capability and correct chip revisions. 2008-01-18 22:09:50 +00:00
bktr Rename the kthread_xxx (e.g. kthread_create()) calls 2007-10-20 23:23:23 +00:00
buslogic Prepare for future integration between CAM and newbus. xpt_bus_register 2007-06-17 05:55:54 +00:00
cardbus Make the PCI code aware of PCI domains (aka PCI segments) so we can 2007-09-30 11:05:18 +00:00
ce First in a series of changes to remove the now-unused Giant compatibility 2007-07-27 11:59:57 +00:00
ciss Fix NOP message sending in ciss_periodic() which causes panic with 2007-11-05 13:54:23 +00:00
cm Spelling fix for interupt -> interrupt 2007-10-12 06:03:46 +00:00
cnw
coretemp Disable the check for errata AE18. On MacBooks (1,1 version) there's 2008-01-10 16:09:22 +00:00
cp First in a series of changes to remove the now-unused Giant compatibility 2007-07-27 11:59:57 +00:00
cpufreq
cs
ct
ctau Spelling fix for interupt -> interrupt 2007-10-12 06:03:46 +00:00
cx Spelling fix for interupt -> interrupt 2007-10-12 06:03:46 +00:00
cxgb Re-enable pcpu caching by default make sysctl R/W 2008-01-19 22:47:43 +00:00
cy
dc Fix function prototype for device_shutdown method. 2007-11-22 02:45:00 +00:00
dcons Add a new 'why' argument to kdb_enter(), and a set of constants to use 2007-12-25 17:52:02 +00:00
de The maxsegsz of a dma tag created in de(4) is TULIP_DATA_PER_DESC bytes. 2007-06-07 00:28:47 +00:00
digi
dpt Prepare for future integration between CAM and newbus. xpt_bus_register 2007-06-17 05:55:54 +00:00
drm Dont accidentally remove a filesocket which is still in use. This gives 2008-01-16 13:54:40 +00:00
ed Add Winbond W89C940F to the list. Also, stub in some entries for two 2007-12-31 03:29:02 +00:00
eisa
em Add COHERENT to descriptor mem allocation for the 2007-11-28 23:04:11 +00:00
en
ep
esp The ESP driver isn't really MPSAFE, so don't mark it that it is. 2007-11-11 14:45:35 +00:00
ex
exca
fatm
fb Replace explicit calls to video methods with their respective variants 2007-12-29 23:26:59 +00:00
fdc The wakeup() line from the rev. 1.319 is wrong and reintroduces 2008-01-11 16:50:52 +00:00
fe
firewire Rename the kthread_xxx (e.g. kthread_create()) calls 2007-10-20 23:23:23 +00:00
flash Rename the kthread_xxx (e.g. kthread_create()) calls 2007-10-20 23:23:23 +00:00
fxp
gem - Retire npe_defrag(), gem_defrag(), msk_defrag(), nfe_defrag(), and 2008-01-17 23:37:47 +00:00
harp
hatm Remove the __inline qualifier from a function which is in fact not an 2007-06-08 01:37:47 +00:00
hfa
hifn
hme
hptiop Prepare for future integration between CAM and newbus. xpt_bus_register 2007-06-17 05:55:54 +00:00
hptmv Rename the kthread_xxx (e.g. kthread_create()) calls 2007-10-20 23:23:23 +00:00
hptrr Hide common prints under bootverbose. 2008-01-15 19:21:08 +00:00
hwpmc VOP_LOCK1() (and so VOP_LOCK()) and VOP_UNLOCK() are only used in 2008-01-13 14:44:15 +00:00
ic
ichsmb Add the Intel 82801FB (ICH6) SMBus controller and the 2007-11-26 19:54:54 +00:00
ichwd Add support for ICH8M. 2008-01-07 09:46:39 +00:00
ida
idt Spelling fix for interupt -> interrupt 2007-10-12 06:03:46 +00:00
ie
ieee488
if_ndis Use pause(9) instead of a tsleep() on a stack variable. 2008-01-17 20:11:58 +00:00
iicbus
iir Fix a buffer overflow in the processing of various SCSI commands. This likely 2008-01-09 20:02:56 +00:00
io
ipmi Rename the kthread_xxx (e.g. kthread_create()) calls 2007-10-20 23:23:23 +00:00
ips
ipw Plug two potential (root-only, local) information leaks. buf is not 2007-12-05 19:32:07 +00:00
iscsi/initiator Rename the kthread_xxx (e.g. kthread_create()) calls 2007-10-20 23:23:23 +00:00
isp Add missing locking for SBus controllers. 2007-11-05 11:22:18 +00:00
ispfw
iwi Plug two potential (root-only, local) information leaks. buf is not 2007-12-05 19:32:07 +00:00
ixgb
ixgbe This is an update to the new Intel 10G 82598 driver. 2007-09-04 02:31:35 +00:00
joy
kbd Remove explicit calls to keyboard methods with their respective variants 2007-12-29 21:55:25 +00:00
kbdmux Remove explicit calls to keyboard methods with their respective variants 2007-12-29 21:55:25 +00:00
le Correct the comments in am7990_intr() and am79900_intr(); it's not 2007-12-30 00:23:38 +00:00
led
lge Fix function prototype for device_shutdown method. 2007-11-22 02:45:00 +00:00
lmc
mc146818 Export mc146818_def_{read,write}() so the front-end can make use 2007-06-16 23:10:00 +00:00
mca
mcd
md VOP_LOCK1() (and so VOP_LOCK()) and VOP_UNLOCK() are only used in 2008-01-13 14:44:15 +00:00
mem
mfi Add Dell's sub-vendor id to identify PERC6 RAID controller which has LSI 2007-12-19 17:23:47 +00:00
mii Add a flag for Ethernet@WireSpeed capability and correct chip revisions. 2008-01-18 22:09:50 +00:00
mk48txx
mlx
mly Prepare for future integration between CAM and newbus. xpt_bus_register 2007-06-17 05:55:54 +00:00
mmc Rename the kthread_xxx (e.g. kthread_create()) calls 2007-10-20 23:23:23 +00:00
mpt Ever since the module registration system was introduced to this driver, 2007-11-03 17:33:41 +00:00
mse
msk - Retire npe_defrag(), gem_defrag(), msk_defrag(), nfe_defrag(), and 2008-01-17 23:37:47 +00:00
mxge Add optional support to mxge for MSI-X interrupts and multiple receive 2008-01-15 20:34:49 +00:00
my Spelling fix for interupt -> interrupt 2007-10-12 06:03:46 +00:00
ncv
nfe - Retire npe_defrag(), gem_defrag(), msk_defrag(), nfe_defrag(), and 2008-01-17 23:37:47 +00:00
nge Fix function prototype for device_shutdown method. 2007-11-22 02:45:00 +00:00
nmdm Call ttyld_close() in nmdmclose() to ensure that nmdm(4) 2007-08-01 21:38:11 +00:00
nsp
null
nve Fix function prototype for device_shutdown method. 2007-11-22 02:45:00 +00:00
nvram Split /dev/nvram driver out of isa/clock.c for i386 and amd64. I have not 2007-10-26 03:23:54 +00:00
nxge Merge Neterion if_nxge driver version 2.0.9.11230 with the following 2007-10-29 14:19:32 +00:00
ofw Add a new 'why' argument to kdb_enter(), and a set of constants to use 2007-12-25 17:52:02 +00:00
patm
pbio
pccard Bring in some new Sierra Wireless drivers running under pccard. 2007-10-12 08:26:15 +00:00
pccbb Rename the kthread_xxx (e.g. kthread_create()) calls 2007-10-20 23:23:23 +00:00
pcf
pci Don't cache the new-bus name of a PCI device in the PCI conf structure, 2008-01-15 21:40:46 +00:00
pdq Fix preprocessor code to check for a symbol being defined prior to checking 2007-06-08 01:49:04 +00:00
powermac_nvram Redefine bus_space_tag_t on PowerPC from a 32-bit integral to 2007-12-19 18:00:50 +00:00
ppbus Work around problems with the ppbus(4)'s interesting way of managing 2008-01-10 23:43:47 +00:00
ppc
pst
puc o Add Moxa Technologies CP-104EL PCI Express 4 port Serial card. 2008-01-12 19:14:29 +00:00
ral Check wep flag in *_tx_mgt since we need to encrypt some management frame 2007-11-06 07:30:12 +00:00
random Correct a random value disclosure in random(4). 2007-11-29 16:06:12 +00:00
ray add defs just removed from ieee80211.h 2007-09-05 21:25:58 +00:00
rc
re - Retire npe_defrag(), gem_defrag(), msk_defrag(), nfe_defrag(), and 2008-01-17 23:37:47 +00:00
rndtest
rp Initialize DWBuf[3]. 2007-07-05 06:51:49 +00:00
rr232x Prepare for future integration between CAM and newbus. xpt_bus_register 2007-06-17 05:55:54 +00:00
safe bandaid crash as I have no time to research the issue and the driver 2007-11-03 19:10:14 +00:00
sbni Quiet framelen uninitialized warning. I think it was a false alarm. 2007-07-05 07:46:33 +00:00
sbsh Propagae volatile qualifier. 2007-06-08 01:54:22 +00:00
scc
scd
sf Overhaul sf(4) to make it run on all architectures and implement 2008-01-21 06:38:23 +00:00
si Based in info gleaned from the web and other drivers (including the Linux 2007-12-01 20:39:47 +00:00
sio Add a new 'why' argument to kdb_enter(), and a set of constants to use 2007-12-25 17:52:02 +00:00
sk Fix function prototype for device_shutdown method. 2007-11-22 02:45:00 +00:00
smbus
sn
snc
snp Move the check for the snp device being already attached after the 2007-12-24 13:47:16 +00:00
sound Limit total hardware playback channels to just 1. The reliability of 2007-12-14 02:16:26 +00:00
speaker
spibus
sr
stg
stge Use m_collapse(9) to collapse mbuf chains instead of relying on 2008-01-18 08:32:08 +00:00
streams Make ftruncate a 'struct file' operation rather than a vnode operation. 2008-01-07 20:05:19 +00:00
sym Fix Symbios driver on amd64: Since amd64 has 64 bit pointers but the same 2007-07-20 23:02:01 +00:00
syscons Replace explicit calls to video methods with their respective variants 2007-12-29 23:26:59 +00:00
tdfx
ti Fix function prototype for device_shutdown method. 2007-11-22 02:45:00 +00:00
trm Prepare for future integration between CAM and newbus. xpt_bus_register 2007-06-17 05:55:54 +00:00
twa Deferred interrupts don't work yet, disable them. 2007-10-12 16:51:22 +00:00
twe
tx
txp Read MII_ANAR register and get common denominator ability. 2007-11-16 10:32:10 +00:00
uart Add a new 'why' argument to kdb_enter(), and a set of constants to use 2007-12-25 17:52:02 +00:00
ubsec
usb Remove explicit calling of lockmgr() with the NULL argument. 2008-01-08 23:48:31 +00:00
utopia Fix a use-after-free. 2007-12-05 19:32:59 +00:00
vge Fix function prototype for device_shutdown method. 2007-11-22 02:45:00 +00:00
vkbd Remove explicit calls to keyboard methods with their respective variants 2007-12-29 21:55:25 +00:00
vr Fix function prototype for device_shutdown method. 2007-11-22 02:45:00 +00:00
vx Fix function prototype for device_shutdown method. 2007-11-22 02:45:00 +00:00
watchdog
wds Prepare for future integration between CAM and newbus. xpt_bus_register 2007-06-17 05:55:54 +00:00
wi Make wi_set_channel() actually change the channel in hardware so that hostap 2007-09-16 20:02:29 +00:00
wl
wpi - Retire npe_defrag(), gem_defrag(), msk_defrag(), nfe_defrag(), and 2008-01-17 23:37:47 +00:00
xe