Merge git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging-2.6
authorLinus Torvalds <torvalds@linux-foundation.org>
Sun, 5 Apr 2009 18:06:45 +0000 (11:06 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sun, 5 Apr 2009 18:06:45 +0000 (11:06 -0700)
* git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging-2.6: (714 commits)
  Staging: sxg: slicoss: Specify the license for Sahara SXG and Slicoss drivers
  Staging: serqt_usb: fix build due to proc tty changes
  Staging: serqt_usb: fix checkpatch errors
  Staging: serqt_usb: add TODO file
  Staging: serqt_usb: Lindent the code
  Staging: add USB serial Quatech driver
  staging: document that the wifi staging drivers a bit better
  Staging: echo cleanup
  Staging: BUG to BUG_ON changes
  Staging: remove some pointless conditionals before kfree_skb()
  Staging: line6: fix build error, select SND_RAWMIDI
  Staging: line6: fix checkpatch errors in variax.c
  Staging: line6: fix checkpatch errors in toneport.c
  Staging: line6: fix checkpatch errors in pcm.c
  Staging: line6: fix checkpatch errors in midibuf.c
  Staging: line6: fix checkpatch errors in midi.c
  Staging: line6: fix checkpatch errors in dumprequest.c
  Staging: line6: fix checkpatch errors in driver.c
  Staging: line6: fix checkpatch errors in audio.c
  Staging: line6: fix checkpatch errors in pod.c
  ...

713 files changed:
Documentation/filesystems/pohmelfs/design_notes.txt [new file with mode: 0644]
Documentation/filesystems/pohmelfs/info.txt [new file with mode: 0644]
Documentation/filesystems/pohmelfs/network_protocol.txt [new file with mode: 0644]
drivers/staging/Kconfig
drivers/staging/Makefile
drivers/staging/agnx/agnx.h
drivers/staging/agnx/debug.h
drivers/staging/agnx/pci.c
drivers/staging/agnx/phy.c
drivers/staging/agnx/rf.c
drivers/staging/agnx/sta.c
drivers/staging/agnx/sta.h
drivers/staging/agnx/table.c
drivers/staging/agnx/xmit.c
drivers/staging/altpciechdma/altpciechdma.c
drivers/staging/android/binder.c
drivers/staging/android/ram_console.c
drivers/staging/asus_oled/asus_oled.c
drivers/staging/at76_usb/TODO
drivers/staging/at76_usb/at76_usb.c
drivers/staging/at76_usb/at76_usb.h
drivers/staging/b3dfg/Kconfig [new file with mode: 0644]
drivers/staging/b3dfg/Makefile [new file with mode: 0644]
drivers/staging/b3dfg/TODO [new file with mode: 0644]
drivers/staging/b3dfg/b3dfg.c [new file with mode: 0644]
drivers/staging/comedi/Kconfig
drivers/staging/comedi/comedi.h
drivers/staging/comedi/comedi_compat32.c
drivers/staging/comedi/comedi_fops.c
drivers/staging/comedi/comedi_fops.h
drivers/staging/comedi/comedi_ksyms.c
drivers/staging/comedi/comedi_rt.h
drivers/staging/comedi/comedidev.h
drivers/staging/comedi/comedilib.h
drivers/staging/comedi/drivers.c
drivers/staging/comedi/drivers/8253.h [new file with mode: 0644]
drivers/staging/comedi/drivers/8255.c [new file with mode: 0644]
drivers/staging/comedi/drivers/8255.h [new file with mode: 0644]
drivers/staging/comedi/drivers/Makefile
drivers/staging/comedi/drivers/acl7225b.c [new file with mode: 0644]
drivers/staging/comedi/drivers/addi-data/APCI1710_82x54.c [new file with mode: 0644]
drivers/staging/comedi/drivers/addi-data/APCI1710_82x54.h [new file with mode: 0644]
drivers/staging/comedi/drivers/addi-data/APCI1710_Chrono.c [new file with mode: 0644]
drivers/staging/comedi/drivers/addi-data/APCI1710_Chrono.h [new file with mode: 0644]
drivers/staging/comedi/drivers/addi-data/APCI1710_Dig_io.c [new file with mode: 0644]
drivers/staging/comedi/drivers/addi-data/APCI1710_Dig_io.h [new file with mode: 0644]
drivers/staging/comedi/drivers/addi-data/APCI1710_INCCPT.c [new file with mode: 0644]
drivers/staging/comedi/drivers/addi-data/APCI1710_INCCPT.h [new file with mode: 0644]
drivers/staging/comedi/drivers/addi-data/APCI1710_Inp_cpt.c [new file with mode: 0644]
drivers/staging/comedi/drivers/addi-data/APCI1710_Inp_cpt.h [new file with mode: 0644]
drivers/staging/comedi/drivers/addi-data/APCI1710_Pwm.c [new file with mode: 0644]
drivers/staging/comedi/drivers/addi-data/APCI1710_Pwm.h [new file with mode: 0644]
drivers/staging/comedi/drivers/addi-data/APCI1710_Ssi.c [new file with mode: 0644]
drivers/staging/comedi/drivers/addi-data/APCI1710_Ssi.h [new file with mode: 0644]
drivers/staging/comedi/drivers/addi-data/APCI1710_Tor.c [new file with mode: 0644]
drivers/staging/comedi/drivers/addi-data/APCI1710_Tor.h [new file with mode: 0644]
drivers/staging/comedi/drivers/addi-data/APCI1710_Ttl.c [new file with mode: 0644]
drivers/staging/comedi/drivers/addi-data/APCI1710_Ttl.h [new file with mode: 0644]
drivers/staging/comedi/drivers/addi-data/addi_amcc_S5920.c [new file with mode: 0644]
drivers/staging/comedi/drivers/addi-data/addi_amcc_S5920.h [new file with mode: 0644]
drivers/staging/comedi/drivers/addi-data/addi_amcc_s5933.h [new file with mode: 0644]
drivers/staging/comedi/drivers/addi-data/addi_common.c [new file with mode: 0644]
drivers/staging/comedi/drivers/addi-data/addi_common.h [new file with mode: 0644]
drivers/staging/comedi/drivers/addi-data/addi_eeprom.c [new file with mode: 0644]
drivers/staging/comedi/drivers/addi-data/amcc_s5933_58.h [new file with mode: 0644]
drivers/staging/comedi/drivers/addi-data/hwdrv_APCI1710.c [new file with mode: 0644]
drivers/staging/comedi/drivers/addi-data/hwdrv_APCI1710.h [new file with mode: 0644]
drivers/staging/comedi/drivers/addi-data/hwdrv_apci035.c [new file with mode: 0644]
drivers/staging/comedi/drivers/addi-data/hwdrv_apci035.h [new file with mode: 0644]
drivers/staging/comedi/drivers/addi-data/hwdrv_apci1032.c [new file with mode: 0644]
drivers/staging/comedi/drivers/addi-data/hwdrv_apci1032.h [new file with mode: 0644]
drivers/staging/comedi/drivers/addi-data/hwdrv_apci1500.c [new file with mode: 0644]
drivers/staging/comedi/drivers/addi-data/hwdrv_apci1500.h [new file with mode: 0644]
drivers/staging/comedi/drivers/addi-data/hwdrv_apci1516.c [new file with mode: 0644]
drivers/staging/comedi/drivers/addi-data/hwdrv_apci1516.h [new file with mode: 0644]
drivers/staging/comedi/drivers/addi-data/hwdrv_apci1564.c [new file with mode: 0644]
drivers/staging/comedi/drivers/addi-data/hwdrv_apci1564.h [new file with mode: 0644]
drivers/staging/comedi/drivers/addi-data/hwdrv_apci16xx.c [new file with mode: 0644]
drivers/staging/comedi/drivers/addi-data/hwdrv_apci16xx.h [new file with mode: 0644]
drivers/staging/comedi/drivers/addi-data/hwdrv_apci2016.c [new file with mode: 0644]
drivers/staging/comedi/drivers/addi-data/hwdrv_apci2016.h [new file with mode: 0644]
drivers/staging/comedi/drivers/addi-data/hwdrv_apci2032.c [new file with mode: 0644]
drivers/staging/comedi/drivers/addi-data/hwdrv_apci2032.h [new file with mode: 0644]
drivers/staging/comedi/drivers/addi-data/hwdrv_apci2200.c [new file with mode: 0644]
drivers/staging/comedi/drivers/addi-data/hwdrv_apci2200.h [new file with mode: 0644]
drivers/staging/comedi/drivers/addi-data/hwdrv_apci3120.c [new file with mode: 0644]
drivers/staging/comedi/drivers/addi-data/hwdrv_apci3120.h [new file with mode: 0644]
drivers/staging/comedi/drivers/addi-data/hwdrv_apci3200.c [new file with mode: 0644]
drivers/staging/comedi/drivers/addi-data/hwdrv_apci3200.h [new file with mode: 0644]
drivers/staging/comedi/drivers/addi-data/hwdrv_apci3501.c [new file with mode: 0644]
drivers/staging/comedi/drivers/addi-data/hwdrv_apci3501.h [new file with mode: 0644]
drivers/staging/comedi/drivers/addi-data/hwdrv_apci3xxx.c [new file with mode: 0644]
drivers/staging/comedi/drivers/addi-data/hwdrv_apci3xxx.h [new file with mode: 0644]
drivers/staging/comedi/drivers/addi_apci_035.c [new file with mode: 0644]
drivers/staging/comedi/drivers/addi_apci_1032.c [new file with mode: 0644]
drivers/staging/comedi/drivers/addi_apci_1500.c [new file with mode: 0644]
drivers/staging/comedi/drivers/addi_apci_1516.c [new file with mode: 0644]
drivers/staging/comedi/drivers/addi_apci_1564.c [new file with mode: 0644]
drivers/staging/comedi/drivers/addi_apci_16xx.c [new file with mode: 0644]
drivers/staging/comedi/drivers/addi_apci_1710.c [new file with mode: 0644]
drivers/staging/comedi/drivers/addi_apci_2016.c [new file with mode: 0644]
drivers/staging/comedi/drivers/addi_apci_2032.c [new file with mode: 0644]
drivers/staging/comedi/drivers/addi_apci_2200.c [new file with mode: 0644]
drivers/staging/comedi/drivers/addi_apci_3001.c [new file with mode: 0644]
drivers/staging/comedi/drivers/addi_apci_3120.c [new file with mode: 0644]
drivers/staging/comedi/drivers/addi_apci_3200.c [new file with mode: 0644]
drivers/staging/comedi/drivers/addi_apci_3300.c [new file with mode: 0644]
drivers/staging/comedi/drivers/addi_apci_3501.c [new file with mode: 0644]
drivers/staging/comedi/drivers/addi_apci_3xxx.c [new file with mode: 0644]
drivers/staging/comedi/drivers/addi_apci_all.c [new file with mode: 0644]
drivers/staging/comedi/drivers/adl_pci6208.c [new file with mode: 0644]
drivers/staging/comedi/drivers/adl_pci7296.c [new file with mode: 0644]
drivers/staging/comedi/drivers/adl_pci7432.c [new file with mode: 0644]
drivers/staging/comedi/drivers/adl_pci8164.c [new file with mode: 0644]
drivers/staging/comedi/drivers/adl_pci9111.c [new file with mode: 0644]
drivers/staging/comedi/drivers/adl_pci9118.c [new file with mode: 0644]
drivers/staging/comedi/drivers/adq12b.c [new file with mode: 0644]
drivers/staging/comedi/drivers/adv_pci1710.c [new file with mode: 0644]
drivers/staging/comedi/drivers/adv_pci1723.c [new file with mode: 0644]
drivers/staging/comedi/drivers/adv_pci_dio.c [new file with mode: 0644]
drivers/staging/comedi/drivers/aio_aio12_8.c [new file with mode: 0644]
drivers/staging/comedi/drivers/aio_iiro_16.c [new file with mode: 0644]
drivers/staging/comedi/drivers/am9513.h [new file with mode: 0644]
drivers/staging/comedi/drivers/amcc_s5933.h [new file with mode: 0644]
drivers/staging/comedi/drivers/amplc_dio200.c [new file with mode: 0644]
drivers/staging/comedi/drivers/amplc_pc236.c [new file with mode: 0644]
drivers/staging/comedi/drivers/amplc_pc263.c [new file with mode: 0644]
drivers/staging/comedi/drivers/amplc_pci224.c [new file with mode: 0644]
drivers/staging/comedi/drivers/amplc_pci230.c [new file with mode: 0644]
drivers/staging/comedi/drivers/c6xdigio.c [new file with mode: 0644]
drivers/staging/comedi/drivers/cb_das16_cs.c [new file with mode: 0644]
drivers/staging/comedi/drivers/cb_pcidas.c [new file with mode: 0644]
drivers/staging/comedi/drivers/cb_pcidas64.c [new file with mode: 0644]
drivers/staging/comedi/drivers/cb_pcidda.c [new file with mode: 0644]
drivers/staging/comedi/drivers/cb_pcidio.c [new file with mode: 0644]
drivers/staging/comedi/drivers/cb_pcimdas.c [new file with mode: 0644]
drivers/staging/comedi/drivers/cb_pcimdda.c [new file with mode: 0644]
drivers/staging/comedi/drivers/comedi_bond.c
drivers/staging/comedi/drivers/comedi_fc.c
drivers/staging/comedi/drivers/comedi_fc.h
drivers/staging/comedi/drivers/comedi_parport.c
drivers/staging/comedi/drivers/comedi_rt_timer.c [new file with mode: 0644]
drivers/staging/comedi/drivers/comedi_test.c
drivers/staging/comedi/drivers/contec_pci_dio.c [new file with mode: 0644]
drivers/staging/comedi/drivers/daqboard2000.c [new file with mode: 0644]
drivers/staging/comedi/drivers/das08.c [new file with mode: 0644]
drivers/staging/comedi/drivers/das08.h [new file with mode: 0644]
drivers/staging/comedi/drivers/das08_cs.c [new file with mode: 0644]
drivers/staging/comedi/drivers/das16.c [new file with mode: 0644]
drivers/staging/comedi/drivers/das16m1.c [new file with mode: 0644]
drivers/staging/comedi/drivers/das1800.c [new file with mode: 0644]
drivers/staging/comedi/drivers/das6402.c [new file with mode: 0644]
drivers/staging/comedi/drivers/das800.c [new file with mode: 0644]
drivers/staging/comedi/drivers/dmm32at.c [new file with mode: 0644]
drivers/staging/comedi/drivers/dt2801.c [new file with mode: 0644]
drivers/staging/comedi/drivers/dt2811.c [new file with mode: 0644]
drivers/staging/comedi/drivers/dt2814.c [new file with mode: 0644]
drivers/staging/comedi/drivers/dt2815.c [new file with mode: 0644]
drivers/staging/comedi/drivers/dt2817.c [new file with mode: 0644]
drivers/staging/comedi/drivers/dt282x.c [new file with mode: 0644]
drivers/staging/comedi/drivers/dt3000.c [new file with mode: 0644]
drivers/staging/comedi/drivers/dt9812.c
drivers/staging/comedi/drivers/fl512.c [new file with mode: 0644]
drivers/staging/comedi/drivers/gsc_hpdi.c [new file with mode: 0644]
drivers/staging/comedi/drivers/icp_multi.c
drivers/staging/comedi/drivers/icp_multi.h
drivers/staging/comedi/drivers/ii_pci20kc.c [new file with mode: 0644]
drivers/staging/comedi/drivers/jr3_pci.c [new file with mode: 0644]
drivers/staging/comedi/drivers/jr3_pci.h [new file with mode: 0644]
drivers/staging/comedi/drivers/ke_counter.c [new file with mode: 0644]
drivers/staging/comedi/drivers/me4000.c
drivers/staging/comedi/drivers/me4000.h
drivers/staging/comedi/drivers/me_daq.c
drivers/staging/comedi/drivers/mite.c
drivers/staging/comedi/drivers/mite.h
drivers/staging/comedi/drivers/mpc624.c [new file with mode: 0644]
drivers/staging/comedi/drivers/mpc8260cpm.c [new file with mode: 0644]
drivers/staging/comedi/drivers/multiq3.c [new file with mode: 0644]
drivers/staging/comedi/drivers/ni_6527.c [new file with mode: 0644]
drivers/staging/comedi/drivers/ni_65xx.c [new file with mode: 0644]
drivers/staging/comedi/drivers/ni_660x.c [new file with mode: 0644]
drivers/staging/comedi/drivers/ni_670x.c [new file with mode: 0644]
drivers/staging/comedi/drivers/ni_at_a2150.c [new file with mode: 0644]
drivers/staging/comedi/drivers/ni_at_ao.c [new file with mode: 0644]
drivers/staging/comedi/drivers/ni_atmio.c [new file with mode: 0644]
drivers/staging/comedi/drivers/ni_atmio16d.c [new file with mode: 0644]
drivers/staging/comedi/drivers/ni_daq_700.c [new file with mode: 0644]
drivers/staging/comedi/drivers/ni_daq_dio24.c [new file with mode: 0644]
drivers/staging/comedi/drivers/ni_labpc.c [new file with mode: 0644]
drivers/staging/comedi/drivers/ni_labpc.h [new file with mode: 0644]
drivers/staging/comedi/drivers/ni_labpc_cs.c [new file with mode: 0644]
drivers/staging/comedi/drivers/ni_mio_common.c [new file with mode: 0644]
drivers/staging/comedi/drivers/ni_mio_cs.c [new file with mode: 0644]
drivers/staging/comedi/drivers/ni_pcidio.c [new file with mode: 0644]
drivers/staging/comedi/drivers/ni_pcimio.c [new file with mode: 0644]
drivers/staging/comedi/drivers/ni_stc.h [new file with mode: 0644]
drivers/staging/comedi/drivers/ni_tio.c [new file with mode: 0644]
drivers/staging/comedi/drivers/ni_tio.h [new file with mode: 0644]
drivers/staging/comedi/drivers/ni_tio_internal.h [new file with mode: 0644]
drivers/staging/comedi/drivers/ni_tiocmd.c [new file with mode: 0644]
drivers/staging/comedi/drivers/pcl711.c [new file with mode: 0644]
drivers/staging/comedi/drivers/pcl724.c [new file with mode: 0644]
drivers/staging/comedi/drivers/pcl725.c [new file with mode: 0644]
drivers/staging/comedi/drivers/pcl726.c [new file with mode: 0644]
drivers/staging/comedi/drivers/pcl730.c [new file with mode: 0644]
drivers/staging/comedi/drivers/pcl812.c [new file with mode: 0644]
drivers/staging/comedi/drivers/pcl816.c [new file with mode: 0644]
drivers/staging/comedi/drivers/pcl818.c [new file with mode: 0644]
drivers/staging/comedi/drivers/pcm3724.c [new file with mode: 0644]
drivers/staging/comedi/drivers/pcm3730.c [new file with mode: 0644]
drivers/staging/comedi/drivers/pcmad.c [new file with mode: 0644]
drivers/staging/comedi/drivers/pcmda12.c [new file with mode: 0644]
drivers/staging/comedi/drivers/pcmmio.c [new file with mode: 0644]
drivers/staging/comedi/drivers/pcmuio.c [new file with mode: 0644]
drivers/staging/comedi/drivers/plx9052.h [new file with mode: 0644]
drivers/staging/comedi/drivers/plx9080.h
drivers/staging/comedi/drivers/poc.c [new file with mode: 0644]
drivers/staging/comedi/drivers/quatech_daqp_cs.c [new file with mode: 0644]
drivers/staging/comedi/drivers/rtd520.c
drivers/staging/comedi/drivers/rtd520.h
drivers/staging/comedi/drivers/rti800.c [new file with mode: 0644]
drivers/staging/comedi/drivers/rti802.c [new file with mode: 0644]
drivers/staging/comedi/drivers/s526.c [new file with mode: 0644]
drivers/staging/comedi/drivers/s626.c
drivers/staging/comedi/drivers/s626.h
drivers/staging/comedi/drivers/serial2002.c [new file with mode: 0644]
drivers/staging/comedi/drivers/skel.c [new file with mode: 0644]
drivers/staging/comedi/drivers/ssv_dnp.c [new file with mode: 0644]
drivers/staging/comedi/drivers/unioxx5.c [new file with mode: 0644]
drivers/staging/comedi/drivers/usbdux.c
drivers/staging/comedi/drivers/usbduxfast.c
drivers/staging/comedi/interrupt.h
drivers/staging/comedi/kcomedilib/data.c
drivers/staging/comedi/kcomedilib/dio.c
drivers/staging/comedi/kcomedilib/get.c
drivers/staging/comedi/kcomedilib/kcomedilib_main.c
drivers/staging/comedi/kcomedilib/ksyms.c
drivers/staging/comedi/pci_ids.h
drivers/staging/comedi/proc.c
drivers/staging/comedi/range.c
drivers/staging/comedi/rt.c
drivers/staging/comedi/rt_pend_tq.c
drivers/staging/dst/Kconfig [new file with mode: 0644]
drivers/staging/dst/Makefile [new file with mode: 0644]
drivers/staging/dst/crypto.c [new file with mode: 0644]
drivers/staging/dst/dcore.c [new file with mode: 0644]
drivers/staging/dst/export.c [new file with mode: 0644]
drivers/staging/dst/state.c [new file with mode: 0644]
drivers/staging/dst/thread_pool.c [new file with mode: 0644]
drivers/staging/dst/trans.c [new file with mode: 0644]
drivers/staging/echo/bit_operations.h
drivers/staging/echo/echo.c
drivers/staging/echo/echo.h
drivers/staging/echo/fir.h
drivers/staging/echo/mmx.h
drivers/staging/epl/Benchmark.h
drivers/staging/epl/Debug.h
drivers/staging/epl/Edrv8139.c
drivers/staging/epl/EdrvFec.h
drivers/staging/epl/EdrvFec5282.h [deleted file]
drivers/staging/epl/EdrvSim.h
drivers/staging/epl/Epl.h
drivers/staging/epl/EplAmi.h
drivers/staging/epl/EplApiGeneric.c
drivers/staging/epl/EplApiLinuxKernel.c
drivers/staging/epl/EplApiProcessImage.c
drivers/staging/epl/EplDll.h
drivers/staging/epl/EplDllCal.h
drivers/staging/epl/EplDllk.c
drivers/staging/epl/EplDllkCal.c
drivers/staging/epl/EplDlluCal.c
drivers/staging/epl/EplErrorHandlerk.c
drivers/staging/epl/EplEvent.h
drivers/staging/epl/EplEventk.c
drivers/staging/epl/EplEventu.c
drivers/staging/epl/EplFrame.h
drivers/staging/epl/EplIdentu.c
drivers/staging/epl/EplInc.h
drivers/staging/epl/EplInstDef.h
drivers/staging/epl/EplNmt.h
drivers/staging/epl/EplNmtCnu.c
drivers/staging/epl/EplNmtMnu.c
drivers/staging/epl/EplNmtk.c
drivers/staging/epl/EplNmtkCal.c
drivers/staging/epl/EplNmtu.c
drivers/staging/epl/EplNmtuCal.c
drivers/staging/epl/EplObd.c
drivers/staging/epl/EplObd.h
drivers/staging/epl/EplObdMacro.h
drivers/staging/epl/EplObdkCal.c
drivers/staging/epl/EplObdu.c
drivers/staging/epl/EplObduCal.c
drivers/staging/epl/EplObjDef.h [deleted file]
drivers/staging/epl/EplPdo.h
drivers/staging/epl/EplPdok.c
drivers/staging/epl/EplPdou.c
drivers/staging/epl/EplSdo.h
drivers/staging/epl/EplSdoAsndu.c
drivers/staging/epl/EplSdoAsySequ.c
drivers/staging/epl/EplSdoComu.c
drivers/staging/epl/EplSdoUdpu.c
drivers/staging/epl/EplStatusu.c
drivers/staging/epl/EplTarget.h
drivers/staging/epl/EplTimer.h
drivers/staging/epl/EplTimeruLinuxKernel.c
drivers/staging/epl/EplTimeruNull.c [deleted file]
drivers/staging/epl/EplTimeruWin32.c [deleted file]
drivers/staging/epl/SharedBuff.c
drivers/staging/epl/SharedBuff.h
drivers/staging/epl/ShbIpc-LinuxKernel.c
drivers/staging/epl/ShbIpc-Win32.c [deleted file]
drivers/staging/epl/ShbIpc.h
drivers/staging/epl/TimerHighReskX86.c
drivers/staging/epl/VirtualEthernetLinux.c
drivers/staging/epl/amix86.c
drivers/staging/epl/demo_main.c
drivers/staging/epl/edrv.h
drivers/staging/epl/global.h
drivers/staging/epl/kernel/EplDllk.h
drivers/staging/epl/kernel/EplDllkCal.h
drivers/staging/epl/kernel/EplErrorHandlerk.h
drivers/staging/epl/kernel/EplEventk.h
drivers/staging/epl/kernel/EplNmtk.h
drivers/staging/epl/kernel/EplNmtkCal.h [deleted file]
drivers/staging/epl/kernel/EplObdk.h
drivers/staging/epl/kernel/EplObdkCal.h [deleted file]
drivers/staging/epl/kernel/EplPdok.h
drivers/staging/epl/kernel/EplPdokCal.h
drivers/staging/epl/kernel/EplTimerHighResk.h
drivers/staging/epl/kernel/EplTimerk.h
drivers/staging/epl/kernel/VirtualEthernet.h
drivers/staging/epl/proc_fs.c
drivers/staging/epl/user/EplCfgMau.h
drivers/staging/epl/user/EplDllu.h
drivers/staging/epl/user/EplDlluCal.h
drivers/staging/epl/user/EplEventu.h
drivers/staging/epl/user/EplIdentu.h
drivers/staging/epl/user/EplLedu.h
drivers/staging/epl/user/EplNmtCnu.h
drivers/staging/epl/user/EplNmtMnu.h
drivers/staging/epl/user/EplNmtu.h
drivers/staging/epl/user/EplNmtuCal.h
drivers/staging/epl/user/EplObdu.h
drivers/staging/epl/user/EplObduCal.h
drivers/staging/epl/user/EplPdou.h
drivers/staging/epl/user/EplSdoAsndu.h
drivers/staging/epl/user/EplSdoAsySequ.h
drivers/staging/epl/user/EplSdoComu.h
drivers/staging/epl/user/EplSdoUdpu.h
drivers/staging/epl/user/EplStatusu.h
drivers/staging/epl/user/EplTimeru.h
drivers/staging/et131x/et1310_rx.c
drivers/staging/frontier/README
drivers/staging/frontier/alphatrack.c
drivers/staging/frontier/alphatrack.h
drivers/staging/frontier/frontier_compat.h [deleted file]
drivers/staging/frontier/surface_sysfs.h [deleted file]
drivers/staging/frontier/tranzport.c
drivers/staging/go7007/go7007-v4l2.c
drivers/staging/go7007/s2250-board.c
drivers/staging/heci/Kconfig [new file with mode: 0644]
drivers/staging/heci/Makefile [new file with mode: 0644]
drivers/staging/heci/TODO [new file with mode: 0644]
drivers/staging/heci/heci.h [new file with mode: 0644]
drivers/staging/heci/heci_data_structures.h [new file with mode: 0644]
drivers/staging/heci/heci_init.c [new file with mode: 0644]
drivers/staging/heci/heci_interface.c [new file with mode: 0644]
drivers/staging/heci/heci_interface.h [new file with mode: 0644]
drivers/staging/heci/heci_main.c [new file with mode: 0644]
drivers/staging/heci/heci_version.h [new file with mode: 0644]
drivers/staging/heci/interrupt.c [new file with mode: 0644]
drivers/staging/heci/io_heci.c [new file with mode: 0644]
drivers/staging/line6/Kconfig [new file with mode: 0644]
drivers/staging/line6/Makefile [new file with mode: 0644]
drivers/staging/line6/audio.c [new file with mode: 0644]
drivers/staging/line6/audio.h [new file with mode: 0644]
drivers/staging/line6/capture.c [new file with mode: 0644]
drivers/staging/line6/capture.h [new file with mode: 0644]
drivers/staging/line6/config.h [new file with mode: 0644]
drivers/staging/line6/control.c [new file with mode: 0644]
drivers/staging/line6/control.h [new file with mode: 0644]
drivers/staging/line6/driver.c [new file with mode: 0644]
drivers/staging/line6/driver.h [new file with mode: 0644]
drivers/staging/line6/dumprequest.c [new file with mode: 0644]
drivers/staging/line6/dumprequest.h [new file with mode: 0644]
drivers/staging/line6/midi.c [new file with mode: 0644]
drivers/staging/line6/midi.h [new file with mode: 0644]
drivers/staging/line6/midibuf.c [new file with mode: 0644]
drivers/staging/line6/midibuf.h [new file with mode: 0644]
drivers/staging/line6/pcm.c [new file with mode: 0644]
drivers/staging/line6/pcm.h [new file with mode: 0644]
drivers/staging/line6/playback.c [new file with mode: 0644]
drivers/staging/line6/playback.h [new file with mode: 0644]
drivers/staging/line6/pod.c [new file with mode: 0644]
drivers/staging/line6/pod.h [new file with mode: 0644]
drivers/staging/line6/revision.h [new file with mode: 0644]
drivers/staging/line6/toneport.c [new file with mode: 0644]
drivers/staging/line6/toneport.h [new file with mode: 0644]
drivers/staging/line6/usbdefs.h [new file with mode: 0644]
drivers/staging/line6/variax.c [new file with mode: 0644]
drivers/staging/line6/variax.h [new file with mode: 0644]
drivers/staging/me4000/me4000.c
drivers/staging/meilhaus/me0600_device.c
drivers/staging/meilhaus/me0600_dio.c
drivers/staging/meilhaus/me0600_ext_irq.c
drivers/staging/meilhaus/me0600_optoi.c
drivers/staging/meilhaus/me0600_relay.c
drivers/staging/meilhaus/me0600_ttli.c
drivers/staging/meilhaus/me0900_device.c
drivers/staging/meilhaus/me0900_di.c
drivers/staging/meilhaus/me0900_do.c
drivers/staging/meilhaus/me1000_device.c
drivers/staging/meilhaus/me1000_dio.c
drivers/staging/meilhaus/me1400_device.c
drivers/staging/meilhaus/me1400_ext_irq.c
drivers/staging/meilhaus/me1600_ao.c
drivers/staging/meilhaus/me1600_ao.h
drivers/staging/meilhaus/me1600_device.c
drivers/staging/meilhaus/me4600_ai.c
drivers/staging/meilhaus/me4600_ai.h
drivers/staging/meilhaus/me4600_ao.c
drivers/staging/meilhaus/me4600_ao.h
drivers/staging/meilhaus/me4600_device.c
drivers/staging/meilhaus/me4600_di.c
drivers/staging/meilhaus/me4600_dio.c
drivers/staging/meilhaus/me4600_do.c
drivers/staging/meilhaus/me4600_ext_irq.c
drivers/staging/meilhaus/me6000_ao.c
drivers/staging/meilhaus/me6000_ao.h
drivers/staging/meilhaus/me6000_device.c
drivers/staging/meilhaus/me6000_dio.c
drivers/staging/meilhaus/me8100_device.c
drivers/staging/meilhaus/me8100_di.c
drivers/staging/meilhaus/me8100_do.c
drivers/staging/meilhaus/me8200_device.c
drivers/staging/meilhaus/me8200_di.c
drivers/staging/meilhaus/me8200_dio.c
drivers/staging/meilhaus/me8200_do.c
drivers/staging/meilhaus/me8254.c
drivers/staging/meilhaus/me8255.c
drivers/staging/meilhaus/mecirc_buf.h
drivers/staging/meilhaus/medevice.c
drivers/staging/meilhaus/medlist.c
drivers/staging/meilhaus/medlock.c
drivers/staging/meilhaus/medummy.c
drivers/staging/meilhaus/memain.c
drivers/staging/meilhaus/meslist.c
drivers/staging/meilhaus/meslock.c
drivers/staging/meilhaus/mesubdevice.c
drivers/staging/meilhaus/metempl_device.c
drivers/staging/meilhaus/metempl_sub.c
drivers/staging/mimio/Kconfig
drivers/staging/otus/80211core/amsdu.c
drivers/staging/otus/80211core/cmmsta.c
drivers/staging/otus/80211core/coid.c
drivers/staging/otus/80211core/cwm.c
drivers/staging/otus/TODO
drivers/staging/otus/hal/hpani.c
drivers/staging/otus/hal/hpmain.c
drivers/staging/otus/hal/hpreg.c
drivers/staging/otus/hal/hprw.c
drivers/staging/otus/hal/hpusb.c
drivers/staging/otus/ioctl.c
drivers/staging/otus/usbdrv.c
drivers/staging/otus/wwrap.c
drivers/staging/otus/zdcompat.h
drivers/staging/p9auth/Kconfig [new file with mode: 0644]
drivers/staging/p9auth/Makefile [new file with mode: 0644]
drivers/staging/p9auth/p9auth.c [new file with mode: 0644]
drivers/staging/phison/Kconfig [new file with mode: 0644]
drivers/staging/phison/Makefile [new file with mode: 0644]
drivers/staging/phison/phison.c [new file with mode: 0644]
drivers/staging/pohmelfs/Kconfig [new file with mode: 0644]
drivers/staging/pohmelfs/Makefile [new file with mode: 0644]
drivers/staging/pohmelfs/config.c [new file with mode: 0644]
drivers/staging/pohmelfs/crypto.c [new file with mode: 0644]
drivers/staging/pohmelfs/dir.c [new file with mode: 0644]
drivers/staging/pohmelfs/inode.c [new file with mode: 0644]
drivers/staging/pohmelfs/lock.c [new file with mode: 0644]
drivers/staging/pohmelfs/mcache.c [new file with mode: 0644]
drivers/staging/pohmelfs/net.c [new file with mode: 0644]
drivers/staging/pohmelfs/netfs.h [new file with mode: 0644]
drivers/staging/pohmelfs/path_entry.c [new file with mode: 0644]
drivers/staging/pohmelfs/trans.c [new file with mode: 0644]
drivers/staging/rspiusb/rspiusb.c
drivers/staging/rt2860/2860_main_dev.c
drivers/staging/rt2860/Makefile
drivers/staging/rt2860/TODO
drivers/staging/rt2860/common/cmm_data.c
drivers/staging/rt2860/common/cmm_data_2860.c
drivers/staging/rt2860/common/cmm_info.c
drivers/staging/rt2860/common/cmm_sync.c
drivers/staging/rt2860/common/cmm_wpa.c
drivers/staging/rt2860/common/mlme.c
drivers/staging/rt2860/common/rtmp_init.c
drivers/staging/rt2860/common/spectrum.c
drivers/staging/rt2860/config.mk
drivers/staging/rt2860/oid.h
drivers/staging/rt2860/rt2860.h
drivers/staging/rt2860/rt28xx.h
drivers/staging/rt2860/rt_ate.c
drivers/staging/rt2860/rt_ate.h
drivers/staging/rt2860/rt_config.h
drivers/staging/rt2860/rt_linux.c
drivers/staging/rt2860/rt_linux.h
drivers/staging/rt2860/rt_main_dev.c
drivers/staging/rt2860/rt_profile.c
drivers/staging/rt2860/rtmp.h
drivers/staging/rt2860/rtmp_def.h
drivers/staging/rt2860/sta/assoc.c
drivers/staging/rt2860/sta/connect.c
drivers/staging/rt2860/sta/dls.c
drivers/staging/rt2860/sta/rtmp_data.c
drivers/staging/rt2860/sta/sync.c
drivers/staging/rt2860/sta/wpa.c
drivers/staging/rt2860/sta_ioctl.c
drivers/staging/rt2860/wpa.h
drivers/staging/rt2870/2870_main_dev.c
drivers/staging/rt2870/TODO
drivers/staging/rt2870/common/2870_rtmp_init.c
drivers/staging/rt2870/common/cmm_data.c
drivers/staging/rt2870/common/rtmp_init.c
drivers/staging/rt2870/common/rtusb_io.c
drivers/staging/rt2870/common/spectrum.c
drivers/staging/rt2870/rt2870.h
drivers/staging/rt2870/rt_linux.c
drivers/staging/rt2870/rt_linux.h
drivers/staging/rt2870/sta_ioctl.c
drivers/staging/rt3070/2870_main_dev.c [new file with mode: 0644]
drivers/staging/rt3070/Kconfig [new file with mode: 0644]
drivers/staging/rt3070/Makefile [new file with mode: 0644]
drivers/staging/rt3070/action.h [new file with mode: 0644]
drivers/staging/rt3070/aironet.h [new file with mode: 0644]
drivers/staging/rt3070/ap.h [new file with mode: 0644]
drivers/staging/rt3070/chlist.h [new file with mode: 0644]
drivers/staging/rt3070/common/2870_rtmp_init.c [new file with mode: 0644]
drivers/staging/rt3070/common/action.c [new file with mode: 0644]
drivers/staging/rt3070/common/ba_action.c [new file with mode: 0644]
drivers/staging/rt3070/common/cmm_data.c [new file with mode: 0644]
drivers/staging/rt3070/common/cmm_data_2870.c [new file with mode: 0644]
drivers/staging/rt3070/common/cmm_info.c [new file with mode: 0644]
drivers/staging/rt3070/common/cmm_sanity.c [new file with mode: 0644]
drivers/staging/rt3070/common/cmm_sync.c [new file with mode: 0644]
drivers/staging/rt3070/common/cmm_wpa.c [new file with mode: 0644]
drivers/staging/rt3070/common/dfs.c [new file with mode: 0644]
drivers/staging/rt3070/common/eeprom.c [new file with mode: 0644]
drivers/staging/rt3070/common/md5.c [new file with mode: 0644]
drivers/staging/rt3070/common/mlme.c [new file with mode: 0644]
drivers/staging/rt3070/common/netif_block.c [new file with mode: 0644]
drivers/staging/rt3070/common/rtmp_init.c [new file with mode: 0644]
drivers/staging/rt3070/common/rtmp_tkip.c [new file with mode: 0644]
drivers/staging/rt3070/common/rtmp_wep.c [new file with mode: 0644]
drivers/staging/rt3070/common/rtusb_bulk.c [new file with mode: 0644]
drivers/staging/rt3070/common/rtusb_data.c [new file with mode: 0644]
drivers/staging/rt3070/common/rtusb_io.c [new file with mode: 0644]
drivers/staging/rt3070/common/spectrum.c [new file with mode: 0644]
drivers/staging/rt3070/dfs.h [new file with mode: 0644]
drivers/staging/rt3070/firmware.h [new file with mode: 0644]
drivers/staging/rt3070/leap.h [new file with mode: 0644]
drivers/staging/rt3070/link_list.h [new file with mode: 0644]
drivers/staging/rt3070/md4.h [new file with mode: 0644]
drivers/staging/rt3070/md5.h [new file with mode: 0644]
drivers/staging/rt3070/mlme.h [new file with mode: 0644]
drivers/staging/rt3070/netif_block.h [new file with mode: 0644]
drivers/staging/rt3070/oid.h [new file with mode: 0644]
drivers/staging/rt3070/rt2870.h [new file with mode: 0644]
drivers/staging/rt3070/rt28xx.h [new file with mode: 0644]
drivers/staging/rt3070/rt_ate.c [new file with mode: 0644]
drivers/staging/rt3070/rt_ate.h [new file with mode: 0644]
drivers/staging/rt3070/rt_config.h [new file with mode: 0644]
drivers/staging/rt3070/rt_linux.c [new file with mode: 0644]
drivers/staging/rt3070/rt_linux.h [new file with mode: 0644]
drivers/staging/rt3070/rt_main_dev.c [new file with mode: 0644]
drivers/staging/rt3070/rt_profile.c [new file with mode: 0644]
drivers/staging/rt3070/rtmp.h [new file with mode: 0644]
drivers/staging/rt3070/rtmp_ckipmic.h [new file with mode: 0644]
drivers/staging/rt3070/rtmp_def.h [new file with mode: 0644]
drivers/staging/rt3070/rtmp_type.h [new file with mode: 0644]
drivers/staging/rt3070/spectrum.h [new file with mode: 0644]
drivers/staging/rt3070/spectrum_def.h [new file with mode: 0644]
drivers/staging/rt3070/sta/aironet.c [new file with mode: 0644]
drivers/staging/rt3070/sta/assoc.c [new file with mode: 0644]
drivers/staging/rt3070/sta/auth.c [new file with mode: 0644]
drivers/staging/rt3070/sta/auth_rsp.c [new file with mode: 0644]
drivers/staging/rt3070/sta/connect.c [new file with mode: 0644]
drivers/staging/rt3070/sta/dls.c [new file with mode: 0644]
drivers/staging/rt3070/sta/rtmp_data.c [new file with mode: 0644]
drivers/staging/rt3070/sta/sanity.c [new file with mode: 0644]
drivers/staging/rt3070/sta/sync.c [new file with mode: 0644]
drivers/staging/rt3070/sta/wpa.c [new file with mode: 0644]
drivers/staging/rt3070/sta_ioctl.c [new file with mode: 0644]
drivers/staging/rt3070/wpa.h [new file with mode: 0644]
drivers/staging/rtl8187se/dot11d.h
drivers/staging/rtl8187se/ieee80211/dot11d.c
drivers/staging/rtl8187se/ieee80211/dot11d.h
drivers/staging/rtl8187se/ieee80211/ieee80211_wx.c
drivers/staging/rtl8187se/r8180_core.c
drivers/staging/rtl8187se/r8180_dm.c
drivers/staging/rtl8187se/r8180_dm.h
drivers/staging/rtl8187se/r8180_wx.c
drivers/staging/serqt_usb/Kconfig [new file with mode: 0644]
drivers/staging/serqt_usb/Makefile [new file with mode: 0644]
drivers/staging/serqt_usb/TODO [new file with mode: 0644]
drivers/staging/serqt_usb/serqt_usb.c [new file with mode: 0644]
drivers/staging/slicoss/gbdownload.h [deleted file]
drivers/staging/slicoss/gbrcvucode.h [deleted file]
drivers/staging/slicoss/oasisdbgdownload.h [deleted file]
drivers/staging/slicoss/oasisdownload.h [deleted file]
drivers/staging/slicoss/oasisrcvucode.h [deleted file]
drivers/staging/slicoss/slic.h
drivers/staging/slicoss/slic_os.h [deleted file]
drivers/staging/slicoss/slicbuild.h [deleted file]
drivers/staging/slicoss/slicdbg.h [deleted file]
drivers/staging/slicoss/slicdump.h [deleted file]
drivers/staging/slicoss/slichw.h
drivers/staging/slicoss/slicinc.h [deleted file]
drivers/staging/slicoss/slicoss.c
drivers/staging/stlc45xx/Kconfig [new file with mode: 0644]
drivers/staging/stlc45xx/Makefile [new file with mode: 0644]
drivers/staging/stlc45xx/stlc45xx.c [new file with mode: 0644]
drivers/staging/stlc45xx/stlc45xx.h [new file with mode: 0644]
drivers/staging/stlc45xx/stlc45xx_lmac.h [new file with mode: 0644]
drivers/staging/sxg/Kconfig
drivers/staging/sxg/Makefile
drivers/staging/sxg/saharadbgdownload.h [deleted file]
drivers/staging/sxg/sxg.c
drivers/staging/sxg/sxg.h
drivers/staging/sxg/sxg_ethtool.c [new file with mode: 0644]
drivers/staging/sxg/sxg_os.h
drivers/staging/sxg/sxgdbg.h
drivers/staging/sxg/sxghif.h
drivers/staging/sxg/sxghw.h
drivers/staging/sxg/sxgphycode-1.2.h [new file with mode: 0644]
drivers/staging/sxg/sxgphycode.h [deleted file]
drivers/staging/uc2322/Kconfig [new file with mode: 0644]
drivers/staging/uc2322/Makefile [new file with mode: 0644]
drivers/staging/uc2322/TODO [new file with mode: 0644]
drivers/staging/uc2322/aten2011.c [new file with mode: 0644]
drivers/staging/usbip/stub_rx.c
drivers/staging/usbip/vhci_sysfs.c
drivers/staging/winbond/bss_f.h [deleted file]
drivers/staging/winbond/bssdscpt.h [deleted file]
drivers/staging/winbond/common.h [deleted file]
drivers/staging/winbond/core.h
drivers/staging/winbond/ds_tkip.h [deleted file]
drivers/staging/winbond/gl_80211.h [deleted file]
drivers/staging/winbond/ioctls.h [deleted file]
drivers/staging/winbond/mds.c
drivers/staging/winbond/mds_s.h
drivers/staging/winbond/mlme_mib.h [deleted file]
drivers/staging/winbond/mlmetxrx.c
drivers/staging/winbond/mto.c
drivers/staging/winbond/mto.h
drivers/staging/winbond/mto_f.h [deleted file]
drivers/staging/winbond/os_common.h [deleted file]
drivers/staging/winbond/phy_calibration.c
drivers/staging/winbond/phy_calibration.h
drivers/staging/winbond/reg.c
drivers/staging/winbond/sme_api.h
drivers/staging/winbond/sme_s.h [deleted file]
drivers/staging/winbond/wb35_ver.h [deleted file]
drivers/staging/winbond/wb35reg.c
drivers/staging/winbond/wb35reg_f.h
drivers/staging/winbond/wb35rx.c
drivers/staging/winbond/wb35rx_f.h
drivers/staging/winbond/wb35rx_s.h
drivers/staging/winbond/wb35tx.c
drivers/staging/winbond/wb35tx_f.h
drivers/staging/winbond/wb35tx_s.h
drivers/staging/winbond/wbhal.c
drivers/staging/winbond/wbhal_f.h
drivers/staging/winbond/wbhal_s.h
drivers/staging/winbond/wbusb.c
drivers/staging/winbond/wbusb_s.h
drivers/staging/wlan-ng/README
drivers/staging/wlan-ng/hfa384x.h
drivers/staging/wlan-ng/hfa384x_usb.c
drivers/staging/wlan-ng/p80211conv.c
drivers/staging/wlan-ng/p80211conv.h
drivers/staging/wlan-ng/p80211hdr.h
drivers/staging/wlan-ng/p80211ioctl.h
drivers/staging/wlan-ng/p80211meta.h
drivers/staging/wlan-ng/p80211metadef.h
drivers/staging/wlan-ng/p80211metamib.h [deleted file]
drivers/staging/wlan-ng/p80211metamsg.h [deleted file]
drivers/staging/wlan-ng/p80211metastruct.h
drivers/staging/wlan-ng/p80211mgmt.h
drivers/staging/wlan-ng/p80211msg.h
drivers/staging/wlan-ng/p80211netdev.c
drivers/staging/wlan-ng/p80211netdev.h
drivers/staging/wlan-ng/p80211req.c
drivers/staging/wlan-ng/p80211req.h
drivers/staging/wlan-ng/p80211types.h
drivers/staging/wlan-ng/p80211wep.c
drivers/staging/wlan-ng/p80211wext.c
drivers/staging/wlan-ng/prism2mgmt.c
drivers/staging/wlan-ng/prism2mgmt.h
drivers/staging/wlan-ng/prism2mib.c
drivers/staging/wlan-ng/prism2sta.c
drivers/staging/wlan-ng/prism2usb.c
drivers/staging/wlan-ng/wlan_compat.h [deleted file]
firmware/Makefile
firmware/WHENCE
firmware/slicoss/gbdownload.sys.ihex [new file with mode: 0644]
firmware/slicoss/gbrcvucode.sys.ihex [new file with mode: 0644]
firmware/slicoss/oasisdbgdownload.sys.ihex [new file with mode: 0644]
firmware/slicoss/oasisdownload.sys.ihex [new file with mode: 0644]
firmware/slicoss/oasisrcvucode.sys.ihex [new file with mode: 0644]
firmware/sxg/saharadbgdownloadB.sys.ihex [new file with mode: 0644]
firmware/sxg/saharadownloadB.sys.ihex [new file with mode: 0644]
include/linux/connector.h
include/linux/dst.h [new file with mode: 0644]
mm/filemap.c

diff --git a/Documentation/filesystems/pohmelfs/design_notes.txt b/Documentation/filesystems/pohmelfs/design_notes.txt
new file mode 100644 (file)
index 0000000..6d6db60
--- /dev/null
@@ -0,0 +1,70 @@
+POHMELFS: Parallel Optimized Host Message Exchange Layered File System.
+
+               Evgeniy Polyakov <zbr@ioremap.net>
+
+Homepage: http://www.ioremap.net/projects/pohmelfs
+
+POHMELFS first began as a network filesystem with coherent local data and
+metadata caches but is now evolving into a parallel distributed filesystem.
+
+Main features of this FS include:
+ * Locally coherent cache for data and metadata with (potentially) byte-range locks.
+       Since all Linux filesystems lock the whole inode during writing, algorithm
+       is very simple and does not use byte-ranges, although they are sent in
+       locking messages.
+ * Completely async processing of all events except creation of hard and symbolic
+       links, and rename events.
+       Object creation and data reading and writing are processed asynchronously.
+ * Flexible object architecture optimized for network processing.
+       Ability to create long paths to objects and remove arbitrarily huge
+       directories with a single network command.
+       (like removing the whole kernel tree via a single network command).
+ * Very high performance.
+ * Fast and scalable multithreaded userspace server. Being in userspace it works
+       with any underlying filesystem and still is much faster than async in-kernel NFS one.
+ * Client is able to switch between different servers (if one goes down, client
+       automatically reconnects to second and so on).
+ * Transactions support. Full failover for all operations.
+       Resending transactions to different servers on timeout or error.
+ * Read request (data read, directory listing, lookup requests) balancing between multiple servers.
+ * Write requests are replicated to multiple servers and completed only when all of them are acked.
+ * Ability to add and/or remove servers from the working set at run-time.
+ * Strong authentification and possible data encryption in network channel.
+ * Extended attributes support.
+
+POHMELFS is based on transactions, which are potentially long-standing objects that live
+in the client's memory. Each transaction contains all the information needed to process a given
+command (or set of commands, which is frequently used during data writing: single transactions
+can contain creation and data writing commands). Transactions are committed by all the servers
+to which they are sent and, in case of failures, are eventually resent or dropped with an error.
+For example, reading will return an error if no servers are available.
+
+POHMELFS uses a asynchronous approach to data processing. Courtesy of transactions, it is
+possible to detach replies from requests and, if the command requires data to be received, the
+caller sleeps waiting for it. Thus, it is possible to issue multiple read commands to different
+servers and async threads will pick up replies in parallel, find appropriate transactions in the
+system and put the data where it belongs (like the page or inode cache).
+
+The main feature of POHMELFS is writeback data and the metadata cache.
+Only a few non-performance critical operations use the write-through cache and
+are synchronous: hard and symbolic link creation, and object rename. Creation,
+removal of objects and data writing are asynchronous and are sent to
+the server during system writeback. Only one writer at a time is allowed for any
+given inode, which is guarded by an appropriate locking protocol.
+Because of this feature, POHMELFS is extremely fast at metadata intensive
+workloads and can fully utilize the bandwidth to the servers when doing bulk
+data transfers.
+
+POHMELFS clients operate with a working set of servers and are capable of balancing read-only
+operations (like lookups or directory listings) between them.
+Administrators can add or remove servers from the set at run-time via special commands (described
+in Documentation/pohmelfs/info.txt file). Writes are replicated to all servers.
+
+POHMELFS is capable of full data channel encryption and/or strong crypto hashing.
+One can select any kernel supported cipher, encryption mode, hash type and operation mode
+(hmac or digest). It is also possible to use both or neither (default). Crypto configuration
+is checked during mount time and, if the server does not support it, appropriate capabilities
+will be disabled or mount will fail (if 'crypto_fail_unsupported' mount option is specified).
+Crypto performance heavily depends on the number of crypto threads, which asynchronously perform
+crypto operations and send the resulting data to server or submit it up the stack. This number
+can be controlled via a mount option.
diff --git a/Documentation/filesystems/pohmelfs/info.txt b/Documentation/filesystems/pohmelfs/info.txt
new file mode 100644 (file)
index 0000000..4e3d501
--- /dev/null
@@ -0,0 +1,86 @@
+POHMELFS usage information.
+
+Mount options:
+idx=%u
+ Each mountpoint is associated with a special index via this option.
+ Administrator can add or remove servers from the given index, so all mounts,
+ which were attached to it, are updated.
+ Default it is 0.
+
+trans_scan_timeout=%u
+ This timeout, expressed in milliseconds, specifies time to scan transaction
+ trees looking for stale requests, which have to be resent, or if number of
+ retries exceed specified limit, dropped with error.
+ Default is 5 seconds.
+
+drop_scan_timeout=%u
+ Internal timeout, expressed in milliseconds, which specifies how frequently
+ inodes marked to be dropped are freed. It also specifies how frequently
+ the system checks that servers have to be added or removed from current working set.
+ Default is 1 second.
+
+wait_on_page_timeout=%u
+ Number of milliseconds to wait for reply from remote server for data reading command.
+ If this timeout is exceeded, reading returns an error.
+ Default is 5 seconds.
+
+trans_retries=%u
+ This is the number of times that a transaction will be resent to a server that did
+ not answer for the last @trans_scan_timeout milliseconds.
+ When the number of resends exceeds this limit, the transaction is completed with error.
+ Default is 5 resends.
+
+crypto_thread_num=%u
+ Number of crypto processing threads. Threads are used both for RX and TX traffic.
+ Default is 2, or no threads if crypto operations are not supported.
+
+trans_max_pages=%u
+ Maximum number of pages in a single transaction. This parameter also controls
+ the number of pages,  allocated for crypto processing (each crypto thread has
+ pool of pages, the number of which is equal to 'trans_max_pages'.
+ Default is 100 pages.
+
+crypto_fail_unsupported
+ If specified, mount will fail if the server does not support requested crypto operations.
+ By default mount will disable non-matching crypto operations.
+
+mcache_timeout=%u
+ Maximum number of milliseconds to wait for the mcache objects to be processed.
+ Mcache includes locks (given lock should be granted by server), attributes (they should be
+ fully received in the given timeframe).
+ Default is 5 seconds.
+
+Usage examples.
+
+Add (or remove if it already exists) server server1.net:1025 into the working set with index $idx
+with appropriate hash algorithm and key file and cipher algorithm, mode and key file:
+$cfg -a server1.net -p 1025 -i $idx -K $hash_key -k $cipher_key
+
+Mount filesystem with given index $idx to /mnt mountpoint.
+Client will connect to all servers specified in the working set via previous command:
+mount -t pohmel -o idx=$idx q /mnt
+
+One can add or remove servers from working set after mounting too.
+
+
+Server installation.
+
+Creating a server, which listens at port 1025 and 0.0.0.0 address.
+Working root directory (note, that server chroots there, so you have to have appropriate permissions)
+is set to /mnt, server will negotiate hash/cipher with client, in case client requested it, there
+are appropriate key files.
+Number of working threads is set to 10.
+
+# ./fserver -a 0.0.0.0 -p 1025 -r /mnt -w 10 -K hash_key -k cipher_key
+
+ -A 6                   - listen on ipv6 address. Default: Disabled.
+ -r root                 - path to root directory. Default: /tmp.
+ -a addr                 - listen address. Default: 0.0.0.0.
+ -p port                 - listen port. Default: 1025.
+ -w workers              - number of workers per connected client. Default: 1.
+ -K file                - hash key size. Default: none.
+ -k file                - cipher key size. Default: none.
+ -h                      - this help.
+
+Number of worker threads specifies how many workers will be created for each client.
+Bulk single-client transafers usually are better handled with smaller number (like 1-3).
diff --git a/Documentation/filesystems/pohmelfs/network_protocol.txt b/Documentation/filesystems/pohmelfs/network_protocol.txt
new file mode 100644 (file)
index 0000000..40ea6c2
--- /dev/null
@@ -0,0 +1,227 @@
+POHMELFS network protocol.
+
+Basic structure used in network communication is following command:
+
+struct netfs_cmd
+{
+       __u16                   cmd;    /* Command number */
+       __u16                   csize;  /* Attached crypto information size */
+       __u16                   cpad;   /* Attached padding size */
+       __u16                   ext;    /* External flags */
+       __u32                   size;   /* Size of the attached data */
+       __u32                   trans;  /* Transaction id */
+       __u64                   id;     /* Object ID to operate on. Used for feedback.*/
+       __u64                   start;  /* Start of the object. */
+       __u64                   iv;     /* IV sequence */
+       __u8                    data[0];
+};
+
+Commands can be embedded into transaction command (which in turn has own command),
+so one can extend protocol as needed without breaking backward compatibility as long
+as old commands are supported. All string lengths include tail 0 byte.
+
+All commans are transfered over the network in big-endian. CPU endianess is used at the end peers.
+
+@cmd - command number, which specifies command to be processed. Following
+       commands are used currently:
+
+       NETFS_READDIR   = 1,    /* Read directory for given inode number */
+       NETFS_READ_PAGE,        /* Read data page from the server */
+       NETFS_WRITE_PAGE,       /* Write data page to the server */
+       NETFS_CREATE,           /* Create directory entry */
+       NETFS_REMOVE,           /* Remove directory entry */
+       NETFS_LOOKUP,           /* Lookup single object */
+       NETFS_LINK,             /* Create a link */
+       NETFS_TRANS,            /* Transaction */
+       NETFS_OPEN,             /* Open intent */
+       NETFS_INODE_INFO,       /* Metadata cache coherency synchronization message */
+       NETFS_PAGE_CACHE,       /* Page cache invalidation message */
+       NETFS_READ_PAGES,       /* Read multiple contiguous pages in one go */
+       NETFS_RENAME,           /* Rename object */
+       NETFS_CAPABILITIES,     /* Capabilities of the client, for example supported crypto */
+       NETFS_LOCK,             /* Distributed lock message */
+       NETFS_XATTR_SET,        /* Set extended attribute */
+       NETFS_XATTR_GET,        /* Get extended attribute */
+
+@ext - external flags. Used by different commands to specify some extra arguments
+       like partial size of the embedded objects or creation flags.
+
+@size - size of the attached data. For NETFS_READ_PAGE and NETFS_READ_PAGES no data is attached,
+       but size of the requested data is incorporated here. It does not include size of the command
+       header (struct netfs_cmd) itself.
+
+@id - id of the object this command operates on. Each command can use it for own purpose.
+
+@start - start of the object this command operates on. Each command can use it for own purpose.
+
+@csize, @cpad - size and padding size of the (attached if needed) crypto information.
+
+Command specifications.
+
+@NETFS_READDIR
+This command is used to sync content of the remote dir to the client.
+
+@ext - length of the path to object.
+@size - the same.
+@id - local inode number of the directory to read.
+@start - zero.
+
+
+@NETFS_READ_PAGE
+This command is used to read data from remote server.
+Data size does not exceed local page cache size.
+
+@id - inode number.
+@start - first byte offset.
+@size - number of bytes to read plus length of the path to object.
+@ext - object path length.
+
+
+@NETFS_CREATE
+Used to create object.
+It does not require that all directories on top of the object were
+already created, it will create them automatically. Each object has
+associated @netfs_path_entry data structure, which contains creation
+mode (permissions and type) and length of the name as long as name itself.
+
+@start - 0
+@size - size of the all data structures needed to create a path
+@id - local inode number
+@ext - 0
+
+
+@NETFS_REMOVE
+Used to remove object.
+
+@ext - length of the path to object.
+@size - the same.
+@id - local inode number.
+@start - zero.
+
+
+@NETFS_LOOKUP
+Lookup information about object on server.
+
+@ext - length of the path to object.
+@size - the same.
+@id - local inode number of the directory to look object in.
+@start - local inode number of the object to look at.
+
+
+@NETFS_LINK
+Create hard of symlink.
+Command is sent as "object_path|target_path".
+
+@size - size of the above string.
+@id - parent local inode number.
+@start - 1 for symlink, 0 for hardlink.
+@ext - size of the "object_path" above.
+
+
+@NETFS_TRANS
+Transaction header.
+
+@size - incorporates all embedded command sizes including theirs header sizes.
+@start - transaction generation number - unique id used to find transaction.
+@ext - transaction flags. Unused at the moment.
+@id - 0.
+
+
+@NETFS_OPEN
+Open intent for given transaction.
+
+@id - local inode number.
+@start - 0.
+@size - path length to the object.
+@ext - open flags (O_RDWR and so on).
+
+
+@NETFS_INODE_INFO
+Metadata update command.
+It is sent to servers when attributes of the object are changed and received
+when data or metadata were updated. It operates with the following structure:
+
+struct netfs_inode_info
+{
+       unsigned int            mode;
+       unsigned int            nlink;
+       unsigned int            uid;
+       unsigned int            gid;
+       unsigned int            blocksize;
+       unsigned int            padding;
+       __u64                   ino;
+       __u64                   blocks;
+       __u64                   rdev;
+       __u64                   size;
+       __u64                   version;
+};
+
+It effectively mirrors stat(2) returned data.
+
+
+@ext - path length to the object.
+@size - the same plus size of the netfs_inode_info structure.
+@id - local inode number.
+@start - 0.
+
+
+@NETFS_PAGE_CACHE
+Command is only received by clients. It contains information about
+page to be marked as not up-to-date.
+
+@id - client's inode number.
+@start - last byte of the page to be invalidated. If it is not equal to
+       current inode size, it will be vmtruncated().
+@size - 0
+@ext - 0
+
+
+@NETFS_READ_PAGES
+Used to read multiple contiguous pages in one go.
+
+@start - first byte of the contiguous region to read.
+@size - contains of two fields: lower 8 bits are used to represent page cache shift
+       used by client, another 3 bytes are used to get number of pages.
+@id - local inode number.
+@ext - path length to the object.
+
+
+@NETFS_RENAME
+Used to rename object.
+Attached data is formed into following string: "old_path|new_path".
+
+@id - local inode number.
+@start - parent inode number.
+@size - length of the above string.
+@ext - length of the old path part.
+
+
+@NETFS_CAPABILITIES
+Used to exchange crypto capabilities with server.
+If crypto capabilities are not supported by server, then client will disable it
+or fail (if 'crypto_fail_unsupported' mount options was specified).
+
+@id - superblock index. Used to specify crypto information for group of servers.
+@size - size of the attached capabilities structure.
+@start - 0.
+@size - 0.
+@scsize - 0.
+
+@NETFS_LOCK
+Used to send lock request/release messages. Although it sends byte range request
+and is capable of flushing pages based on that, it is not used, since all Linux
+filesystems lock the whole inode.
+
+@id - lock generation number.
+@start - start of the locked range.
+@size - size of the locked range.
+@ext - lock type: read/write. Not used actually. 15'th bit is used to determine,
+       if it is lock request (1) or release (0).
+
+@NETFS_XATTR_SET
+@NETFS_XATTR_GET
+Used to set/get extended attributes for given inode.
+@id - attribute generation number or xattr setting type
+@start - size of the attribute (request or attached)
+@size - name length, path len and data size for given attribute
+@ext - path length for given object
index 92981c2..0dcf9ca 100644 (file)
@@ -73,6 +73,8 @@ source "drivers/staging/rt2860/Kconfig"
 
 source "drivers/staging/rt2870/Kconfig"
 
+source "drivers/staging/rt3070/Kconfig"
+
 source "drivers/staging/comedi/Kconfig"
 
 source "drivers/staging/asus_oled/Kconfig"
@@ -93,5 +95,25 @@ source "drivers/staging/epl/Kconfig"
 
 source "drivers/staging/android/Kconfig"
 
+source "drivers/staging/dst/Kconfig"
+
+source "drivers/staging/pohmelfs/Kconfig"
+
+source "drivers/staging/stlc45xx/Kconfig"
+
+source "drivers/staging/uc2322/Kconfig"
+
+source "drivers/staging/b3dfg/Kconfig"
+
+source "drivers/staging/phison/Kconfig"
+
+source "drivers/staging/p9auth/Kconfig"
+
+source "drivers/staging/heci/Kconfig"
+
+source "drivers/staging/line6/Kconfig"
+
+source "drivers/staging/serqt_usb/Kconfig"
+
 endif # !STAGING_EXCLUDE_BUILD
 endif # STAGING
index 47a56f5..47dfd5b 100644 (file)
@@ -19,6 +19,7 @@ obj-$(CONFIG_AGNX)            += agnx/
 obj-$(CONFIG_OTUS)             += otus/
 obj-$(CONFIG_RT2860)           += rt2860/
 obj-$(CONFIG_RT2870)           += rt2870/
+obj-$(CONFIG_RT3070)           += rt3070/
 obj-$(CONFIG_COMEDI)           += comedi/
 obj-$(CONFIG_ASUS_OLED)                += asus_oled/
 obj-$(CONFIG_PANEL)            += panel/
@@ -29,3 +30,13 @@ obj-$(CONFIG_INPUT_MIMIO)    += mimio/
 obj-$(CONFIG_TRANZPORT)                += frontier/
 obj-$(CONFIG_EPL)              += epl/
 obj-$(CONFIG_ANDROID)          += android/
+obj-$(CONFIG_DST)              += dst/
+obj-$(CONFIG_POHMELFS)         += pohmelfs/
+obj-$(CONFIG_STLC45XX)         += stlc45xx/
+obj-$(CONFIG_USB_SERIAL_ATEN2011)      += uc2322/
+obj-$(CONFIG_B3DFG)            += b3dfg/
+obj-$(CONFIG_IDE_PHISON)       += phison/
+obj-$(CONFIG_PLAN9AUTH)                += p9auth/
+obj-$(CONFIG_HECI)             += heci/
+obj-$(CONFIG_LINE6_USB)                += line6/
+obj-$(CONFIG_USB_SERIAL_QUATECH_ESU100)        += serqt_usb/
index 20f36da..3963d25 100644 (file)
@@ -41,16 +41,16 @@ static const struct ieee80211_rate agnx_rates_80211g[] = {
 /*     { .bitrate = 20, .hw_value = 2, .flags = IEEE80211_RATE_SHORT_PREAMBLE }, */
 /*     { .bitrate = 55, .hw_value = 3, .flags = IEEE80211_RATE_SHORT_PREAMBLE }, */
 /*     { .bitrate = 110, .hw_value = 4, .flags = IEEE80211_RATE_SHORT_PREAMBLE }, */
-       { .bitrate = 10, .hw_value = 1, },
-       { .bitrate = 20, .hw_value = 2, },
-       { .bitrate = 55, .hw_value = 3, },
-       { .bitrate = 110, .hw_value = 4,},
+       { .bitrate = 10, .hw_value = 1, },
+       { .bitrate = 20, .hw_value = 2, },
+       { .bitrate = 55, .hw_value = 3, },
+       { .bitrate = 110, .hw_value = 4,},
 
        { .bitrate = 60, .hw_value = 0xB, },
        { .bitrate = 90, .hw_value = 0xF, },
        { .bitrate = 120, .hw_value = 0xA },
        { .bitrate = 180, .hw_value = 0xE, },
-//     { .bitrate = 240, .hw_value = 0xd, },
+/*     { .bitrate = 240, .hw_value = 0xd, }, */
        { .bitrate = 360, .hw_value = 0xD, },
        { .bitrate = 480, .hw_value = 0x8, },
        { .bitrate = 540, .hw_value = 0xC, },
@@ -110,10 +110,10 @@ struct agnx_priv {
        /* Need volatile? */
        u32 irq_status;
 
-        struct delayed_work periodic_work; /* Periodic tasks like recalibrate*/
+       struct delayed_work periodic_work; /* Periodic tasks like recalibrate */
        struct ieee80211_low_level_stats stats;
 
-//        unsigned int phymode;
+       /* unsigned int phymode; */
        int mode;
        int channel;
        u8 bssid[ETH_ALEN];
index e3e25dd..761d99c 100644 (file)
@@ -23,7 +23,7 @@ static inline void agnx_bug(char *reason)
 
 static inline void agnx_print_desc(struct agnx_desc *desc)
 {
-        u32 reg = be32_to_cpu(desc->frag);
+       u32 reg = be32_to_cpu(desc->frag);
 
        PRINTK_BITS(DESC, PACKET_LEN);
 
@@ -291,7 +291,7 @@ static inline void agnx_print_sta(struct agnx_priv *priv, unsigned int sta_idx)
        PRINTK_LE32(STA, sta->phy_stats_high);
        PRINTK_LE32(STA, sta->phy_stats_low);
 
-//     for (i = 0; i < 8; i++)
+       /* for (i = 0; i < 8; i++) */
        agnx_print_sta_traffic(sta->traffic + 0);
 
        PRINTK_LE16(STA, sta->traffic_class0_frag_success);
@@ -311,10 +311,10 @@ static inline void agnx_print_sta(struct agnx_priv *priv, unsigned int sta_idx)
 static inline void dump_ieee80211_hdr(struct ieee80211_hdr *hdr, char *tag)
 {
        u16 fctl;
-        int hdrlen;
+       int hdrlen;
        DECLARE_MAC_BUF(mac);
 
-        fctl = le16_to_cpu(hdr->frame_control);
+       fctl = le16_to_cpu(hdr->frame_control);
        switch (fctl & IEEE80211_FCTL_FTYPE) {
        case IEEE80211_FTYPE_DATA:
                printk(PFX "%s DATA ", tag);
@@ -324,7 +324,7 @@ static inline void dump_ieee80211_hdr(struct ieee80211_hdr *hdr, char *tag)
                break;
        case IEEE80211_FTYPE_MGMT:
                printk(PFX "%s MGMT ", tag);
-               switch(fctl & IEEE80211_FCTL_STYPE) {
+               switch (fctl & IEEE80211_FCTL_STYPE) {
                case IEEE80211_STYPE_ASSOC_REQ:
                        printk("SubType: ASSOC_REQ ");
                        break;
@@ -369,7 +369,7 @@ static inline void dump_ieee80211_hdr(struct ieee80211_hdr *hdr, char *tag)
                printk(PFX "%s Packet type: Unknow\n", tag);
        }
 
-        hdrlen = ieee80211_hdrlen(fctl);
+       hdrlen = ieee80211_hdrlen(fctl);
 
        if (hdrlen >= 4)
                printk("FC=0x%04x DUR=0x%04x",
@@ -389,29 +389,28 @@ static inline void dump_txm_registers(struct agnx_priv *priv)
 {
        void __iomem *ctl = priv->ctl;
        int i;
-       for (i = 0; i <=0x1e8; i += 4) {
+       for (i = 0; i <= 0x1e8; i += 4)
                printk(KERN_DEBUG PFX "TXM: %x---> 0x%.8x\n", i, ioread32(ctl + i));
-       }
 }
 static inline void dump_rxm_registers(struct agnx_priv *priv)
 {
        void __iomem *ctl = priv->ctl;
        int i;
-       for (i = 0; i <=0x108; i += 4)
+       for (i = 0; i <= 0x108; i += 4)
                printk(KERN_DEBUG PFX "RXM: %x---> 0x%.8x\n", i, ioread32(ctl + 0x2000 + i));
 }
 static inline void dump_bm_registers(struct agnx_priv *priv)
 {
        void __iomem *ctl = priv->ctl;
        int i;
-       for (i = 0; i <=0x90; i += 4)
+       for (i = 0; i <= 0x90; i += 4)
                printk(KERN_DEBUG PFX "BM: %x---> 0x%.8x\n", i, ioread32(ctl + 0x2c00 + i));
 }
 static inline void dump_cir_registers(struct agnx_priv *priv)
 {
        void __iomem *ctl = priv->ctl;
        int i;
-       for (i = 0; i <=0xb8; i += 4)
+       for (i = 0; i <= 0xb8; i += 4)
                printk(KERN_DEBUG PFX "CIR: %x---> 0x%.8x\n", i, ioread32(ctl + 0x3000 + i));
 }
 
index 854630c..4ff4c16 100644 (file)
@@ -39,34 +39,34 @@ static inline void agnx_interrupt_ack(struct agnx_priv *priv, u32 *reason)
        void __iomem *ctl = priv->ctl;
        u32 reg;
 
-       if ( *reason & AGNX_STAT_RX ) {
+       if (*reason & AGNX_STAT_RX) {
                /* Mark complete RX */
                reg = ioread32(ctl + AGNX_CIR_RXCTL);
                reg |= 0x4;
                iowrite32(reg, ctl + AGNX_CIR_RXCTL);
                /* disable Rx interrupt */
        }
-       if ( *reason & AGNX_STAT_TX ) {
+       if (*reason & AGNX_STAT_TX) {
                reg = ioread32(ctl + AGNX_CIR_TXDCTL);
                if (reg & 0x4) {
                        iowrite32(reg, ctl + AGNX_CIR_TXDCTL);
                        *reason |= AGNX_STAT_TXD;
                }
-               reg = ioread32(ctl + AGNX_CIR_TXMCTL);
+               reg = ioread32(ctl + AGNX_CIR_TXMCTL);
                if (reg & 0x4) {
                        iowrite32(reg, ctl + AGNX_CIR_TXMCTL);
                        *reason |= AGNX_STAT_TXM;
                }
        }
-       if ( *reason & AGNX_STAT_X ) {
-/*             reg = ioread32(ctl + AGNX_INT_STAT); */
-/*             iowrite32(reg, ctl + AGNX_INT_STAT); */
-/*             /\* FIXME reinit interrupt mask *\/ */
-/*             reg = 0xc390bf9 & ~IRQ_TX_BEACON; */
-/*             reg &= ~IRQ_TX_DISABLE; */
-/*             iowrite32(reg, ctl + AGNX_INT_MASK); */
-/*             iowrite32(0x800, ctl + AGNX_CIR_BLKCTL); */
-       }
+/*     if (*reason & AGNX_STAT_X) {
+               reg = ioread32(ctl + AGNX_INT_STAT);
+               iowrite32(reg, ctl + AGNX_INT_STAT);
+               /* FIXME reinit interrupt mask *\/
+               reg = 0xc390bf9 & ~IRQ_TX_BEACON;
+               reg &= ~IRQ_TX_DISABLE;
+               iowrite32(reg, ctl + AGNX_INT_MASK);
+               iowrite32(0x800, ctl + AGNX_CIR_BLKCTL);
+       } */
 } /* agnx_interrupt_ack */
 
 static irqreturn_t agnx_interrupt_handler(int irq, void *dev_id)
@@ -79,7 +79,7 @@ static irqreturn_t agnx_interrupt_handler(int irq, void *dev_id)
 
        spin_lock(&priv->lock);
 
-//     printk(KERN_ERR PFX "Get a interrupt %s\n", __func__);
+/*     printk(KERN_ERR PFX "Get a interrupt %s\n", __func__); */
 
        if (priv->init_status != AGNX_START)
                goto out;
@@ -92,7 +92,7 @@ static irqreturn_t agnx_interrupt_handler(int irq, void *dev_id)
        ret = IRQ_HANDLED;
        priv->irq_status = ioread32(ctl + AGNX_INT_STAT);
 
-//     printk(PFX "Interrupt reason is 0x%x\n", irq_reason);
+/*     printk(PFX "Interrupt reason is 0x%x\n", irq_reason); */
        /* Make sure the txm and txd flags don't conflict with other unknown
           interrupt flag, maybe is not necessary */
        irq_reason &= 0xF;
@@ -101,13 +101,13 @@ static irqreturn_t agnx_interrupt_handler(int irq, void *dev_id)
        /* TODO Make sure the card finished initialized */
        agnx_interrupt_ack(priv, &irq_reason);
 
-       if ( irq_reason & AGNX_STAT_RX )
+       if (irq_reason & AGNX_STAT_RX)
                handle_rx_irq(priv);
-       if ( irq_reason & AGNX_STAT_TXD )
+       if (irq_reason & AGNX_STAT_TXD)
                handle_txd_irq(priv);
-       if ( irq_reason & AGNX_STAT_TXM )
+       if (irq_reason & AGNX_STAT_TXM)
                handle_txm_irq(priv);
-       if ( irq_reason & AGNX_STAT_X )
+       if (irq_reason & AGNX_STAT_X)
                handle_other_irq(priv);
 
        enable_rx_interrupt(priv);
@@ -171,7 +171,7 @@ static int agnx_alloc_rings(struct agnx_priv *priv)
 
        len = priv->rx.size + priv->txm.size + priv->txd.size;
 
-//     priv->rx.info = kzalloc(sizeof(struct agnx_info) * len, GFP_KERNEL);
+/*     priv->rx.info = kzalloc(sizeof(struct agnx_info) * len, GFP_KERNEL); */
        priv->rx.info = kzalloc(sizeof(struct agnx_info) * len, GFP_ATOMIC);
        if (!priv->rx.info)
                return -ENOMEM;
@@ -210,28 +210,27 @@ static void rings_free(struct agnx_priv *priv)
 #if 0
 static void agnx_periodic_work_handler(struct work_struct *work)
 {
-       struct agnx_priv *priv = container_of(work, struct agnx_priv,
-                                             periodic_work.work);
-//     unsigned long flags;
+       struct agnx_priv *priv = container_of(work, struct agnx_priv, periodic_work.work);
+/*     unsigned long flags; */
        unsigned long delay;
 
        /* fixme: using mutex?? */
-//     spin_lock_irqsave(&priv->lock, flags);
+/*     spin_lock_irqsave(&priv->lock, flags); */
 
        /* TODO Recalibrate*/
-//     calibrate_oscillator(priv);
-//     antenna_calibrate(priv);
-//     agnx_send_packet(priv, 997);
+/*     calibrate_oscillator(priv); */
+/*     antenna_calibrate(priv); */
+/*     agnx_send_packet(priv, 997); /
        /* FIXME */
 /*     if (debug == 3) */
 /*                 delay = msecs_to_jiffies(AGNX_PERIODIC_DELAY); */
 /*     else */
        delay = msecs_to_jiffies(AGNX_PERIODIC_DELAY);
-//             delay = round_jiffies(HZ * 15);
+/*     delay = round_jiffies(HZ * 15); */
 
        queue_delayed_work(priv->hw->workqueue, &priv->periodic_work, delay);
 
-//     spin_unlock_irqrestore(&priv->lock, flags);
+/*     spin_unlock_irqrestore(&priv->lock, flags); */
 }
 #endif
 
@@ -255,12 +254,12 @@ static int agnx_start(struct ieee80211_hw *dev)
                goto out;
        }
 
-//     mdelay(500);
+/*     mdelay(500); */
 
        might_sleep();
        agnx_hw_init(priv);
 
-//     mdelay(500);
+/*     mdelay(500); */
        might_sleep();
 
        priv->init_status = AGNX_START;
@@ -280,16 +279,16 @@ static void agnx_stop(struct ieee80211_hw *dev)
        /* make sure hardware will not generate irq */
        agnx_hw_reset(priv);
        free_irq(priv->pdev->irq, dev);
-        flush_workqueue(priv->hw->workqueue);
-//     cancel_delayed_work_sync(&priv->periodic_work);
+       flush_workqueue(priv->hw->workqueue);
+/*     cancel_delayed_work_sync(&priv->periodic_work); */
        unfill_rings(priv);
        rings_free(priv);
 }
 
-static int agnx_config(struct ieee80211_hw *dev,
-                      struct ieee80211_conf *conf)
+static int agnx_config(struct ieee80211_hw *dev, u32 changed)
 {
        struct agnx_priv *priv = dev->priv;
+       struct ieee80211_conf *conf = &dev->conf;
        int channel = ieee80211_frequency_to_channel(conf->channel->center_freq);
        AGNX_TRACE;
 
@@ -315,7 +314,6 @@ static int agnx_config_interface(struct ieee80211_hw *dev,
        spin_lock(&priv->lock);
 
        if (memcmp(conf->bssid, priv->bssid, ETH_ALEN)) {
-//             u32 reghi, reglo;
                agnx_set_bssid(priv, conf->bssid);
                memcpy(priv->bssid, conf->bssid, ETH_ALEN);
                hash_write(priv, conf->bssid, BSSID_STAID);
@@ -425,7 +423,7 @@ static struct ieee80211_ops agnx_ops = {
        .remove_interface       = agnx_remove_interface,
        .config                 = agnx_config,
        .config_interface       = agnx_config_interface,
-       .configure_filter       = agnx_configure_filter,
+       .configure_filter       = agnx_configure_filter,
        .get_stats              = agnx_get_stats,
        .get_tx_stats           = agnx_get_tx_stats,
        .get_tsf                = agnx_get_tsft
@@ -434,11 +432,12 @@ static struct ieee80211_ops agnx_ops = {
 static void __devexit agnx_pci_remove(struct pci_dev *pdev)
 {
        struct ieee80211_hw *dev = pci_get_drvdata(pdev);
-       struct agnx_priv *priv = dev->priv;
+       struct agnx_priv *priv;
        AGNX_TRACE;
 
        if (!dev)
                return;
+       priv = dev->priv;
        ieee80211_unregister_hw(dev);
        pci_iounmap(pdev, priv->ctl);
        pci_iounmap(pdev, priv->data);
@@ -504,7 +503,7 @@ static int __devinit agnx_pci_probe(struct pci_dev *pdev,
 
        /* Map mem #1 and #2 */
        priv->ctl = pci_iomap(pdev, 0, mem_len0);
-//     printk(KERN_DEBUG PFX"MEM1 mapped address is 0x%p\n", priv->ctl);
+/*     printk(KERN_DEBUG PFX"MEM1 mapped address is 0x%p\n", priv->ctl); */
        if (!priv->ctl) {
                printk(KERN_ERR PFX "Can't map device memory\n");
                goto err_free_dev;
index da8f10c..2be6331 100644 (file)
@@ -114,7 +114,7 @@ static void mac_address_set(struct agnx_priv *priv)
        /* FIXME */
        reg = (mac_addr[0] << 24) | (mac_addr[1] << 16) | mac_addr[2] << 8 | mac_addr[3];
        iowrite32(reg, ctl + AGNX_RXM_MACHI);
-       reg = (mac_addr[4] << 8) | mac_addr[5];
+       reg = (mac_addr[4] << 8) | mac_addr[5];
        iowrite32(reg, ctl + AGNX_RXM_MACLO);
 }
 
@@ -127,7 +127,7 @@ static void receiver_bssid_set(struct agnx_priv *priv, u8 *bssid)
        /* FIXME */
        reg = bssid[0] << 24 | (bssid[1] << 16) | (bssid[2] << 8) | bssid[3];
        iowrite32(reg, ctl + AGNX_RXM_BSSIDHI);
-       reg = (bssid[4] << 8) | bssid[5];
+       reg = (bssid[4] << 8) | bssid[5];
        iowrite32(reg, ctl + AGNX_RXM_BSSIDLO);
 
        /* Enable the receiver */
@@ -401,9 +401,9 @@ static void rx_management_init(struct agnx_priv *priv)
                agnx_write32(ctl, 0x2074, 0x1f171710);
                agnx_write32(ctl, 0x2078, 0x10100d0d);
                agnx_write32(ctl, 0x207c, 0x11111010);
-       }
-       else
+       } else {
                agnx_write32(ctl, AGNX_RXM_DELAY11, 0x0);
+       }
        agnx_write32(ctl, AGNX_RXM_REQRATE, 0x8195e00);
 }
 
@@ -476,7 +476,7 @@ static void gain_ctlcnt_init(struct agnx_priv *priv)
        /* It seemed if we set other bit to 1 the bit 0 will
           be auto change to 0 */
        agnx_write32(ctl, AGNX_BM_TXTOPEER, 0x2 | 0x1);
-//     agnx_write32(ctl, AGNX_BM_TXTOPEER, 0x1);
+/*     agnx_write32(ctl, AGNX_BM_TXTOPEER, 0x1); */
 } /* gain_ctlcnt_init */
 
 
@@ -490,7 +490,7 @@ static void phy_init(struct agnx_priv *priv)
        /* Load InitialGainTable */
        gain_table_init(priv);
 
-       agnx_write32(ctl, AGNX_CIR_ADDRWIN, 0x2000000);
+       agnx_write32(ctl, AGNX_CIR_ADDRWIN, 0x2000000);
 
        /* Clear the following offsets in Memory Range #2: */
        memset_io(data + 0x5040, 0, 0xa * 4);
@@ -586,7 +586,7 @@ static void phy_init(struct agnx_priv *priv)
                agnx_write32(ctl, AGNX_GCR_SIFST11B, 0x28);
                agnx_write32(ctl, AGNX_GCR_CWDETEC, 0x0);
                agnx_write32(ctl, AGNX_GCR_0X38, 0x1e);
-//             agnx_write32(ctl, AGNX_GCR_BOACT, 0x26);
+/*             agnx_write32(ctl, AGNX_GCR_BOACT, 0x26);*/
                agnx_write32(ctl, AGNX_GCR_DISCOVMOD, 0x3);
 
                agnx_write32(ctl, AGNX_GCR_THCAP11A, 0x32);
@@ -810,10 +810,10 @@ static void card_interface_init(struct agnx_priv *priv)
                }
                print_hex_dump_bytes(PFX "EEPROM: ", DUMP_PREFIX_NONE, eeprom,
                                     ARRAY_SIZE(eeprom));
-       } while(0);
+       } while (0);
 
        spi_rc_write(ctl, RF_CHIP0, 0x26);
-        reg = agnx_read32(ctl, AGNX_SPI_RLSW);
+       reg = agnx_read32(ctl, AGNX_SPI_RLSW);
 
        /* Initialize the system interface */
        system_itf_init(priv);
@@ -874,19 +874,19 @@ static void card_interface_init(struct agnx_priv *priv)
        /* FIXME Enable the request */
        /* Check packet length */
        /* Set maximum packet length */
-/*     agnx_write32(ctl, AGNX_RXM_REQRATE, 0x88195e00); */
-/*     enable_receiver(priv); */
+/*     agnx_write32(ctl, AGNX_RXM_REQRATE, 0x88195e00); */
+/*     enable_receiver(priv); */
 
        /* Set the Receiver BSSID */
        receiver_bssid_set(priv, bssid);
 
        /* FIXME Set to managed mode */
        set_managed_mode(priv);
-//     set_promiscuous_mode(priv);
-/*     set_scan_mode(priv); */
-/*     set_learn_mode(priv); */
-//     set_promis_and_managed(priv);
-//     set_adhoc_mode(priv);
+/*     set_promiscuous_mode(priv); */
+/*     set_scan_mode(priv); */
+/*     set_learn_mode(priv); */
+/*     set_promis_and_managed(priv); */
+/*     set_adhoc_mode(priv); */
 
        /* Set the recieve request rate */
        /* Check packet length */
index 8294b6e..42e457a 100644 (file)
@@ -109,12 +109,12 @@ void rf_chips_init(struct agnx_priv *priv)
        }
 
        /* Set SPI clock speed to 200NS */
-        reg = agnx_read32(ctl, AGNX_SPI_CFG);
-        reg &= ~0xF;
-        reg |= 0x3;
-        agnx_write32(ctl, AGNX_SPI_CFG, reg);
+       reg = agnx_read32(ctl, AGNX_SPI_CFG);
+       reg &= ~0xF;
+       reg |= 0x3;
+       agnx_write32(ctl, AGNX_SPI_CFG, reg);
 
-        /* Set SPI clock speed to 50NS */
+       /* Set SPI clock speed to 50NS */
        reg = agnx_read32(ctl, AGNX_SPI_CFG);
        reg &= ~0xF;
        reg |= 0x1;
@@ -256,7 +256,7 @@ static void antenna_init(struct agnx_priv *priv, int num_antenna)
                agnx_write32(ctl, AGNX_GCR_THD0BTFEST, 70);
                agnx_write32(ctl, AGNX_GCR_SIGHTH, 100);
                agnx_write32(ctl, AGNX_GCR_SIGLTH, 48);
-//             agnx_write32(ctl, AGNX_GCR_SIGLTH, 16);
+/*             agnx_write32(ctl, AGNX_GCR_SIGLTH, 16); */
                break;
        default:
                printk(KERN_WARNING PFX "Unknow antenna number\n");
@@ -275,8 +275,8 @@ static void chain_update(struct agnx_priv *priv, u32 chain)
        if (reg == 0x4)
                spi_rf_write(ctl, RF_CHIP0|RF_CHIP1, reg|0x1000);
        else if (reg != 0x0)
-               spi_rf_write(ctl, RF_CHIP0|RF_CHIP1|RF_CHIP2, reg|0x1000);
-        else {
+               spi_rf_write(ctl, RF_CHIP0|RF_CHIP1|RF_CHIP2, reg|0x1000);
+       else {
                if (chain == 3 || chain == 6) {
                        spi_rf_write(ctl, RF_CHIP0|RF_CHIP1|RF_CHIP2, reg|0x1000);
                        agnx_write32(ctl, AGNX_GCR_RXOVERIDE, 0x0);
@@ -634,8 +634,7 @@ static void chain_calibrate(struct agnx_priv *priv, struct chains *chains,
        }
 } /* chain_calibrate */
 
-
-static void inline get_calibrete_value(struct agnx_priv *priv, struct chains *chains,
+static inline void get_calibrete_value(struct agnx_priv *priv, struct chains *chains,
                                       unsigned int num)
 {
        void __iomem *ctl = priv->ctl;
@@ -652,7 +651,7 @@ static void inline get_calibrete_value(struct agnx_priv *priv, struct chains *ch
        }
 
        if (num == 0 || num == 1 || num == 2) {
-               if ( 0 == chains[num].cali)
+               if (0 == chains[num].cali)
                        chains[num].cali = 0xff;
                else
                        chains[num].cali--;
@@ -669,7 +668,7 @@ static inline void calibra_delay(struct agnx_priv *priv)
        unsigned int i = 100;
 
        wmb();
-       while (i--) {
+       while (--i) {
                reg = (ioread32(ctl + AGNX_ACI_STATUS));
                if (reg == 0x4000)
                        break;
index d3ac675..5b2d54a 100644 (file)
@@ -18,7 +18,7 @@ void hash_read(struct agnx_priv *priv, u32 reghi, u32 reglo, u8 sta_id)
        iowrite32(reglo, ctl + AGNX_RXM_HASH_CMD_LOW);
 
        reghi = ioread32(ctl + AGNX_RXM_HASH_CMD_HIGH);
-        reglo = ioread32(ctl + AGNX_RXM_HASH_CMD_LOW);
+       reglo = ioread32(ctl + AGNX_RXM_HASH_CMD_LOW);
        printk(PFX "RX hash cmd are : %.8x%.8x\n", reghi, reglo);
 }
 
@@ -40,7 +40,7 @@ void hash_write(struct agnx_priv *priv, u8 *mac_addr, u8 sta_id)
        iowrite32(reghi, ctl + AGNX_RXM_HASH_CMD_HIGH);
        iowrite32(reglo, ctl + AGNX_RXM_HASH_CMD_LOW);
 
-        reglo = ioread32(ctl + AGNX_RXM_HASH_CMD_LOW);
+       reglo = ioread32(ctl + AGNX_RXM_HASH_CMD_LOW);
        if (!(reglo & 0x80000000))
                printk(KERN_WARNING PFX "Update hash table failed\n");
 }
@@ -59,7 +59,7 @@ void hash_delete(struct agnx_priv *priv, u32 reghi, u32 reglo, u8 sta_id)
        iowrite32(reglo, ctl + AGNX_RXM_HASH_CMD_LOW);
        reghi = ioread32(ctl + AGNX_RXM_HASH_CMD_HIGH);
 
-        reglo = ioread32(ctl + AGNX_RXM_HASH_CMD_LOW);
+       reglo = ioread32(ctl + AGNX_RXM_HASH_CMD_LOW);
        printk(PFX "RX hash cmd are : %.8x%.8x\n", reghi, reglo);
 
 }
@@ -69,15 +69,14 @@ void hash_dump(struct agnx_priv *priv, u8 sta_id)
        void __iomem *ctl = priv->ctl;
        u32 reghi, reglo;
 
-       reglo = 0x0;            /* dump command */
-       reglo|= 0x40000000;     /* status bit */
+       reglo = 0x40000000;     /* status bit */
        iowrite32(reglo, ctl + AGNX_RXM_HASH_CMD_LOW);
        iowrite32(sta_id << 16, ctl + AGNX_RXM_HASH_DUMP_DATA);
 
        udelay(80);
 
        reghi = ioread32(ctl + AGNX_RXM_HASH_CMD_HIGH);
-        reglo = ioread32(ctl + AGNX_RXM_HASH_CMD_LOW);
+       reglo = ioread32(ctl + AGNX_RXM_HASH_CMD_LOW);
        printk(PFX "hash cmd are : %.8x%.8x\n", reghi, reglo);
        reghi = ioread32(ctl + AGNX_RXM_HASH_CMD_FLAG);
        printk(PFX "hash flag is : %.8x\n", reghi);
@@ -91,7 +90,7 @@ void hash_dump(struct agnx_priv *priv, u8 sta_id)
 void get_sta_power(struct agnx_priv *priv, struct agnx_sta_power *power, unsigned int sta_idx)
 {
        void __iomem *ctl = priv->ctl;
-        memcpy_fromio(power, ctl + AGNX_TXM_STAPOWTEMP + sizeof(*power) * sta_idx,
+       memcpy_fromio(power, ctl + AGNX_TXM_STAPOWTEMP + sizeof(*power) * sta_idx,
                      sizeof(*power));
 }
 
@@ -100,7 +99,7 @@ set_sta_power(struct agnx_priv *priv, struct agnx_sta_power *power, unsigned int
 {
        void __iomem *ctl = priv->ctl;
        /* FIXME   2. Write Template to offset + station number  */
-        memcpy_toio(ctl + AGNX_TXM_STAPOWTEMP + sizeof(*power) * sta_idx,
+       memcpy_toio(ctl + AGNX_TXM_STAPOWTEMP + sizeof(*power) * sta_idx,
                    power, sizeof(*power));
 }
 
@@ -135,7 +134,7 @@ inline void set_sta(struct agnx_priv *priv, struct agnx_sta *sta, unsigned int s
 {
        void __iomem *data = priv->data;
 
-        memcpy_toio(data + AGNX_PDUPOOL + sizeof(*sta) * sta_idx,
+       memcpy_toio(data + AGNX_PDUPOOL + sizeof(*sta) * sta_idx,
                    sta, sizeof(*sta));
 }
 
@@ -165,7 +164,7 @@ static void sta_tx_workqueue_init(struct agnx_priv *priv, unsigned int sta_idx)
 
        reg = agnx_set_bits(WORK_QUEUE_VALID, WORK_QUEUE_VALID_SHIFT, 1);
        reg |= agnx_set_bits(WORK_QUEUE_ACK_TYPE, WORK_QUEUE_ACK_TYPE_SHIFT, 1);
-//     reg |= agnx_set_bits(WORK_QUEUE_ACK_TYPE, WORK_QUEUE_ACK_TYPE_SHIFT, 0);
+/*     reg |= agnx_set_bits(WORK_QUEUE_ACK_TYPE, WORK_QUEUE_ACK_TYPE_SHIFT, 0); */
        tx_wq.reg2 |= cpu_to_le32(reg);
 
        /* Suppose all 8 traffic class are used */
@@ -181,7 +180,7 @@ static void sta_traffic_init(struct agnx_sta_traffic *traffic)
 
        reg = agnx_set_bits(NEW_PACKET, NEW_PACKET_SHIFT, 1);
        reg |= agnx_set_bits(TRAFFIC_VALID, TRAFFIC_VALID_SHIFT, 1);
-//     reg |= agnx_set_bits(TRAFFIC_ACK_TYPE, TRAFFIC_ACK_TYPE_SHIFT, 1);
+/*     reg |= agnx_set_bits(TRAFFIC_ACK_TYPE, TRAFFIC_ACK_TYPE_SHIFT, 1); */
        traffic->reg0 = cpu_to_le32(reg);
 
        /*      3. setting RX Sequence Number to 4095 */
index 58d0b12..94e2cf1 100644 (file)
@@ -16,7 +16,7 @@ struct agnx_hash_cmd {
 #define PASS           0x00000001
 #define PASS_SHIFT     1
        __be32 cmdlo;
-}__attribute__((__packed__));
+} __attribute__((__packed__));
 
 
 /*
index c600484..b52fef9 100644 (file)
@@ -80,7 +80,7 @@ void routing_table_init(struct agnx_priv *priv)
 
        disable_receiver(priv);
 
-       for ( type = 0; type < 0x3; type++ ) {
+       for (type = 0; type < 0x3; type++) {
                for (subtype = 0; subtype < 0x10; subtype++) {
                        /* 1. Set Routing table to R/W and to Return status on Read */
                        reg = (type << ROUTAB_TYPE_SHIFT) |
@@ -89,7 +89,7 @@ void routing_table_init(struct agnx_priv *priv)
                        if (type == ROUTAB_TYPE_DATA) {
                                /* NULL goes to RFP */
                                if (subtype == ROUTAB_SUBTYPE_NULL)
-//                                     reg |= ROUTAB_ROUTE_RFP;
+/*                                     reg |= ROUTAB_ROUTE_RFP; */
                                        reg |= ROUTAB_ROUTE_CPU;
                                /* QOS NULL goes to CPU */
                                else if (subtype == ROUTAB_SUBTYPE_QOSNULL)
@@ -104,7 +104,7 @@ void routing_table_init(struct agnx_priv *priv)
                                         (subtype == ROUTAB_SUBTYPE_QOSDATAPOLL) ||
                                         (subtype == ROUTAB_SUBTYPE_QOSDATAACKPOLL))
                                        reg |= ROUTAB_ROUTE_ENCRY;
-//                                     reg |= ROUTAB_ROUTE_CPU;
+/*                                     reg |= ROUTAB_ROUTE_CPU; */
                                /*Drop NULL and QOS NULL ack, poll and poll ack*/
                                else if ((subtype == ROUTAB_SUBTYPE_NULLACK) ||
                                         (subtype == ROUTAB_SUBTYPE_QOSNULLACK) ||
@@ -112,11 +112,11 @@ void routing_table_init(struct agnx_priv *priv)
                                         (subtype == ROUTAB_SUBTYPE_QOSNULLPOLL) ||
                                         (subtype == ROUTAB_SUBTYPE_NULLPOLLACK) ||
                                         (subtype == ROUTAB_SUBTYPE_QOSNULLPOLLACK))
-//                                     reg |= ROUTAB_ROUTE_DROP;
+/*                                     reg |= ROUTAB_ROUTE_DROP; */
                                        reg |= ROUTAB_ROUTE_CPU;
-                       }
-                       else
+                       } else {
                                reg |= (ROUTAB_ROUTE_CPU);
+                       }
                        iowrite32(reg, ctl + AGNX_RXM_ROUTAB);
                        /* Check to verify that the status bit cleared */
                        routing_table_delay();
index 7f01528..0e03408 100644 (file)
@@ -17,8 +17,8 @@
 #include "debug.h"
 #include "phy.h"
 
-unsigned int rx_frame_cnt = 0;
-//unsigned int local_tx_sent_cnt = 0;
+unsigned int rx_frame_cnt;
+/* unsigned int local_tx_sent_cnt = 0; */
 
 static inline void disable_rx_engine(struct agnx_priv *priv)
 {
@@ -242,15 +242,15 @@ static void get_rx_stats(struct agnx_priv *priv, struct agnx_hdr *hdr,
        memset(stat, 0, sizeof(*stat));
        /* RSSI */
        rssi = (u8 *)&hdr->phy_stats_lo;
-//     stat->ssi = (rssi[0] + rssi[1] + rssi[2]) / 3;
+/*     stat->ssi = (rssi[0] + rssi[1] + rssi[2]) / 3; */
        /* Noise */
        noise = ioread32(ctl + AGNX_GCR_NOISE0);
        noise += ioread32(ctl + AGNX_GCR_NOISE1);
        noise += ioread32(ctl + AGNX_GCR_NOISE2);
        stat->noise = noise / 3;
        /* Signal quality */
-       //snr = stat->ssi - stat->noise;
-       if (snr >=0 && snr < 40)
+/*     snr = stat->ssi - stat->noise; */
+       if (snr >= 0 && snr < 40)
                stat->signal = 5 * snr / 2;
        else if (snr >= 40)
                stat->signal = 100;
@@ -269,10 +269,9 @@ static void get_rx_stats(struct agnx_priv *priv, struct agnx_hdr *hdr,
 
        stat->band = IEEE80211_BAND_2GHZ;
        stat->freq = agnx_channels[priv->channel - 1].center_freq;
-//     stat->antenna = 3;
-//     stat->mactime = be32_to_cpu(hdr->time_stamp);
-//     stat->channel = priv->channel;
-
+/*     stat->antenna = 3;
+       stat->mactime = be32_to_cpu(hdr->time_stamp);
+       stat->channel = priv->channel; */
 }
 
 static inline void combine_hdr_frag(struct ieee80211_hdr *ieeehdr,
@@ -296,7 +295,7 @@ static inline void combine_hdr_frag(struct ieee80211_hdr *ieeehdr,
 static inline int agnx_packet_check(struct agnx_priv *priv, struct agnx_hdr *agnxhdr,
                                    unsigned packet_len)
 {
-       if (agnx_get_bits(CRC_FAIL, CRC_FAIL_SHIFT, be32_to_cpu(agnxhdr->reg1)) == 1){
+       if (agnx_get_bits(CRC_FAIL, CRC_FAIL_SHIFT, be32_to_cpu(agnxhdr->reg1)) == 1) {
                printk(PFX "RX: CRC check fail\n");
                goto drop;
        }
@@ -320,7 +319,7 @@ void handle_rx_irq(struct agnx_priv *priv)
 {
        struct ieee80211_rx_status status;
        unsigned int len;
-//     AGNX_TRACE;
+/*     AGNX_TRACE; */
 
        do {
                struct agnx_desc *desc;
@@ -341,54 +340,54 @@ void handle_rx_irq(struct agnx_priv *priv)
 
                len = (frag & PACKET_LEN) >> PACKET_LEN_SHIFT;
                if (agnx_packet_check(priv, hdr, len) == -1) {
-                       rx_desc_reusing(priv, i);
+                       rx_desc_reusing(priv, i);
                        continue;
                }
                skb_put(skb, len);
 
                do {
-                       u16 fctl;
+                               u16 fctl;
                        fctl = le16_to_cpu(((struct ieee80211_hdr *)hdr->mac_hdr)->frame_control);
-                       if ((fctl & IEEE80211_FCTL_STYPE) != IEEE80211_STYPE_BEACON)// && !(fctl & IEEE80211_STYPE_BEACON))
+                       if ((fctl & IEEE80211_FCTL_STYPE) != IEEE80211_STYPE_BEACON)/* && !(fctl & IEEE80211_STYPE_BEACON)) */
                                dump_ieee80211_hdr((struct ieee80211_hdr *)hdr->mac_hdr, "RX");
                } while (0);
 
                if (hdr->_11b0 && !hdr->_11g0) {
-/*                     int j; */
-/*                     u16 fctl = le16_to_cpu(((struct ieee80211_hdr *)hdr->mac_hdr) */
-/*                                            ->frame_control); */
-/*                     if ( (fctl & IEEE80211_FCTL_FTYPE) ==  IEEE80211_FTYPE_DATA) { */
-/*                             agnx_print_rx_hdr(hdr); */
-//                             agnx_print_sta(priv, BSSID_STAID);
-/*                             for (j = 0; j < 8; j++) */
-/*                                     agnx_print_sta_tx_wq(priv, BSSID_STAID, j);              */
-/*                     } */
+/*                     int j;
+                       u16 fctl = le16_to_cpu(((struct ieee80211_hdr *)hdr->mac_hdr)
+                                              ->frame_control);
+                       if ( (fctl & IEEE80211_FCTL_FTYPE) ==  IEEE80211_FTYPE_DATA) {
+                               agnx_print_rx_hdr(hdr);
+                               agnx_print_sta(priv, BSSID_STAID);
+                               for (j = 0; j < 8; j++)
+                                       agnx_print_sta_tx_wq(priv, BSSID_STAID, j);
+                       } */
 
                        get_rx_stats(priv, hdr, &status);
                        skb_pull(skb, sizeof(*hdr));
                        combine_hdr_frag((struct ieee80211_hdr *)hdr->mac_hdr, skb);
                } else if (!hdr->_11b0 && hdr->_11g0) {
-//                     int j;
+/*                     int j; */
                        agnx_print_rx_hdr(hdr);
                        agnx_print_sta(priv, BSSID_STAID);
-//                     for (j = 0; j < 8; j++)
+/*                     for (j = 0; j < 8; j++) */
                        agnx_print_sta_tx_wq(priv, BSSID_STAID, 0);
 
                        print_hex_dump_bytes("agnx: RX_PACKET: ", DUMP_PREFIX_NONE,
                                             skb->data, skb->len + 8);
 
-//                     if (agnx_plcp_get_bitrate_ofdm(&hdr->_11g0) == 0)
+/*                     if (agnx_plcp_get_bitrate_ofdm(&hdr->_11g0) == 0) */
                        get_rx_stats(priv, hdr, &status);
                        skb_pull(skb, sizeof(*hdr));
                        combine_hdr_frag((struct ieee80211_hdr *)
                                         ((void *)&hdr->mac_hdr), skb);
-//                     dump_ieee80211_hdr((struct ieee80211_hdr *)skb->data, "RX G");
+/*                     dump_ieee80211_hdr((struct ieee80211_hdr *)skb->data, "RX G"); */
                } else
                        agnx_bug("Unknown packets type");
                ieee80211_rx_irqsafe(priv->hw, skb, &status);
                rx_desc_reinit(priv, i);
 
-       } while ( priv->rx.idx++ );
+       } while (priv->rx.idx++);
 } /* handle_rx_irq */
 
 static inline void handle_tx_irq(struct agnx_priv *priv, struct agnx_ring *ring)
@@ -415,40 +414,40 @@ static inline void handle_tx_irq(struct agnx_priv *priv, struct agnx_ring *ring)
                pci_unmap_single(priv->pdev, info->mapping, info->dma_len, PCI_DMA_TODEVICE);
 
                do {
-//                     int j;
+/*                     int j; */
                        size_t len;
                        len = info->skb->len - sizeof(struct agnx_hdr) + info->hdr_len;
-                       //      if (len == 614) {
-//                             agnx_print_desc(desc);
+/*                     if (len == 614) { */
+/*                             agnx_print_desc(desc); */
                                if (info->type == PACKET) {
-//                                     agnx_print_tx_hdr((struct agnx_hdr *)info->skb->data);
-/*                                     agnx_print_sta_power(priv, LOCAL_STAID); */
-/*                                     agnx_print_sta(priv, LOCAL_STAID); */
-/* //                                  for (j = 0; j < 8; j++) */
-/*                                     agnx_print_sta_tx_wq(priv, LOCAL_STAID, 0); */
-//                                     agnx_print_sta_power(priv, BSSID_STAID);
-//                                     agnx_print_sta(priv, BSSID_STAID);
-//                                     for (j = 0; j < 8; j++)
-//                                     agnx_print_sta_tx_wq(priv, BSSID_STAID, 0);
+/*                                     agnx_print_tx_hdr((struct agnx_hdr *)info->skb->data); */
+/*                                     agnx_print_sta_power(priv, LOCAL_STAID); */
+/*                                     agnx_print_sta(priv, LOCAL_STAID); */
+/*                                     for (j = 0; j < 8; j++) */
+/*                                     agnx_print_sta_tx_wq(priv, LOCAL_STAID, 0); */
+/*                                     agnx_print_sta_power(priv, BSSID_STAID); */
+/*                                     agnx_print_sta(priv, BSSID_STAID); */
+/*                                     for (j = 0; j < 8; j++) */
+/*                                     agnx_print_sta_tx_wq(priv, BSSID_STAID, 0); */
                                }
-//                     }
+/*                     } */
                } while (0);
 
                if (info->type == PACKET) {
-//                     dump_txm_registers(priv);
-//                     dump_rxm_registers(priv);
-//                     dump_bm_registers(priv);
-//                     dump_cir_registers(priv);
+/*                     dump_txm_registers(priv);
+                       dump_rxm_registers(priv);
+                       dump_bm_registers(priv);
+                       dump_cir_registers(priv); */
                }
 
                if (info->type == PACKET) {
-//                     struct ieee80211_hdr *hdr;
+/*                     struct ieee80211_hdr *hdr; */
                        struct ieee80211_tx_info *txi = IEEE80211_SKB_CB(info->skb);
 
                        skb_pull(info->skb, sizeof(struct agnx_hdr));
                        memcpy(skb_push(info->skb, info->hdr_len), &info->hdr, info->hdr_len);
 
-//                     dump_ieee80211_hdr((struct ieee80211_hdr *)info->skb->data, "TX_HANDLE");
+/*                     dump_ieee80211_hdr((struct ieee80211_hdr *)info->skb->data, "TX_HANDLE"); */
 /*                     print_hex_dump_bytes("agnx: TX_HANDLE: ", DUMP_PREFIX_NONE, */
 /*                                          info->skb->data, info->skb->len); */
 
@@ -462,7 +461,7 @@ static inline void handle_tx_irq(struct agnx_priv *priv, struct agnx_ring *ring)
 /*                             ieee80211_tx_status_irqsafe(priv->hw, info->skb, &(info->tx_status)); */
 /*                     } else */
 /*                             dev_kfree_skb_irq(info->skb); */
-               }
+               }
                memset(desc, 0, sizeof(*desc));
                memset(info, 0, sizeof(*info));
        }
@@ -485,7 +484,7 @@ void handle_txd_irq(struct agnx_priv *priv)
 
 void handle_other_irq(struct agnx_priv *priv)
 {
-//     void __iomem *ctl = priv->ctl;
+/*     void __iomem *ctl = priv->ctl; */
        u32 status = priv->irq_status;
        void __iomem *ctl = priv->ctl;
        u32 reg;
@@ -526,11 +525,11 @@ void handle_other_irq(struct agnx_priv *priv)
                iowrite32(reg, ctl + AGNX_INT_MASK);
                iowrite32(IRQ_RX_FRAME, ctl + AGNX_INT_STAT);
                printk(PFX "IRQ: RX Frame\n");
-               rx_frame_cnt++;
+               rx_frame_cnt++;
        }
        if (status & IRQ_ERR_INT) {
                iowrite32(IRQ_ERR_INT, ctl + AGNX_INT_STAT);
-//             agnx_hw_reset(priv);
+/*             agnx_hw_reset(priv); */
                printk(PFX "IRQ: Error Interrupt\n");
        }
        if (status & IRQ_TX_QUE_FULL)
@@ -558,14 +557,14 @@ void handle_other_irq(struct agnx_priv *priv)
 
 static inline void route_flag_set(struct agnx_hdr *txhdr)
 {
-//     u32 reg = 0;
+/*     u32 reg = 0; */
 
        /* FIXME */
-/*     reg = (0x7 << ROUTE_COMPRESSION_SHIFT) & ROUTE_COMPRESSION; */
-/*     txhdr->reg5 = cpu_to_be32(reg); */
-       txhdr->reg5 = (0xa << 0x0) | (0x7 << 0x18);
-//     txhdr->reg5 = cpu_to_be32((0xa << 0x0) | (0x7 << 0x18));
-//     txhdr->reg5 = cpu_to_be32(0x7 << 0x0);
+/*     reg = (0x7 << ROUTE_COMPRESSION_SHIFT) & ROUTE_COMPRESSION; */
+/*     txhdr->reg5 = cpu_to_be32(reg); */
+       txhdr->reg5 = (0xa << 0x0) | (0x7 << 0x18);
+/*     txhdr->reg5 = cpu_to_be32((0xa << 0x0) | (0x7 << 0x18)); */
+/*     txhdr->reg5 = cpu_to_be32(0x7 << 0x0); */
 }
 
 /* Return 0 if no match */
@@ -579,12 +578,29 @@ static inline unsigned int get_power_level(unsigned int rate, unsigned int anten
        case 55:
        case 60:
        case 90:
-       case 120: power_level = 22; break;
-       case 180: power_level = 19; break;
-       case 240: power_level = 18; break;
-       case 360: power_level = 16; break;
-       case 480: power_level = 15; break;
-       case 540: power_level = 14; break;
+       case 120:
+               power_level = 22;
+               break;
+
+       case 180:
+               power_level = 19;
+               break;
+
+       case 240:
+               power_level = 18;
+               break;
+
+       case 360:
+               power_level = 16;
+               break;
+
+       case 480:
+               power_level = 15;
+               break;
+
+       case 540:
+               power_level = 14;
+               break;
        default:
                agnx_bug("Error rate setting\n");
        }
@@ -604,30 +620,30 @@ static inline void fill_agnx_hdr(struct agnx_priv *priv, struct agnx_info *tx_in
 
        memset(txhdr, 0, sizeof(*txhdr));
 
-//     reg = agnx_set_bits(STATION_ID, STATION_ID_SHIFT, LOCAL_STAID);
+/*     reg = agnx_set_bits(STATION_ID, STATION_ID_SHIFT, LOCAL_STAID); */
        reg = agnx_set_bits(STATION_ID, STATION_ID_SHIFT, BSSID_STAID);
        reg |= agnx_set_bits(WORKQUEUE_ID, WORKQUEUE_ID_SHIFT, 0);
        txhdr->reg4 = cpu_to_be32(reg);
 
        /* Set the Hardware Sequence Number to 1? */
        reg = agnx_set_bits(SEQUENCE_NUMBER, SEQUENCE_NUMBER_SHIFT, 0);
-//     reg = agnx_set_bits(SEQUENCE_NUMBER, SEQUENCE_NUMBER_SHIFT, 1);
+/*     reg = agnx_set_bits(SEQUENCE_NUMBER, SEQUENCE_NUMBER_SHIFT, 1); */
        reg |= agnx_set_bits(MAC_HDR_LEN, MAC_HDR_LEN_SHIFT, tx_info->hdr_len);
        txhdr->reg1 = cpu_to_be32(reg);
        /* Set the agnx_hdr's MAC header */
        memcpy(txhdr->mac_hdr, &tx_info->hdr, tx_info->hdr_len);
 
        reg = agnx_set_bits(ACK, ACK_SHIFT, 1);
-//     reg = agnx_set_bits(ACK, ACK_SHIFT, 0);
+/*     reg = agnx_set_bits(ACK, ACK_SHIFT, 0); */
        reg |= agnx_set_bits(MULTICAST, MULTICAST_SHIFT, 0);
-//     reg |= agnx_set_bits(MULTICAST, MULTICAST_SHIFT, 1);
+/*     reg |= agnx_set_bits(MULTICAST, MULTICAST_SHIFT, 1); */
        reg |= agnx_set_bits(RELAY, RELAY_SHIFT, 0);
        reg |= agnx_set_bits(TM, TM_SHIFT, 0);
        txhdr->reg0 = cpu_to_be32(reg);
 
        /* Set the long and short retry limits */
-       txhdr->tx.short_retry_limit = tx_info->txi->control.rates[0].count;
-       txhdr->tx.long_retry_limit = tx_info->txi->control.rates[0].count;
+       txhdr->tx.short_retry_limit = tx_info->txi->control.rates[0].count;
+       txhdr->tx.long_retry_limit = tx_info->txi->control.rates[0].count;
 
        /* FIXME */
        len = tx_info->skb->len - sizeof(*txhdr) + tx_info->hdr_len + FCS_LEN;
@@ -652,23 +668,23 @@ static void txm_power_set(struct agnx_priv *priv,
        if (txi->control.rates[0].idx < 0) {
                /* For B mode Short Preamble */
                reg = agnx_set_bits(PHY_MODE, PHY_MODE_SHIFT, AGNX_MODE_80211B_SHORT);
-//             control->tx_rate = -control->tx_rate;
+/*             control->tx_rate = -control->tx_rate; */
        } else
                reg = agnx_set_bits(PHY_MODE, PHY_MODE_SHIFT, AGNX_MODE_80211G);
-//             reg = agnx_set_bits(PHY_MODE, PHY_MODE_SHIFT, AGNX_MODE_80211B_LONG);
+/*             reg = agnx_set_bits(PHY_MODE, PHY_MODE_SHIFT, AGNX_MODE_80211B_LONG); */
        reg |= agnx_set_bits(SIGNAL, SIGNAL_SHIFT, 0xB);
        reg |= agnx_set_bits(RATE, RATE_SHIFT, 0xB);
-//     reg |= agnx_set_bits(POWER_LEVEL, POWER_LEVEL_SHIFT, 15);
+/*     reg |= agnx_set_bits(POWER_LEVEL, POWER_LEVEL_SHIFT, 15); */
        reg |= agnx_set_bits(POWER_LEVEL, POWER_LEVEL_SHIFT, 20);
        /* if rate < 11M set it to 0 */
        reg |= agnx_set_bits(NUM_TRANSMITTERS, NUM_TRANSMITTERS_SHIFT, 1);
-//     reg |= agnx_set_bits(EDCF, EDCF_SHIFT, 1);
-//     reg |= agnx_set_bits(TIFS, TIFS_SHIFT, 1);
+/*     reg |= agnx_set_bits(EDCF, EDCF_SHIFT, 1); */
+/*     reg |= agnx_set_bits(TIFS, TIFS_SHIFT, 1); */
 
        power.reg = reg;
-//     power.reg = cpu_to_le32(reg);
+/*     power.reg = cpu_to_le32(reg); */
 
-//     set_sta_power(priv, &power, LOCAL_STAID);
+/*     set_sta_power(priv, &power, LOCAL_STAID); */
        set_sta_power(priv, &power, BSSID_STAID);
 }
 
@@ -759,24 +775,24 @@ static int __agnx_tx(struct agnx_priv *priv, struct sk_buff *skb,
 
        txm_power_set(priv, txi);
 
-/*     do { */
-/*             int j; */
-/*             size_t len; */
-/*             len = skb->len - hdr_info->dma_len + hdr_info->hdr_len;  */
-/* //          if (len == 614) { */
-/*                     agnx_print_desc(hdr_desc); */
-/*                     agnx_print_desc(frag_desc); */
-/*                     agnx_print_tx_hdr((struct agnx_hdr *)skb->data); */
-/*                     agnx_print_sta_power(priv, LOCAL_STAID); */
-/*                     agnx_print_sta(priv, LOCAL_STAID); */
-/*                     for (j = 0; j < 8; j++) */
-/*                             agnx_print_sta_tx_wq(priv, LOCAL_STAID, j); */
-/*                     agnx_print_sta_power(priv, BSSID_STAID); */
-/*                     agnx_print_sta(priv, BSSID_STAID); */
-/*                     for (j = 0; j < 8; j++) */
-/*                             agnx_print_sta_tx_wq(priv, BSSID_STAID, j); */
-/*                     //      } */
-/*     } while (0); */
+/*     do { */
+/*             int j; */
+/*             size_t len; */
+/*             len = skb->len - hdr_info->dma_len + hdr_info->hdr_len;  */
+/*             if (len == 614) { */
+/*                     agnx_print_desc(hdr_desc); */
+/*                     agnx_print_desc(frag_desc); */
+/*                     agnx_print_tx_hdr((struct agnx_hdr *)skb->data); */
+/*                     agnx_print_sta_power(priv, LOCAL_STAID); */
+/*                     agnx_print_sta(priv, LOCAL_STAID); */
+/*                     for (j = 0; j < 8; j++) */
+/*                             agnx_print_sta_tx_wq(priv, LOCAL_STAID, j); */
+/*                     agnx_print_sta_power(priv, BSSID_STAID); */
+/*                     agnx_print_sta(priv, BSSID_STAID); */
+/*                     for (j = 0; j < 8; j++) */
+/*                             agnx_print_sta_tx_wq(priv, BSSID_STAID, j); */
+/*                     } */
+/*     } while (0); */
 
        spin_unlock_irqrestore(&priv->lock, flags);
 
@@ -787,7 +803,7 @@ static int __agnx_tx(struct agnx_priv *priv, struct sk_buff *skb,
                reg = (ioread32(priv->ctl + AGNX_CIR_TXMCTL));
                reg |= 0x8;
                iowrite32((reg), priv->ctl + AGNX_CIR_TXMCTL);
-       }while (0);
+       } while (0);
 
        /* Trigger TXD */
        do {
@@ -795,7 +811,7 @@ static int __agnx_tx(struct agnx_priv *priv, struct sk_buff *skb,
                reg = (ioread32(priv->ctl + AGNX_CIR_TXDCTL));
                reg |= 0x8;
                iowrite32((reg), priv->ctl + AGNX_CIR_TXDCTL);
-       }while (0);
+       } while (0);
 
        return 0;
 }
@@ -807,12 +823,12 @@ int _agnx_tx(struct agnx_priv *priv, struct sk_buff *skb)
        if (tx_packet_check(skb))
                return 0;
 
-/*     print_hex_dump_bytes("agnx: TX_PACKET: ", DUMP_PREFIX_NONE, */
-/*                          skb->data, skb->len); */
+/*     print_hex_dump_bytes("agnx: TX_PACKET: ", DUMP_PREFIX_NONE, */
+/*                          skb->data, skb->len); */
 
-        fctl = le16_to_cpu(*((__le16 *)skb->data));
+       fctl = le16_to_cpu(*((__le16 *)skb->data));
 
-       if ( (fctl & IEEE80211_FCTL_FTYPE)  == IEEE80211_FTYPE_DATA )
+       if ((fctl & IEEE80211_FCTL_FTYPE) == IEEE80211_FTYPE_DATA)
                return __agnx_tx(priv, skb, &priv->txd);
        else
                return __agnx_tx(priv, skb, &priv->txm);
index f516140..3e41e08 100644 (file)
@@ -46,7 +46,6 @@
 #include <linux/cdev.h>
 #include <linux/delay.h>
 #include <linux/dma-mapping.h>
-#include <linux/delay.h>
 #include <linux/init.h>
 #include <linux/interrupt.h>
 #include <linux/io.h>
@@ -313,15 +312,16 @@ static int __devinit map_bars(struct ape_dev *ape, struct pci_dev *dev)
                        continue;
                /* do not map BARs with address 0 */
                if (!bar_start || !bar_end) {
-            printk(KERN_DEBUG "BAR #%d is not present?!\n", i);
+                       printk(KERN_DEBUG "BAR #%d is not present?!\n", i);
                        rc = -1;
                        goto fail;
                }
                bar_length = bar_end - bar_start + 1;
                /* BAR length is less than driver requires? */
                if (bar_length < bar_min_len[i]) {
-            printk(KERN_DEBUG "BAR #%d length = %lu bytes but driver "
-            "requires at least %lu bytes\n", i, bar_length, bar_min_len[i]);
+                       printk(KERN_DEBUG "BAR #%d length = %lu bytes but driver "
+                       "requires at least %lu bytes\n",
+                       i, bar_length, bar_min_len[i]);
                        rc = -1;
                        goto fail;
                }
@@ -333,8 +333,8 @@ static int __devinit map_bars(struct ape_dev *ape, struct pci_dev *dev)
                        rc = -1;
                        goto fail;
                }
-        printk(KERN_DEBUG "BAR[%d] mapped at 0x%p with length %lu(/%lu).\n", i,
-                       ape->bar[i], bar_min_len[i], bar_length);
+               printk(KERN_DEBUG "BAR[%d] mapped at 0x%p with length %lu(/%lu).\n", i,
+               ape->bar[i], bar_min_len[i], bar_length);
        }
        /* succesfully mapped all required BAR regions */
        rc = 0;
@@ -427,11 +427,13 @@ static int ape_sg_to_chdma_table(struct scatterlist *sgl, int nents, int first,
                dma_addr_t next = sg_dma_address(&sgl[i + 1]);
                /* length of this entry i */
                len = sg_dma_len(&sgl[i]);
-               printk(KERN_DEBUG "%04d: addr=0x%08x length=0x%08x\n", i, addr, len);
+               printk(KERN_DEBUG "%04d: addr=0x%Lx length=0x%08x\n", i,
+                       (unsigned long long)addr, len);
                /* entry i + 1 is non-contiguous with entry i? */
                if (next != addr + len) {
                        /* TODO create entry here (we could overwrite i) */
-                       printk(KERN_DEBUG "%4d: cont_addr=0x%08x cont_len=0x%08x\n", j, cont_addr, cont_len);
+                       printk(KERN_DEBUG "%4d: cont_addr=0x%Lx cont_len=0x%08x\n", j,
+                               (unsigned long long)cont_addr, cont_len);
                        /* set descriptor for contiguous transfer */
                        ape_chdma_desc_set(&desc[j], cont_addr, ep_addr, cont_len);
                        /* next end point memory address */
@@ -447,8 +449,10 @@ static int ape_sg_to_chdma_table(struct scatterlist *sgl, int nents, int first,
                addr = next;
        }
        /* TODO create entry here  (we could overwrite i) */
-       printk(KERN_DEBUG "%04d: addr=0x%08x length=0x%08x\n", i, addr, len);
-       printk(KERN_DEBUG "%4d: cont_addr=0x%08x length=0x%08x\n", j, cont_addr, cont_len);
+       printk(KERN_DEBUG "%04d: addr=0x%Lx length=0x%08x\n", i,
+               (unsigned long long)addr, len);
+       printk(KERN_DEBUG "%4d: cont_addr=0x%Lx length=0x%08x\n", j,
+               (unsigned long long)cont_addr, cont_len);
        j++;
        return j;
 }
@@ -467,15 +471,14 @@ static inline int compare(u32 *p, u32 *q, int len)
                } else {
                        fail++;
                        /* show the first few miscompares */
-                       if (fail < 10) {
-                printk(KERN_DEBUG "[%p] = 0x%08x != [%p] = 0x%08x ?!\n", p, *p, q, *q);
-            /* but stop after a while */
-            } else if (fail == 10) {
-                printk(KERN_DEBUG "---more errors follow! not printed---\n");
-                       } else {
+                       if (fail < 10)
+                               printk(KERN_DEBUG "[%p] = 0x%08x != [%p] = 0x%08x ?!\n", p, *p, q, *q);
+                               /* but stop after a while */
+                       else if (fail == 10)
+                               printk(KERN_DEBUG "---more errors follow! not printed---\n");
+                       else
                                /* stop compare after this many errors */
-                break;
-            }
+                       break;
                }
                p++;
                q++;
@@ -528,7 +531,7 @@ static int __devinit dma_test(struct ape_dev *ape, struct pci_dev *dev)
        printk(KERN_DEBUG "ape->table_virt = 0x%p.\n", ape->table_virt);
 
        if (!write_header || !read_header || !ape->table_virt)
-        goto fail;
+               goto fail;
 
        /* allocate and map coherently-cached memory for a DMA-able buffer */
        /* @see Documentation/PCI/PCI-DMA-mapping.txt, near line 318 */
@@ -565,9 +568,8 @@ static int __devinit dma_test(struct ape_dev *ape, struct pci_dev *dev)
        /* read 8192 bytes from RC buffer to EP address 4096 */
        ape_chdma_desc_set(&ape->table_virt->desc[n], buffer_bus, 4096, 2 * PAGE_SIZE);
 #if 1
-       for (i = 0; i < 255; i++) {
+       for (i = 0; i < 255; i++)
                ape_chdma_desc_set(&ape->table_virt->desc[i], buffer_bus, 4096, 2 * PAGE_SIZE);
-       }
        /* index of last descriptor */
        n = i - 1;
 #endif
@@ -647,7 +649,7 @@ static int __devinit dma_test(struct ape_dev *ape, struct pci_dev *dev)
                printk(KERN_DEBUG "EPLAST = %u, n = %d\n", eplast, n);
                if (eplast == n) {
                        printk(KERN_DEBUG "DONE\n");
-            /* print IRQ count before the transfer */
+                       /* print IRQ count before the transfer */
                        printk(KERN_DEBUG "#IRQs during transfer: %d\n", ape->irq_count - irq_count);
                        break;
                }
@@ -661,9 +663,9 @@ static int __devinit dma_test(struct ape_dev *ape, struct pci_dev *dev)
        n = 0;
        ape_chdma_desc_set(&ape->table_virt->desc[n], buffer_bus + 8192, 4096, 2 * PAGE_SIZE);
 #if 1
-       for (i = 0; i < 255; i++) {
+       for (i = 0; i < 255; i++)
                ape_chdma_desc_set(&ape->table_virt->desc[i], buffer_bus + 8192, 4096, 2 * PAGE_SIZE);
-       }
+
        /* index of last descriptor */
        n = i - 1;
 #endif
@@ -691,7 +693,7 @@ static int __devinit dma_test(struct ape_dev *ape, struct pci_dev *dev)
        w = (u32)(n + 1);
        /* enable updates of eplast for each descriptor completion */
        w |= (u32)(1UL << 18)/*global EPLAST_EN*/;
-#if 0 // test variable, make a module option later
+#if 0   /* test variable, make a module option later */
        /* enable MSI for each descriptor completion */
        if (ape->msi_enabled)
                w |= (1UL << 17)/*global MSI*/;
@@ -715,7 +717,7 @@ static int __devinit dma_test(struct ape_dev *ape, struct pci_dev *dev)
        /** memory write barrier */
        wmb();
        /** dummy read to flush posted writes */
-       //(void)ioread32();
+       /* (void) ioread32(); */
 
        printk(KERN_DEBUG "POLL FOR WRITE:\n");
        /* poll for completion, 1000 times 1 millisecond */
@@ -844,7 +846,7 @@ static int __devinit probe(struct pci_dev *dev, const struct pci_device_id *id)
        }
        ape->got_regions = 1;
 
-#if 1 // @todo For now, disable 64-bit, because I do not understand the implications (DAC!)
+#if 1   /* @todo For now, disable 64-bit, because I do not understand the implications (DAC!) */
        /* query for DMA transfer */
        /* @see Documentation/PCI/PCI-DMA-mapping.txt */
        if (!pci_set_dma_mask(dev, DMA_64BIT_MASK)) {
@@ -947,7 +949,8 @@ static void __devexit remove(struct pci_dev *dev)
        struct ape_dev *ape;
        printk(KERN_DEBUG "remove(0x%p)\n", dev);
        if ((dev == 0) || (dev->dev.driver_data == 0)) {
-               printk(KERN_DEBUG "remove(dev = 0x%p) dev->dev.driver_data = 0x%p\n", dev, dev->dev.driver_data);
+               printk(KERN_DEBUG "remove(dev = 0x%p) dev->dev.driver_data = 0x%p\n",
+                       dev, (dev? dev->dev.driver_data: NULL));
                return;
        }
        ape = (struct ape_dev *)dev->dev.driver_data;
@@ -1048,10 +1051,9 @@ static ssize_t sg_write(struct file *file, const char __user *buf, size_t count,
        printk(KERN_DEBUG DRV_NAME "_write(buf=0x%p, count=%lld, pos=%llu)\n",
                buf, (s64)count, (u64)*pos);
        /* TODO transfer boundaries at PAGE_SIZE granularity */
-       while (remaining > 0)
-       {
+       while (remaining > 0) {
                /* limit DMA transfer size */
-               transfer_len = (remaining < APE_CHDMA_MAX_TRANSFER_LEN)? remaining:
+               transfer_len = (remaining < APE_CHDMA_MAX_TRANSFER_LEN) ? remaining :
                        APE_CHDMA_MAX_TRANSFER_LEN;
                /* get all user space buffer pages and create a scattergather list */
                sgm_map_user_pages(ape->sgm, transfer_addr, transfer_len, 0/*read from userspace*/);
@@ -1085,12 +1087,12 @@ static ssize_t sg_write(struct file *file, const char __user *buf, size_t count,
 /*
  * character device file operations
  */
-static struct file_operations sg_fops = {
-  .owner = THIS_MODULE,
-  .open = sg_open,
-  .release = sg_close,
-  .read = sg_read,
-  .write = sg_write,
+static const struct file_operations sg_fops = {
+       .owner = THIS_MODULE,
+       .open = sg_open,
+       .release = sg_close,
+       .read = sg_read,
+       .write = sg_write,
 };
 
 /* sg_init() - Initialize character device
@@ -1158,12 +1160,12 @@ static struct pci_driver pci_driver = {
  */
 static int __init alterapciechdma_init(void)
 {
-  int rc = 0;
+       int rc = 0;
        printk(KERN_DEBUG DRV_NAME " init(), built at " __DATE__ " " __TIME__ "\n");
        /* register this driver with the PCI bus driver */
        rc = pci_register_driver(&pci_driver);
        if (rc < 0)
-         return rc;
+               return rc;
        return 0;
 }
 
index 758131c..79e90fe 100644 (file)
@@ -2649,14 +2649,22 @@ static void binder_vma_open(struct vm_area_struct *vma)
 {
        struct binder_proc *proc = vma->vm_private_data;
        if (binder_debug_mask & BINDER_DEBUG_OPEN_CLOSE)
-               printk(KERN_INFO "binder: %d open vm area %lx-%lx (%ld K) vma %lx pagep %lx\n", proc->pid, vma->vm_start, vma->vm_end, (vma->vm_end - vma->vm_start) / SZ_1K, vma->vm_flags, pgprot_val(vma->vm_page_prot));
+               printk(KERN_INFO
+                       "binder: %d open vm area %lx-%lx (%ld K) vma %lx pagep %lx\n",
+                       proc->pid, vma->vm_start, vma->vm_end,
+                       (vma->vm_end - vma->vm_start) / SZ_1K, vma->vm_flags,
+                       (unsigned long)pgprot_val(vma->vm_page_prot));
        dump_stack();
 }
 static void binder_vma_close(struct vm_area_struct *vma)
 {
        struct binder_proc *proc = vma->vm_private_data;
        if (binder_debug_mask & BINDER_DEBUG_OPEN_CLOSE)
-               printk(KERN_INFO "binder: %d close vm area %lx-%lx (%ld K) vma %lx pagep %lx\n", proc->pid, vma->vm_start, vma->vm_end, (vma->vm_end - vma->vm_start) / SZ_1K, vma->vm_flags, pgprot_val(vma->vm_page_prot));
+               printk(KERN_INFO
+                       "binder: %d close vm area %lx-%lx (%ld K) vma %lx pagep %lx\n",
+                       proc->pid, vma->vm_start, vma->vm_end,
+                       (vma->vm_end - vma->vm_start) / SZ_1K, vma->vm_flags,
+                       (unsigned long)pgprot_val(vma->vm_page_prot));
        proc->vma = NULL;
 }
 
@@ -2677,7 +2685,11 @@ static int binder_mmap(struct file *filp, struct vm_area_struct *vma)
                vma->vm_end = vma->vm_start + SZ_4M;
 
        if (binder_debug_mask & BINDER_DEBUG_OPEN_CLOSE)
-               printk(KERN_INFO "binder_mmap: %d %lx-%lx (%ld K) vma %lx pagep %lx\n", proc->pid, vma->vm_start, vma->vm_end, (vma->vm_end - vma->vm_start) / SZ_1K, vma->vm_flags, pgprot_val(vma->vm_page_prot));
+               printk(KERN_INFO
+                       "binder_mmap: %d %lx-%lx (%ld K) vma %lx pagep %lx\n",
+                       proc->pid, vma->vm_start, vma->vm_end,
+                       (vma->vm_end - vma->vm_start) / SZ_1K, vma->vm_flags,
+                       (unsigned long)pgprot_val(vma->vm_page_prot));
 
        if (vma->vm_flags & FORBIDDEN_MMAP_FLAGS) {
                ret = -EPERM;
index 643ac5c..3375c1c 100644 (file)
@@ -225,7 +225,7 @@ static int __init ram_console_init(struct ram_console_buffer *buffer,
                buffer_size - sizeof(struct ram_console_buffer);
 
        if (ram_console_buffer_size > buffer_size) {
-               pr_err("ram_console: buffer %p, invalid size %d, datasize %d\n",
+               pr_err("ram_console: buffer %p, invalid size %zu, datasize %zu\n",
                       buffer, buffer_size, ram_console_buffer_size);
                return 0;
        }
@@ -235,8 +235,8 @@ static int __init ram_console_init(struct ram_console_buffer *buffer,
                                                ECC_BLOCK_SIZE) + 1) * ECC_SIZE;
 
        if (ram_console_buffer_size > buffer_size) {
-               pr_err("ram_console: buffer %p, invalid size %d, "
-                      "non-ecc datasize %d\n",
+               pr_err("ram_console: buffer %p, invalid size %zu, "
+                      "non-ecc datasize %zu\n",
                       buffer, buffer_size, ram_console_buffer_size);
                return 0;
        }
@@ -322,7 +322,7 @@ static int ram_console_driver_probe(struct platform_device *pdev)
        }
        buffer_size = res->end - res->start + 1;
        start = res->start;
-       printk(KERN_INFO "ram_console: got buffer at %x, size %x\n",
+       printk(KERN_INFO "ram_console: got buffer at %zx, size %zx\n",
               start, buffer_size);
        buffer = ioremap(res->start, buffer_size);
        if (buffer == NULL) {
index 666a186..04dde4b 100644 (file)
@@ -56,10 +56,10 @@ MODULE_AUTHOR("Jakub Schmidtke, sjakub@gmail.com");
 MODULE_DESCRIPTION("Asus OLED Driver v" ASUS_OLED_VERSION);
 MODULE_LICENSE("GPL");
 
-static struct class *oled_class = 0;
-static int oled_num = 0;
+static struct class *oled_class;
+static int oled_num;
 
-static uint start_off = 0;
+static uint start_off;
 
 module_param(start_off, uint, 0644);
 
@@ -80,20 +80,20 @@ struct oled_dev_desc_str {
 };
 
 /* table of devices that work with this driver */
-static struct usb_device_id id_table [] = {
+static struct usb_device_id id_table[] = {
        { USB_DEVICE(0x0b05, 0x1726) }, // Asus G1/G2 (and variants)
        { USB_DEVICE(0x0b05, 0x175b) }, // Asus G50V (and possibly others - G70? G71?)
        { },
 };
 
 /* parameters of specific devices */
-static struct oled_dev_desc_str oled_dev_desc_table [] = {
+static struct oled_dev_desc_str oled_dev_desc_table[] = {
        { 0x0b05, 0x1726, 128, PACK_MODE_G1, "G1/G2" },
        { 0x0b05, 0x175b, 256, PACK_MODE_G50, "G50" },
        { },
 };
 
-MODULE_DEVICE_TABLE (usb, id_table);
+MODULE_DEVICE_TABLE(usb, id_table);
 
 #define SETUP_PACKET_HEADER(packet, val1, val2, val3, val4, val5, val6, val7) \
        do {                                    \
@@ -107,7 +107,7 @@ MODULE_DEVICE_TABLE (usb, id_table);
                packet->header.value6 = val5;           \
                packet->header.value7 = val6;           \
                packet->header.value8 = val7;           \
-       } while(0);
+       } while (0);
 
 struct asus_oled_header {
        uint8_t         magic1;
@@ -160,10 +160,12 @@ static void enable_oled(struct asus_oled_dev *odev, uint8_t enabl)
 
        SETUP_PACKET_HEADER(packet, 0x20, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00);
 
-       if (enabl) packet->bitmap[0] = 0xaf;
-       else packet->bitmap[0] = 0xae;
+       if (enabl)
+               packet->bitmap[0] = 0xaf;
+       else
+               packet->bitmap[0] = 0xae;
 
-       for (a=0; a<1; a++) {
+       for (a = 0; a < 1; a++) {
                retval = usb_bulk_msg(odev->udev,
                        usb_sndbulkpipe(odev->udev, 2),
                        packet,
@@ -252,7 +254,7 @@ static void send_packets(struct usb_device *udev, struct asus_oled_packet *packe
        }
 }
 
-static void send_packet(struct usb_device *udev, struct asus_oled_packet *packet, size_t offset, size_t len, char *buf, uint8_t b1, uint8_t b2, uint8_t b3, uint8_t b4, uint8_t b5, uint8_t b6){
+static void send_packet(struct usb_device *udev, struct asus_oled_packet *packet, size_t offset, size_t len, char *buf, uint8_t b1, uint8_t b2, uint8_t b3, uint8_t b4, uint8_t b5, uint8_t b6) {
        int retval;
        int act_len;
 
@@ -294,7 +296,7 @@ static void send_data(struct asus_oled_dev *odev)
                return;
        }
 
-       if (odev->pack_mode==PACK_MODE_G1){
+       if (odev->pack_mode == PACK_MODE_G1) {
                // When sending roll-mode data the display updated only first packet.
                // I have no idea why, but when static picture is send just before
                // rolling picture - everything works fine.
@@ -308,7 +310,7 @@ static void send_data(struct asus_oled_dev *odev)
                send_packets(odev->udev, packet, odev->buf, odev->pic_mode, packet_num);
        }
        else
-       if (odev->pack_mode==PACK_MODE_G50){
+       if (odev->pack_mode == PACK_MODE_G50) {
                send_packets_g50(odev->udev, packet, odev->buf);
        }
 
@@ -326,7 +328,7 @@ static int append_values(struct asus_oled_dev *odev, uint8_t val, size_t count)
                        x += odev->x_shift;
                        y += odev->y_shift;
 
-                       switch(odev->pack_mode)
+                       switch (odev->pack_mode)
                        {
                                case PACK_MODE_G1:
                                        // i = (x/128)*640 + 127 - x + (y/8)*128;
@@ -377,30 +379,32 @@ static ssize_t odev_set_picture(struct asus_oled_dev *odev, const char *buf, siz
 {
        size_t offs = 0, max_offs;
 
-       if (count < 1) return 0;
+       if (count < 1)
+               return 0;
 
-       if (tolower(buf[0]) == 'b'){
+       if (tolower(buf[0]) == 'b') {
            // binary mode, set the entire memory
 
            size_t i;
 
            odev->buf_size = (odev->dev_width * ASUS_OLED_DISP_HEIGHT) / 8;
 
-           if (odev->buf) kfree(odev->buf);
+           if (odev->buf)
+                   kfree(odev->buf);
            odev->buf = kmalloc(odev->buf_size, GFP_KERNEL);
 
            memset(odev->buf, 0xff, odev->buf_size);
 
-           for (i=1; i < count && i<=32*32; i++){
+           for (i = 1; i < count && i <= 32 * 32; i++) {
                odev->buf[i-1] = buf[i];
                odev->buf_offs = i-1;
            }
 
-           odev->width=odev->dev_width / 8;
-           odev->height=ASUS_OLED_DISP_HEIGHT;
-           odev->x_shift=0;
-           odev->y_shift=0;
-           odev->last_val=0;
+           odev->width = odev->dev_width / 8;
+           odev->height = ASUS_OLED_DISP_HEIGHT;
+           odev->x_shift = 0;
+           odev->y_shift = 0;
+           odev->last_val =  0;
 
            send_data(odev);
 
@@ -416,7 +420,7 @@ static ssize_t odev_set_picture(struct asus_oled_dev *odev, const char *buf, siz
                        goto error_header;
                }
 
-               switch(tolower(buf[1])) {
+               switch (tolower(buf[1])) {
                        case ASUS_OLED_STATIC:
                        case ASUS_OLED_ROLL:
                        case ASUS_OLED_FLASH:
@@ -432,27 +436,36 @@ static ssize_t odev_set_picture(struct asus_oled_dev *odev, const char *buf, siz
                        if (buf[i] >= '0' && buf[i] <= '9') {
                                w = 10*w + (buf[i] - '0');
 
-                               if (w > ASUS_OLED_MAX_WIDTH) goto error_width;
+                               if (w > ASUS_OLED_MAX_WIDTH)
+                                       goto error_width;
                        }
-                       else if (tolower(buf[i]) == 'x') break;
-                       else goto error_width;
+                       else if (tolower(buf[i]) == 'x')
+                               break;
+                       else
+                               goto error_width;
                }
 
                for (++i; i < count; ++i) {
                        if (buf[i] >= '0' && buf[i] <= '9') {
                                h = 10*h + (buf[i] - '0');
 
-                               if (h > ASUS_OLED_DISP_HEIGHT) goto error_height;
+                               if (h > ASUS_OLED_DISP_HEIGHT)
+                                       goto error_height;
                        }
-                       else if (tolower(buf[i]) == '>') break;
-                       else goto error_height;
+                       else if (tolower(buf[i]) == '>')
+                               break;
+                       else
+                               goto error_height;
                }
 
-               if (w < 1 || w > ASUS_OLED_MAX_WIDTH) goto error_width;
+               if (w < 1 || w > ASUS_OLED_MAX_WIDTH)
+                       goto error_width;
 
-               if (h < 1 || h > ASUS_OLED_DISP_HEIGHT) goto error_height;
+               if (h < 1 || h > ASUS_OLED_DISP_HEIGHT)
+                       goto error_height;
 
-               if (i >= count || buf[i] != '>') goto error_header;
+               if (i >= count || buf[i] != '>')
+                       goto error_header;
 
                offs = i+1;
 
@@ -468,7 +481,8 @@ static ssize_t odev_set_picture(struct asus_oled_dev *odev, const char *buf, siz
 
                odev->buf_size = w_mem * h_mem / 8;
 
-               if (odev->buf) kfree(odev->buf);
+               if (odev->buf)
+                       kfree(odev->buf);
                odev->buf = kmalloc(odev->buf_size, GFP_KERNEL);
 
                if (odev->buf == NULL) {
@@ -505,23 +519,30 @@ static ssize_t odev_set_picture(struct asus_oled_dev *odev, const char *buf, siz
                int ret;
 
                if (buf[offs] == '1' || buf[offs] == '#') {
-                       if ( (ret = append_values(odev, 1, 1)) < 0) return ret;
+                       ret = append_values(odev, 1, 1);
+                       if (ret < 0)
+                               return ret;
                }
                else if (buf[offs] == '0' || buf[offs] == ' ') {
-                       if ( (ret = append_values(odev, 0, 1)) < 0) return ret;
+                       ret = append_values(odev, 0, 1);
+                       if (ret < 0)
+                               return ret;
                }
                else if (buf[offs] == '\n') {
                        // New line detected. Lets assume, that all characters till the end of the
                        // line were equal to the last character in this line.
                        if (odev->buf_offs % odev->width != 0)
-                               if ( (ret = append_values(odev, odev->last_val,
-                                     odev->width - (odev->buf_offs % odev->width))) < 0) return ret;
+                               ret = append_values(odev, odev->last_val,
+                                     odev->width - (odev->buf_offs % odev->width));
+                               if (ret < 0)
+                                       return ret;
                }
 
                offs++;
        }
 
-       if (odev->buf_offs >= max_offs) send_data(odev);
+       if (odev->buf_offs >= max_offs)
+               send_data(odev);
 
        return count;
 
@@ -566,9 +587,9 @@ static int asus_oled_probe(struct usb_interface *interface, const struct usb_dev
        uint16_t dev_width = 0;
        oled_pack_mode_t pack_mode = PACK_MODE_LAST;
        const struct oled_dev_desc_str * dev_desc = oled_dev_desc_table;
-       const char *desc = 0;
+       const char *desc = NULL;
 
-       if (id == 0) {
+       if (!id) {
                // Even possible? Just to make sure...
                dev_err(&interface->dev, "No usb_device_id provided!\n");
                return -ENODEV;
@@ -586,7 +607,7 @@ static int asus_oled_probe(struct usb_interface *interface, const struct usb_dev
                }
        }
 
-       if ( !desc || dev_width < 1 || pack_mode == PACK_MODE_LAST) {
+       if (!desc || dev_width < 1 || pack_mode == PACK_MODE_LAST) {
                dev_err(&interface->dev, "Missing or incomplete device description!\n");
                return -ENODEV;
        }
@@ -611,20 +632,20 @@ static int asus_oled_probe(struct usb_interface *interface, const struct usb_dev
        odev->last_val = 0;
        odev->buf = NULL;
        odev->enabled = 1;
-       odev->dev = 0;
+       odev->dev = NULL;
 
-       usb_set_intfdata (interface, odev);
+       usb_set_intfdata(interface, odev);
 
-       if ((retval = device_create_file(&interface->dev, &ASUS_OLED_DEVICE_ATTR(enabled)))) {
+       retval = device_create_file(&interface->dev, &ASUS_OLED_DEVICE_ATTR(enabled));
+       if (retval)
                goto err_files;
-       }
 
-       if ((retval = device_create_file(&interface->dev, &ASUS_OLED_DEVICE_ATTR(picture)))) {
+       retval = device_create_file(&interface->dev, &ASUS_OLED_DEVICE_ATTR(picture));
+       if (retval)
                goto err_files;
-       }
 
-       odev->dev = device_create(oled_class, &interface->dev, MKDEV(0,0),
-                               NULL,"oled_%d", ++oled_num);
+       odev->dev = device_create(oled_class, &interface->dev, MKDEV(0, 0),
+                               NULL, "oled_%d", ++oled_num);
 
        if (IS_ERR(odev->dev)) {
                retval = PTR_ERR(odev->dev);
@@ -633,13 +654,13 @@ static int asus_oled_probe(struct usb_interface *interface, const struct usb_dev
 
        dev_set_drvdata(odev->dev, odev);
 
-       if ( (retval = device_create_file(odev->dev, &dev_attr_enabled))) {
+       retval = device_create_file(odev->dev, &dev_attr_enabled);
+       if (retval)
                goto err_class_enabled;
-       }
 
-       if ( (retval = device_create_file(odev->dev, &dev_attr_picture))) {
+       retval = device_create_file(odev->dev, &dev_attr_picture);
+       if (retval)
                goto err_class_picture;
-       }
 
        dev_info(&interface->dev, "Attached Asus OLED device: %s [width %u, pack_mode %d]\n", desc, odev->dev_width, odev->pack_mode);
 
@@ -659,7 +680,7 @@ err_files:
        device_remove_file(&interface->dev, &ASUS_OLED_DEVICE_ATTR(enabled));
        device_remove_file(&interface->dev, &ASUS_OLED_DEVICE_ATTR(picture));
 
-       usb_set_intfdata (interface, NULL);
+       usb_set_intfdata(interface, NULL);
        usb_put_dev(odev->udev);
        kfree(odev);
 
@@ -670,19 +691,20 @@ static void asus_oled_disconnect(struct usb_interface *interface)
 {
        struct asus_oled_dev *odev;
 
-       odev = usb_get_intfdata (interface);
-       usb_set_intfdata (interface, NULL);
+       odev = usb_get_intfdata(interface);
+       usb_set_intfdata(interface, NULL);
 
        device_remove_file(odev->dev, &dev_attr_picture);
        device_remove_file(odev->dev, &dev_attr_enabled);
        device_unregister(odev->dev);
 
-       device_remove_file(&interface->dev, & ASUS_OLED_DEVICE_ATTR(picture));
-       device_remove_file(&interface->dev, & ASUS_OLED_DEVICE_ATTR(enabled));
+       device_remove_file(&interface->dev, &ASUS_OLED_DEVICE_ATTR(picture));
+       device_remove_file(&interface->dev, &ASUS_OLED_DEVICE_ATTR(enabled));
 
        usb_put_dev(odev->udev);
 
-       if (odev->buf) kfree(odev->buf);
+       if (odev->buf)
+               kfree(odev->buf);
 
        kfree(odev);
 
@@ -713,7 +735,8 @@ static int __init asus_oled_init(void)
                return PTR_ERR(oled_class);
        }
 
-       if ((retval = class_create_file(oled_class, &class_attr_version))) {
+       retval = class_create_file(oled_class, &class_attr_version);
+       if (retval) {
                err("Error creating class version file");
                goto error;
        }
@@ -740,6 +763,6 @@ static void __exit asus_oled_exit(void)
        usb_deregister(&oled_driver);
 }
 
-module_init (asus_oled_init);
-module_exit (asus_oled_exit);
+module_init(asus_oled_init);
+module_exit(asus_oled_exit);
 
index 6911ca7..0c7ed21 100644 (file)
@@ -1,2 +1,7 @@
-rewrite the driver to use the proper in-kernel wireless stack
-instead of using its own.
+Fix the mac80211 port of at76_usb (the proper in-kernel wireless
+stack) and get it included to the mainline. Patches available here:
+
+http://git.kernel.org/?p=linux/kernel/git/linville/wireless-legacy.git;a=shortlog;h=at76
+
+Contact Kalle Valo <kalle.valo@iki.fi> and linux-wireless list
+<linux-wireless@vger.kernel.org> for more information.
index c8e4d31..6f6e36a 100644 (file)
@@ -36,7 +36,7 @@
 #include <net/ieee80211_radiotap.h>
 #include <linux/firmware.h>
 #include <linux/leds.h>
-#include <net/ieee80211.h>
+#include <linux/ieee80211.h>
 
 #include "at76_usb.h"
 
@@ -1727,12 +1727,12 @@ static int at76_assoc_req(struct at76_priv *priv, struct bss_info *bss)
 
        /* write TLV data elements */
 
-       ie->id = MFIE_TYPE_SSID;
+       ie->id = WLAN_EID_SSID;
        ie->len = bss->ssid_len;
        memcpy(ie->data, bss->ssid, bss->ssid_len);
        next_ie(&ie);
 
-       ie->id = MFIE_TYPE_RATES;
+       ie->id = WLAN_EID_SUPP_RATES;
        ie->len = sizeof(hw_rates);
        memcpy(ie->data, hw_rates, sizeof(hw_rates));
        next_ie(&ie);           /* ie points behind the supp_rates field */
@@ -4397,7 +4397,7 @@ static void at76_rx_mgmt_beacon(struct at76_priv *priv,
 
                switch (ie->id) {
 
-               case MFIE_TYPE_SSID:
+               case WLAN_EID_SSID:
                        if (have_ssid)
                                break;
 
@@ -4420,7 +4420,7 @@ static void at76_rx_mgmt_beacon(struct at76_priv *priv,
                        have_ssid = 1;
                        break;
 
-               case MFIE_TYPE_RATES:
+               case WLAN_EID_SUPP_RATES:
                        if (have_rates)
                                break;
 
@@ -4433,7 +4433,7 @@ static void at76_rx_mgmt_beacon(struct at76_priv *priv,
                                 hex2str(ie->data, ie->len));
                        break;
 
-               case MFIE_TYPE_DS_SET:
+               case WLAN_EID_DS_PARAMS:
                        if (have_channel)
                                break;
 
@@ -4443,9 +4443,9 @@ static void at76_rx_mgmt_beacon(struct at76_priv *priv,
                                 priv->netdev->name, match->channel);
                        break;
 
-               case MFIE_TYPE_CF_SET:
-               case MFIE_TYPE_TIM:
-               case MFIE_TYPE_IBSS_SET:
+               case WLAN_EID_CF_PARAMS:
+               case WLAN_EID_TIM:
+               case WLAN_EID_IBSS_PARAMS:
                default:
                        at76_dbg(DBG_RX_BEACON, "%s: beacon IE id %d len %d %s",
                                 priv->netdev->name, ie->id, ie->len,
@@ -5370,8 +5370,7 @@ static void at76_delete_device(struct at76_priv *priv)
 
        at76_dbg(DBG_PROC_ENTRY, "%s: unlinked urbs", __func__);
 
-       if (priv->rx_skb)
-               kfree_skb(priv->rx_skb);
+       kfree_skb(priv->rx_skb);
 
        at76_free_bss_list(priv);
        del_timer_sync(&priv->bss_list_timer);
index b20be9d..6d60c6e 100644 (file)
 #ifndef _AT76_USB_H
 #define _AT76_USB_H
 
+/*
+ * ieee80211 definitions copied from net/ieee80211.h
+ */
+
+#define WEP_KEY_LEN            13
+#define WEP_KEYS               4
+
+#define IEEE80211_DATA_LEN             2304
+/* Maximum size for the MA-UNITDATA primitive, 802.11 standard section
+   6.2.1.1.2.
+
+   The figure in section 7.1.2 suggests a body size of up to 2312
+   bytes is allowed, which is a bit confusing, I suspect this
+   represents the 2304 bytes of real data, plus a possible 8 bytes of
+   WEP IV and ICV. (this interpretation suggested by Ramiro Barreiro) */
+
+#define IEEE80211_1ADDR_LEN 10
+#define IEEE80211_2ADDR_LEN 16
+#define IEEE80211_3ADDR_LEN 24
+#define IEEE80211_4ADDR_LEN 30
+#define IEEE80211_FCS_LEN    4
+#define IEEE80211_HLEN                 (IEEE80211_4ADDR_LEN)
+#define IEEE80211_FRAME_LEN            (IEEE80211_DATA_LEN + IEEE80211_HLEN)
+
+#define MIN_FRAG_THRESHOLD     256U
+#define        MAX_FRAG_THRESHOLD     2346U
+
+struct ieee80211_info_element {
+       u8 id;
+       u8 len;
+       u8 data[0];
+} __attribute__ ((packed));
+
+struct ieee80211_hdr_3addr {
+       __le16 frame_ctl;
+       __le16 duration_id;
+       u8 addr1[ETH_ALEN];
+       u8 addr2[ETH_ALEN];
+       u8 addr3[ETH_ALEN];
+       __le16 seq_ctl;
+       u8 payload[0];
+} __attribute__ ((packed));
+
+struct ieee80211_auth {
+       struct ieee80211_hdr_3addr header;
+       __le16 algorithm;
+       __le16 transaction;
+       __le16 status;
+       /* challenge */
+       struct ieee80211_info_element info_element[0];
+} __attribute__ ((packed));
+
+struct ieee80211_assoc_request {
+       struct ieee80211_hdr_3addr header;
+       __le16 capability;
+       __le16 listen_interval;
+       /* SSID, supported rates, RSN */
+       struct ieee80211_info_element info_element[0];
+} __attribute__ ((packed));
+
+struct ieee80211_probe_response {
+       struct ieee80211_hdr_3addr header;
+       __le32 time_stamp[2];
+       __le16 beacon_interval;
+       __le16 capability;
+       /* SSID, supported rates, FH params, DS params,
+        * CF params, IBSS params, TIM (if beacon), RSN */
+       struct ieee80211_info_element info_element[0];
+} __attribute__ ((packed));
+
+/* Alias beacon for probe_response */
+#define ieee80211_beacon ieee80211_probe_response
+
+struct ieee80211_assoc_response {
+       struct ieee80211_hdr_3addr header;
+       __le16 capability;
+       __le16 status;
+       __le16 aid;
+       /* supported rates */
+       struct ieee80211_info_element info_element[0];
+} __attribute__ ((packed));
+
+struct ieee80211_disassoc {
+       struct ieee80211_hdr_3addr header;
+       __le16 reason;
+} __attribute__ ((packed));
+
 /* Board types */
 enum board_type {
        BOARD_503_ISL3861 = 1,
diff --git a/drivers/staging/b3dfg/Kconfig b/drivers/staging/b3dfg/Kconfig
new file mode 100644 (file)
index 0000000..5242310
--- /dev/null
@@ -0,0 +1,9 @@
+config B3DFG
+       tristate "Brontes 3d Frame Framegrabber"
+       default n
+       ---help---
+         This driver provides support for the Brontes 3d Framegrabber
+         PCI card.
+
+         To compile this driver as a module, choose M here. The module
+         will be called b3dfg.
diff --git a/drivers/staging/b3dfg/Makefile b/drivers/staging/b3dfg/Makefile
new file mode 100644 (file)
index 0000000..91f439f
--- /dev/null
@@ -0,0 +1 @@
+obj-$(CONFIG_B3DFG) += b3dfg.o
diff --git a/drivers/staging/b3dfg/TODO b/drivers/staging/b3dfg/TODO
new file mode 100644 (file)
index 0000000..f5a9298
--- /dev/null
@@ -0,0 +1,4 @@
+
+ - queue/wait buffer presents filltime results for each frame?
+ - counting of dropped frames
+ - review endianness
diff --git a/drivers/staging/b3dfg/b3dfg.c b/drivers/staging/b3dfg/b3dfg.c
new file mode 100644 (file)
index 0000000..0348072
--- /dev/null
@@ -0,0 +1,1119 @@
+ /*
+ * Brontes PCI frame grabber driver
+ *
+ * Copyright (C) 2008 3M Company
+ * Contact: Justin Bronder <jsbronder@brontes3d.com>
+ * Original Authors: Daniel Drake <ddrake@brontes3d.com>
+ *                   Duane Griffin <duaneg@dghda.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#include <linux/device.h>
+#include <linux/fs.h>
+#include <linux/interrupt.h>
+#include <linux/spinlock.h>
+#include <linux/ioctl.h>
+#include <linux/kernel.h>
+#include <linux/module.h>
+#include <linux/pci.h>
+#include <linux/types.h>
+#include <linux/cdev.h>
+#include <linux/list.h>
+#include <linux/poll.h>
+#include <linux/wait.h>
+#include <linux/mm.h>
+#include <linux/version.h>
+#include <linux/uaccess.h>
+
+static unsigned int b3dfg_nbuf = 2;
+
+module_param_named(buffer_count, b3dfg_nbuf, uint, 0444);
+
+MODULE_PARM_DESC(buffer_count, "Number of buffers (min 2, default 2)\n");
+
+MODULE_AUTHOR("Daniel Drake <ddrake@brontes3d.com>");
+MODULE_DESCRIPTION("Brontes frame grabber driver");
+MODULE_LICENSE("GPL");
+
+#define DRIVER_NAME "b3dfg"
+#define B3DFG_MAX_DEVS 4
+#define B3DFG_FRAMES_PER_BUFFER 3
+
+#define B3DFG_BAR_REGS 0
+#define B3DFG_REGS_LENGTH 0x10000
+
+#define B3DFG_IOC_MAGIC                0xb3 /* dfg :-) */
+#define B3DFG_IOCGFRMSZ                _IOR(B3DFG_IOC_MAGIC, 1, int)
+#define B3DFG_IOCTNUMBUFS      _IO(B3DFG_IOC_MAGIC, 2)
+#define B3DFG_IOCTTRANS                _IO(B3DFG_IOC_MAGIC, 3)
+#define B3DFG_IOCTQUEUEBUF     _IO(B3DFG_IOC_MAGIC, 4)
+#define B3DFG_IOCTPOLLBUF      _IOWR(B3DFG_IOC_MAGIC, 5, struct b3dfg_poll)
+#define B3DFG_IOCTWAITBUF      _IOWR(B3DFG_IOC_MAGIC, 6, struct b3dfg_wait)
+#define B3DFG_IOCGWANDSTAT     _IOR(B3DFG_IOC_MAGIC, 7, int)
+
+enum {
+       /* number of 4kb pages per frame */
+       B3D_REG_FRM_SIZE = 0x0,
+
+       /* bit 0: set to enable interrupts
+        * bit 1: set to enable cable status change interrupts */
+       B3D_REG_HW_CTRL = 0x4,
+
+       /* bit 0-1 - 1-based ID of next pending frame transfer (0 = none)
+        * bit 2 indicates the previous DMA transfer has completed
+        * bit 3 indicates wand cable status change
+        * bit 8:15 - counter of number of discarded triplets */
+       B3D_REG_DMA_STS = 0x8,
+
+       /* bit 0: wand status (1 = present, 0 = disconnected) */
+       B3D_REG_WAND_STS = 0xc,
+
+       /* bus address for DMA transfers. lower 2 bits must be zero because DMA
+        * works with 32 bit word size. */
+       B3D_REG_EC220_DMA_ADDR = 0x8000,
+
+       /* bit 20:0 - number of 32 bit words to be transferred
+        * bit 21:31 - reserved */
+       B3D_REG_EC220_TRF_SIZE = 0x8004,
+
+       /* bit 0 - error bit
+        * bit 1 - interrupt bit (set to generate interrupt at end of transfer)
+        * bit 2 - start bit (set to start transfer)
+        * bit 3 - direction (0 = DMA_TO_DEVICE, 1 = DMA_FROM_DEVICE
+        * bit 4:31 - reserved */
+       B3D_REG_EC220_DMA_STS = 0x8008,
+};
+
+enum b3dfg_buffer_state {
+       B3DFG_BUFFER_POLLED = 0,
+       B3DFG_BUFFER_PENDING,
+       B3DFG_BUFFER_POPULATED,
+};
+
+struct b3dfg_buffer {
+       unsigned char *frame[B3DFG_FRAMES_PER_BUFFER];
+       struct list_head list;
+       u8 state;
+};
+
+struct b3dfg_dev {
+
+       /* no protection needed: all finalized at initialization time */
+       struct pci_dev *pdev;
+       struct cdev chardev;
+       struct device *dev;
+       void __iomem *regs;
+       unsigned int frame_size;
+
+       /*
+        * Protects buffer state, including buffer_queue, triplet_ready,
+        * cur_dma_frame_idx & cur_dma_frame_addr.
+        */
+       spinlock_t buffer_lock;
+       struct b3dfg_buffer *buffers;
+       struct list_head buffer_queue;
+
+       /* Last frame in triplet transferred (-1 if none). */
+       int cur_dma_frame_idx;
+
+       /* Current frame's address for DMA. */
+       dma_addr_t cur_dma_frame_addr;
+
+       /*
+        * Protects cstate_tstamp.
+        * Nests inside buffer_lock.
+        */
+       spinlock_t cstate_lock;
+       unsigned long cstate_tstamp;
+
+       /*
+        * Protects triplets_dropped.
+        * Nests inside buffers_lock.
+        */
+       spinlock_t triplets_dropped_lock;
+       unsigned int triplets_dropped;
+
+       wait_queue_head_t buffer_waitqueue;
+
+       unsigned int transmission_enabled:1;
+       unsigned int triplet_ready:1;
+};
+
+static u8 b3dfg_devices[B3DFG_MAX_DEVS];
+
+static struct class *b3dfg_class;
+static dev_t b3dfg_devt;
+
+static const struct pci_device_id b3dfg_ids[] __devinitdata = {
+       { PCI_DEVICE(0x0b3d, 0x0001) },
+       { },
+};
+
+MODULE_DEVICE_TABLE(pci, b3dfg_ids);
+
+/***** user-visible types *****/
+
+struct b3dfg_poll {
+       int buffer_idx;
+       unsigned int triplets_dropped;
+};
+
+struct b3dfg_wait {
+       int buffer_idx;
+       unsigned int timeout;
+       unsigned int triplets_dropped;
+};
+
+/**** register I/O ****/
+
+static u32 b3dfg_read32(struct b3dfg_dev *fgdev, u16 reg)
+{
+       return ioread32(fgdev->regs + reg);
+}
+
+static void b3dfg_write32(struct b3dfg_dev *fgdev, u16 reg, u32 value)
+{
+       iowrite32(value, fgdev->regs + reg);
+}
+
+/**** buffer management ****/
+
+/*
+ * Program EC220 for transfer of a specific frame.
+ * Called with buffer_lock held.
+ */
+static int setup_frame_transfer(struct b3dfg_dev *fgdev,
+       struct b3dfg_buffer *buf, int frame)
+{
+       unsigned char *frm_addr;
+       dma_addr_t frm_addr_dma;
+       unsigned int frm_size = fgdev->frame_size;
+
+       frm_addr = buf->frame[frame];
+       frm_addr_dma = pci_map_single(fgdev->pdev, frm_addr,
+                                         frm_size, PCI_DMA_FROMDEVICE);
+       if (pci_dma_mapping_error(fgdev->pdev, frm_addr_dma))
+               return -ENOMEM;
+
+       fgdev->cur_dma_frame_addr = frm_addr_dma;
+       fgdev->cur_dma_frame_idx = frame;
+
+       b3dfg_write32(fgdev, B3D_REG_EC220_DMA_ADDR,
+                                       cpu_to_le32(frm_addr_dma));
+       b3dfg_write32(fgdev, B3D_REG_EC220_TRF_SIZE,
+                                       cpu_to_le32(frm_size >> 2));
+       b3dfg_write32(fgdev, B3D_REG_EC220_DMA_STS, 0xf);
+
+       return 0;
+}
+
+/* Caller should hold buffer lock */
+static void dequeue_all_buffers(struct b3dfg_dev *fgdev)
+{
+       int i;
+       for (i = 0; i < b3dfg_nbuf; i++) {
+               struct b3dfg_buffer *buf = &fgdev->buffers[i];
+               buf->state = B3DFG_BUFFER_POLLED;
+               list_del_init(&buf->list);
+       }
+}
+
+/* queue a buffer to receive data */
+static int queue_buffer(struct b3dfg_dev *fgdev, int bufidx)
+{
+       struct device *dev = &fgdev->pdev->dev;
+       struct b3dfg_buffer *buf;
+       unsigned long flags;
+       int r = 0;
+
+       spin_lock_irqsave(&fgdev->buffer_lock, flags);
+       if (bufidx < 0 || bufidx >= b3dfg_nbuf) {
+               dev_dbg(dev, "Invalid buffer index, %d\n", bufidx);
+               r = -ENOENT;
+               goto out;
+       }
+       buf = &fgdev->buffers[bufidx];
+
+       if (unlikely(buf->state == B3DFG_BUFFER_PENDING)) {
+               dev_dbg(dev, "buffer %d is already queued\n", bufidx);
+               r = -EINVAL;
+               goto out;
+       }
+
+       buf->state = B3DFG_BUFFER_PENDING;
+       list_add_tail(&buf->list, &fgdev->buffer_queue);
+
+       if (fgdev->transmission_enabled && fgdev->triplet_ready) {
+               dev_dbg(dev, "triplet is ready, pushing immediately\n");
+               fgdev->triplet_ready = 0;
+               r = setup_frame_transfer(fgdev, buf, 0);
+               if (r)
+                       dev_err(dev, "unable to map DMA buffer\n");
+       }
+
+out:
+       spin_unlock_irqrestore(&fgdev->buffer_lock, flags);
+       return r;
+}
+
+/* non-blocking buffer poll. returns 1 if data is present in the buffer,
+ * 0 otherwise */
+static int poll_buffer(struct b3dfg_dev *fgdev, void __user *arg)
+{
+       struct device *dev = &fgdev->pdev->dev;
+       struct b3dfg_poll p;
+       struct b3dfg_buffer *buf;
+       unsigned long flags;
+       int r = 1;
+       int arg_out = 0;
+
+       if (copy_from_user(&p, arg, sizeof(p)))
+               return -EFAULT;
+
+       if (unlikely(!fgdev->transmission_enabled)) {
+               dev_dbg(dev, "cannot poll, transmission disabled\n");
+               return -EINVAL;
+       }
+
+       if (p.buffer_idx < 0 || p.buffer_idx >= b3dfg_nbuf)
+               return -ENOENT;
+
+       buf = &fgdev->buffers[p.buffer_idx];
+
+       spin_lock_irqsave(&fgdev->buffer_lock, flags);
+
+       if (likely(buf->state == B3DFG_BUFFER_POPULATED)) {
+               arg_out = 1;
+               buf->state = B3DFG_BUFFER_POLLED;
+
+               /* IRQs already disabled by spin_lock_irqsave above. */
+               spin_lock(&fgdev->triplets_dropped_lock);
+               p.triplets_dropped = fgdev->triplets_dropped;
+               fgdev->triplets_dropped = 0;
+               spin_unlock(&fgdev->triplets_dropped_lock);
+       } else {
+               r = 0;
+       }
+
+       spin_unlock_irqrestore(&fgdev->buffer_lock, flags);
+
+       if (arg_out && copy_to_user(arg, &p, sizeof(p)))
+               r = -EFAULT;
+
+       return r;
+}
+
+static unsigned long get_cstate_change(struct b3dfg_dev *fgdev)
+{
+       unsigned long flags, when;
+
+       spin_lock_irqsave(&fgdev->cstate_lock, flags);
+       when = fgdev->cstate_tstamp;
+       spin_unlock_irqrestore(&fgdev->cstate_lock, flags);
+       return when;
+}
+
+static int is_event_ready(struct b3dfg_dev *fgdev, struct b3dfg_buffer *buf,
+                         unsigned long when)
+{
+       int result;
+       unsigned long flags;
+
+       spin_lock_irqsave(&fgdev->buffer_lock, flags);
+       spin_lock(&fgdev->cstate_lock);
+       result = (!fgdev->transmission_enabled ||
+                 buf->state == B3DFG_BUFFER_POPULATED ||
+                 when != fgdev->cstate_tstamp);
+       spin_unlock(&fgdev->cstate_lock);
+       spin_unlock_irqrestore(&fgdev->buffer_lock, flags);
+
+       return result;
+}
+
+/* sleep until a specific buffer becomes populated */
+static int wait_buffer(struct b3dfg_dev *fgdev, void __user *arg)
+{
+       struct device *dev = &fgdev->pdev->dev;
+       struct b3dfg_wait w;
+       struct b3dfg_buffer *buf;
+       unsigned long flags, when;
+       int r;
+
+       if (copy_from_user(&w, arg, sizeof(w)))
+               return -EFAULT;
+
+       if (!fgdev->transmission_enabled) {
+               dev_dbg(dev, "cannot wait, transmission disabled\n");
+               return -EINVAL;
+       }
+
+       if (w.buffer_idx < 0 || w.buffer_idx >= b3dfg_nbuf)
+               return -ENOENT;
+
+       buf = &fgdev->buffers[w.buffer_idx];
+
+       spin_lock_irqsave(&fgdev->buffer_lock, flags);
+
+       if (buf->state == B3DFG_BUFFER_POPULATED) {
+               r = w.timeout;
+               goto out_triplets_dropped;
+       }
+
+       spin_unlock_irqrestore(&fgdev->buffer_lock, flags);
+
+       when = get_cstate_change(fgdev);
+       if (w.timeout > 0) {
+               r = wait_event_interruptible_timeout(fgdev->buffer_waitqueue,
+                       is_event_ready(fgdev, buf, when),
+                       (w.timeout * HZ) / 1000);
+
+               if (unlikely(r < 0))
+                       goto out;
+
+               w.timeout = r * 1000 / HZ;
+       } else {
+               r = wait_event_interruptible(fgdev->buffer_waitqueue,
+                       is_event_ready(fgdev, buf, when));
+
+               if (unlikely(r)) {
+                       r = -ERESTARTSYS;
+                       goto out;
+               }
+       }
+
+       /* TODO: Inform the user via field(s) in w? */
+       if (!fgdev->transmission_enabled || when != get_cstate_change(fgdev)) {
+               r = -EINVAL;
+               goto out;
+       }
+
+       spin_lock_irqsave(&fgdev->buffer_lock, flags);
+
+       if (buf->state != B3DFG_BUFFER_POPULATED) {
+               r = -ETIMEDOUT;
+               goto out_unlock;
+       }
+
+       buf->state = B3DFG_BUFFER_POLLED;
+
+out_triplets_dropped:
+
+       /* IRQs already disabled by spin_lock_irqsave above. */
+       spin_lock(&fgdev->triplets_dropped_lock);
+       w.triplets_dropped = fgdev->triplets_dropped;
+       fgdev->triplets_dropped = 0;
+       spin_unlock(&fgdev->triplets_dropped_lock);
+
+out_unlock:
+       spin_unlock_irqrestore(&fgdev->buffer_lock, flags);
+       if (copy_to_user(arg, &w, sizeof(w)))
+               r = -EFAULT;
+out:
+       return r;
+}
+
+/* mmap page fault handler */
+static int b3dfg_vma_fault(struct vm_area_struct *vma,
+       struct vm_fault *vmf)
+{
+       struct b3dfg_dev *fgdev = vma->vm_file->private_data;
+       unsigned long off = vmf->pgoff << PAGE_SHIFT;
+       unsigned int frame_size = fgdev->frame_size;
+       unsigned int buf_size = frame_size * B3DFG_FRAMES_PER_BUFFER;
+       unsigned char *addr;
+
+       /* determine which buffer the offset lies within */
+       unsigned int buf_idx = off / buf_size;
+       /* and the offset into the buffer */
+       unsigned int buf_off = off % buf_size;
+
+       /* determine which frame inside the buffer the offset lies in */
+       unsigned int frm_idx = buf_off / frame_size;
+       /* and the offset into the frame */
+       unsigned int frm_off = buf_off % frame_size;
+
+       if (unlikely(buf_idx >= b3dfg_nbuf))
+               return VM_FAULT_SIGBUS;
+
+       addr = fgdev->buffers[buf_idx].frame[frm_idx] + frm_off;
+       vm_insert_pfn(vma, (unsigned long)vmf->virtual_address,
+                         virt_to_phys(addr) >> PAGE_SHIFT);
+
+       return VM_FAULT_NOPAGE;
+}
+
+static struct vm_operations_struct b3dfg_vm_ops = {
+       .fault = b3dfg_vma_fault,
+};
+
+static int get_wand_status(struct b3dfg_dev *fgdev, int __user *arg)
+{
+       u32 wndstat = b3dfg_read32(fgdev, B3D_REG_WAND_STS);
+       dev_dbg(&fgdev->pdev->dev, "wand status %x\n", wndstat);
+       return __put_user(wndstat & 0x1, arg);
+}
+
+static int enable_transmission(struct b3dfg_dev *fgdev)
+{
+       u16 command;
+       unsigned long flags;
+       struct device *dev = &fgdev->pdev->dev;
+
+       dev_dbg(dev, "enable transmission\n");
+
+       /* check the cable is plugged in. */
+       if (!b3dfg_read32(fgdev, B3D_REG_WAND_STS)) {
+               dev_dbg(dev, "cannot start transmission without wand\n");
+               return -EINVAL;
+       }
+
+       /*
+        * Check we're a bus master.
+        * TODO: I think we can remove this having added the pci_set_master call
+        */
+       pci_read_config_word(fgdev->pdev, PCI_COMMAND, &command);
+       if (!(command & PCI_COMMAND_MASTER)) {
+               dev_err(dev, "not a bus master, force-enabling\n");
+               pci_write_config_word(fgdev->pdev, PCI_COMMAND,
+                       command | PCI_COMMAND_MASTER);
+       }
+
+       spin_lock_irqsave(&fgdev->buffer_lock, flags);
+
+       /* Handle racing enable_transmission calls. */
+       if (fgdev->transmission_enabled) {
+               spin_unlock_irqrestore(&fgdev->buffer_lock, flags);
+               goto out;
+       }
+
+       spin_lock(&fgdev->triplets_dropped_lock);
+       fgdev->triplets_dropped = 0;
+       spin_unlock(&fgdev->triplets_dropped_lock);
+
+       fgdev->triplet_ready = 0;
+       fgdev->cur_dma_frame_idx = -1;
+       fgdev->transmission_enabled = 1;
+
+       spin_unlock_irqrestore(&fgdev->buffer_lock, flags);
+
+       /* Enable DMA and cable status interrupts. */
+       b3dfg_write32(fgdev, B3D_REG_HW_CTRL, 0x03);
+
+out:
+       return 0;
+}
+
+static void disable_transmission(struct b3dfg_dev *fgdev)
+{
+       struct device *dev = &fgdev->pdev->dev;
+       unsigned long flags;
+       u32 tmp;
+
+       dev_dbg(dev, "disable transmission\n");
+
+       /* guarantee that no more interrupts will be serviced */
+       spin_lock_irqsave(&fgdev->buffer_lock, flags);
+       fgdev->transmission_enabled = 0;
+
+       b3dfg_write32(fgdev, B3D_REG_HW_CTRL, 0);
+
+       /* FIXME: temporary debugging only. if the board stops transmitting,
+        * hitting ctrl+c and seeing this message is useful for determining
+        * the state of the board. */
+       tmp = b3dfg_read32(fgdev, B3D_REG_DMA_STS);
+       dev_dbg(dev, "DMA_STS reads %x after TX stopped\n", tmp);
+
+       dequeue_all_buffers(fgdev);
+       spin_unlock_irqrestore(&fgdev->buffer_lock, flags);
+
+       wake_up_interruptible(&fgdev->buffer_waitqueue);
+}
+
+static int set_transmission(struct b3dfg_dev *fgdev, int enabled)
+{
+       int res = 0;
+
+       if (enabled && !fgdev->transmission_enabled)
+               res = enable_transmission(fgdev);
+       else if (!enabled && fgdev->transmission_enabled)
+               disable_transmission(fgdev);
+
+       return res;
+}
+
+/* Called in interrupt context. */
+static void handle_cstate_unplug(struct b3dfg_dev *fgdev)
+{
+       /* Disable all interrupts. */
+       b3dfg_write32(fgdev, B3D_REG_HW_CTRL, 0);
+
+       /* Stop transmission. */
+       spin_lock(&fgdev->buffer_lock);
+       fgdev->transmission_enabled = 0;
+
+       fgdev->cur_dma_frame_idx = -1;
+       fgdev->triplet_ready = 0;
+       if (fgdev->cur_dma_frame_addr) {
+               pci_unmap_single(fgdev->pdev, fgdev->cur_dma_frame_addr,
+                                fgdev->frame_size, PCI_DMA_FROMDEVICE);
+               fgdev->cur_dma_frame_addr = 0;
+       }
+       dequeue_all_buffers(fgdev);
+       spin_unlock(&fgdev->buffer_lock);
+}
+
+/* Called in interrupt context. */
+static void handle_cstate_change(struct b3dfg_dev *fgdev)
+{
+       u32 cstate = b3dfg_read32(fgdev, B3D_REG_WAND_STS);
+       unsigned long when;
+       struct device *dev = &fgdev->pdev->dev;
+
+       dev_dbg(dev, "cable state change: %u\n", cstate);
+
+       /*
+        * When the wand is unplugged we reset our state. The hardware will
+        * have done the same internally.
+        *
+        * Note we should never see a cable *plugged* event, as interrupts
+        * should only be enabled when transmitting, which requires the cable
+        * to be plugged. If we do see one it probably means the cable has been
+        * unplugged and re-plugged very rapidly. Possibly because it has a
+        * broken wire and is momentarily losing contact.
+        *
+        * TODO: At the moment if you plug in the cable then enable transmission
+        * the hardware will raise a couple of spurious interrupts, so
+        * just ignore them for now.
+        *
+        * Once the hardware is fixed we should complain and treat it as an
+        * unplug. Or at least track how frequently it is happening and do
+        * so if too many come in.
+        */
+       if (cstate) {
+               dev_warn(dev, "ignoring unexpected plug event\n");
+               return;
+       }
+       handle_cstate_unplug(fgdev);
+
+       /*
+        * Record cable state change timestamp & wake anyone waiting
+        * on a cable state change. Be paranoid about ensuring events
+        * are not missed if we somehow get two interrupts in a jiffy.
+        */
+       spin_lock(&fgdev->cstate_lock);
+       when = jiffies_64;
+       if (when <= fgdev->cstate_tstamp)
+               when = fgdev->cstate_tstamp + 1;
+       fgdev->cstate_tstamp = when;
+       wake_up_interruptible(&fgdev->buffer_waitqueue);
+       spin_unlock(&fgdev->cstate_lock);
+}
+
+/* Called with buffer_lock held. */
+static void transfer_complete(struct b3dfg_dev *fgdev)
+{
+       struct b3dfg_buffer *buf;
+       struct device *dev = &fgdev->pdev->dev;
+
+       pci_unmap_single(fgdev->pdev, fgdev->cur_dma_frame_addr,
+                        fgdev->frame_size, PCI_DMA_FROMDEVICE);
+       fgdev->cur_dma_frame_addr = 0;
+
+       buf = list_entry(fgdev->buffer_queue.next, struct b3dfg_buffer, list);
+       if (buf) {
+               dev_dbg(dev, "handle frame completion\n");
+               if (fgdev->cur_dma_frame_idx == B3DFG_FRAMES_PER_BUFFER - 1) {
+
+                       /* last frame of that triplet completed */
+                       dev_dbg(dev, "triplet completed\n");
+                       buf->state = B3DFG_BUFFER_POPULATED;
+                       list_del_init(&buf->list);
+                       wake_up_interruptible(&fgdev->buffer_waitqueue);
+               }
+       } else {
+               dev_err(dev, "got frame but no buffer!\n");
+       }
+}
+
+/*
+ * Called with buffer_lock held.
+ *
+ * Note that idx is the (1-based) *next* frame to be transferred, while
+ * cur_dma_frame_idx is the (0-based) *last* frame to have been transferred (or
+ * -1 if none). Thus there should be a difference of 2 between them.
+ */
+static bool setup_next_frame_transfer(struct b3dfg_dev *fgdev, int idx)
+{
+       struct b3dfg_buffer *buf;
+       struct device *dev = &fgdev->pdev->dev;
+       bool need_ack = 1;
+
+       dev_dbg(dev, "program DMA transfer for next frame: %d\n", idx);
+
+       buf = list_entry(fgdev->buffer_queue.next, struct b3dfg_buffer, list);
+       if (buf) {
+               if (idx == fgdev->cur_dma_frame_idx + 2) {
+                       if (setup_frame_transfer(fgdev, buf, idx - 1))
+                               dev_err(dev, "unable to map DMA buffer\n");
+                       need_ack = 0;
+               } else {
+                       dev_err(dev, "frame mismatch, got %d, expected %d\n",
+                               idx, fgdev->cur_dma_frame_idx + 2);
+
+                       /* FIXME: handle dropped triplets here */
+               }
+       } else {
+               dev_err(dev, "cannot setup DMA, no buffer\n");
+       }
+
+       return need_ack;
+}
+
+static irqreturn_t b3dfg_intr(int irq, void *dev_id)
+{
+       struct b3dfg_dev *fgdev = dev_id;
+       struct device *dev = &fgdev->pdev->dev;
+       u32 sts;
+       u8 dropped;
+       bool need_ack = 1;
+       irqreturn_t res = IRQ_HANDLED;
+
+       sts = b3dfg_read32(fgdev, B3D_REG_DMA_STS);
+       if (unlikely(sts == 0)) {
+               dev_warn(dev, "ignore interrupt, DMA status is 0\n");
+               res = IRQ_NONE;
+               goto out;
+       }
+
+       if (unlikely(!fgdev->transmission_enabled)) {
+               dev_warn(dev, "ignore interrupt, TX disabled\n");
+               res = IRQ_HANDLED;
+               goto out;
+       }
+
+       /* Handle dropped frames, as reported by the hardware. */
+       dropped = (sts >> 8) & 0xff;
+       dev_dbg(dev, "intr: DMA_STS=%08x (drop=%d comp=%d next=%d)\n",
+               sts, dropped, !!(sts & 0x4), sts & 0x3);
+       if (unlikely(dropped > 0)) {
+               spin_lock(&fgdev->triplets_dropped_lock);
+               fgdev->triplets_dropped += dropped;
+               spin_unlock(&fgdev->triplets_dropped_lock);
+       }
+
+       /* Handle a cable state change (i.e. the wand being unplugged). */
+       if (sts & 0x08) {
+               handle_cstate_change(fgdev);
+               goto out;
+       }
+
+       spin_lock(&fgdev->buffer_lock);
+       if (unlikely(list_empty(&fgdev->buffer_queue))) {
+
+               /* FIXME need more sanity checking here */
+               dev_info(dev, "buffer not ready for next transfer\n");
+               fgdev->triplet_ready = 1;
+               goto out_unlock;
+       }
+
+       /* Has a frame transfer been completed? */
+       if (sts & 0x4) {
+               u32 dma_status = b3dfg_read32(fgdev, B3D_REG_EC220_DMA_STS);
+
+               /* Check for DMA errors reported by the hardware. */
+               if (unlikely(dma_status & 0x1)) {
+                       dev_err(dev, "EC220 error: %08x\n", dma_status);
+
+                       /* FIXME flesh out error handling */
+                       goto out_unlock;
+               }
+
+               /* Sanity check, we should have a frame index at this point. */
+               if (unlikely(fgdev->cur_dma_frame_idx == -1)) {
+                       dev_err(dev, "completed but no last idx?\n");
+
+                       /* FIXME flesh out error handling */
+                       goto out_unlock;
+               }
+
+               transfer_complete(fgdev);
+       }
+
+       /* Is there another frame transfer pending? */
+       if (sts & 0x3)
+               need_ack = setup_next_frame_transfer(fgdev, sts & 0x3);
+       else
+               fgdev->cur_dma_frame_idx = -1;
+
+out_unlock:
+       spin_unlock(&fgdev->buffer_lock);
+out:
+       if (need_ack) {
+               dev_dbg(dev, "acknowledging interrupt\n");
+               b3dfg_write32(fgdev, B3D_REG_EC220_DMA_STS, 0x0b);
+       }
+       return res;
+}
+
+static int b3dfg_open(struct inode *inode, struct file *filp)
+{
+       struct b3dfg_dev *fgdev =
+               container_of(inode->i_cdev, struct b3dfg_dev, chardev);
+
+       dev_dbg(&fgdev->pdev->dev, "open\n");
+       filp->private_data = fgdev;
+       return 0;
+}
+
+static int b3dfg_release(struct inode *inode, struct file *filp)
+{
+       struct b3dfg_dev *fgdev = filp->private_data;
+       dev_dbg(&fgdev->pdev->dev, "release\n");
+       disable_transmission(fgdev);
+       return 0;
+}
+
+static long b3dfg_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
+{
+       struct b3dfg_dev *fgdev = filp->private_data;
+
+       switch (cmd) {
+       case B3DFG_IOCGFRMSZ:
+               return __put_user(fgdev->frame_size, (int __user *) arg);
+       case B3DFG_IOCGWANDSTAT:
+               return get_wand_status(fgdev, (int __user *) arg);
+       case B3DFG_IOCTTRANS:
+               return set_transmission(fgdev, (int) arg);
+       case B3DFG_IOCTQUEUEBUF:
+               return queue_buffer(fgdev, (int) arg);
+       case B3DFG_IOCTPOLLBUF:
+               return poll_buffer(fgdev, (void __user *) arg);
+       case B3DFG_IOCTWAITBUF:
+               return wait_buffer(fgdev, (void __user *) arg);
+       default:
+               dev_dbg(&fgdev->pdev->dev, "unrecognised ioctl %x\n", cmd);
+               return -EINVAL;
+       }
+}
+
+static unsigned int b3dfg_poll(struct file *filp, poll_table *poll_table)
+{
+       struct b3dfg_dev *fgdev = filp->private_data;
+       unsigned long flags, when;
+       int i;
+       int r = 0;
+
+       when = get_cstate_change(fgdev);
+       poll_wait(filp, &fgdev->buffer_waitqueue, poll_table);
+
+       spin_lock_irqsave(&fgdev->buffer_lock, flags);
+       for (i = 0; i < b3dfg_nbuf; i++) {
+               if (fgdev->buffers[i].state == B3DFG_BUFFER_POPULATED) {
+                       r = POLLIN | POLLRDNORM;
+                       break;
+               }
+       }
+       spin_unlock_irqrestore(&fgdev->buffer_lock, flags);
+
+       /* TODO: Confirm this is how we want to communicate the change. */
+       if (!fgdev->transmission_enabled || when != get_cstate_change(fgdev))
+               r = POLLERR;
+
+       return r;
+}
+
+static int b3dfg_mmap(struct file *filp, struct vm_area_struct *vma)
+{
+       struct b3dfg_dev *fgdev = filp->private_data;
+       unsigned long offset = vma->vm_pgoff << PAGE_SHIFT;
+       unsigned long vsize = vma->vm_end - vma->vm_start;
+       unsigned long bufdatalen = b3dfg_nbuf * fgdev->frame_size * 3;
+       unsigned long psize = bufdatalen - offset;
+       int r = 0;
+
+       if (vsize <= psize) {
+               vma->vm_flags |= VM_IO | VM_RESERVED | VM_CAN_NONLINEAR |
+                                VM_PFNMAP;
+               vma->vm_ops = &b3dfg_vm_ops;
+       } else {
+               r = -EINVAL;
+       }
+
+       return r;
+}
+
+static struct file_operations b3dfg_fops = {
+       .owner = THIS_MODULE,
+       .open = b3dfg_open,
+       .release = b3dfg_release,
+       .unlocked_ioctl = b3dfg_ioctl,
+       .poll = b3dfg_poll,
+       .mmap = b3dfg_mmap,
+};
+
+static void free_all_frame_buffers(struct b3dfg_dev *fgdev)
+{
+       int i, j;
+       for (i = 0; i < b3dfg_nbuf; i++)
+               for (j = 0; j < B3DFG_FRAMES_PER_BUFFER; j++)
+                       kfree(fgdev->buffers[i].frame[j]);
+       kfree(fgdev->buffers);
+}
+
+/* initialize device and any data structures. called before any interrupts
+ * are enabled. */
+static&