Skip to contentSkip to conversation

STAGING patches for 2.6.28

PATCH In review Greg KH 8 participants 37 messages Oct 10, 2008 – Oct 18, 2008

Subsystems (3)
lore
Share & tools
lore

Greg KH

author
#0 lore raw

PATCH 1/1 STAGING patches for 2.6.28

Here is a tree of patches against your 2.6 git tree that adds the drivers/staging/ directory and related infrastructure.

The infrastructure is:
- add TAINT_CRAP to the kernel and the module build tools
- add MAINTAINERS file entry for this pile of crap

The drivers we have for the staging/ directory in this patch series are:
- USB/IP drivers
- echo cancellation driver (used by mISDN and Zaptel)
- eth131x network driver
- slicoss network driver
- sxg network driver
- me4000 data collection driver
- go7007 video capture driver
- wlan-ng prism2 usb driver
- w35und wifi driver

There are also follow-on patches by individuals cleaning up some of the problems in these drivers that have kept them out of the main kernel tree so far.

All of these drivers are self-contained in their respective subdirectories, touching no other kernel code at all. There are TODO files in the directories detailing what is needed to be done to clean up these drivers to get them merged into the main tree.

Please pull from:
master.kernel.org:/pub/scm/linux/kernel/git/gregkh/staging-2.6.git/

Patches will be sent as a follow-on to this message to lkml for people to see.

thanks,

greg k-h

 Documentation/sysctl/kernel.txt             |    1 +
 MAINTAINERS                                 |    7 +
 drivers/Kconfig                             |    2 +
 drivers/Makefile                            |    1 +
 drivers/staging/Kconfig                     |   44 +
 drivers/staging/Makefile                    |   11 +
 drivers/staging/echo/Kconfig                |    9 +
 drivers/staging/echo/Makefile               |    1 +
 drivers/staging/echo/TODO                   |   10 +
 drivers/staging/echo/bit_operations.h       |  253 +
 drivers/staging/echo/echo.c                 |  632 ++
 drivers/staging/echo/echo.h                 |  220 +
 drivers/staging/echo/fir.h                  |  369 +
 drivers/staging/echo/mmx.h                  |  288 +
 drivers/staging/et131x/Kconfig              |   18 +
 drivers/staging/et131x/Makefile             |   18 +
 drivers/staging/et131x/README               |   25 +
 drivers/staging/et131x/et1310_address_map.h | 2399 +++++++
 drivers/staging/et131x/et1310_eeprom.c      |  480 ++
 drivers/staging/et131x/et1310_eeprom.h      |   89 +
 drivers/staging/et131x/et1310_jagcore.c     |  220 +
 drivers/staging/et131x/et1310_jagcore.h     |  112 +
 drivers/staging/et131x/et1310_mac.c         |  792 +++
 drivers/staging/et131x/et1310_mac.h         |   93 +
 drivers/staging/et131x/et1310_phy.c         | 1281 ++++
 drivers/staging/et131x/et1310_phy.h         |  910 +++
 drivers/staging/et131x/et1310_pm.c          |  207 +
 drivers/staging/et131x/et1310_pm.h          |  125 +
 drivers/staging/et131x/et1310_rx.c          | 1391 ++++
 drivers/staging/et131x/et1310_rx.h          |  373 +
 drivers/staging/et131x/et1310_tx.c          | 1525 ++++
 drivers/staging/et131x/et1310_tx.h          |  242 +
 drivers/staging/et131x/et131x_adapter.h     |  347 +
 drivers/staging/et131x/et131x_config.c      |  325 +
 drivers/staging/et131x/et131x_config.h      |   67 +
 drivers/staging/et131x/et131x_debug.c       |  218 +
 drivers/staging/et131x/et131x_debug.h       |  201 +
 drivers/staging/et131x/et131x_defs.h        |  128 +
 drivers/staging/et131x/et131x_initpci.c     | 1046 +++
 drivers/staging/et131x/et131x_initpci.h     |   73 +
 drivers/staging/et131x/et131x_isr.c         |  488 ++
 drivers/staging/et131x/et131x_isr.h         |   65 +
 drivers/staging/et131x/et131x_netdev.c      |  856 +++
 drivers/staging/et131x/et131x_netdev.h      |   64 +
 drivers/staging/et131x/et131x_version.h     |   81 +
 drivers/staging/go7007/Kconfig              |   25 +
 drivers/staging/go7007/Makefile             |   18 +
 drivers/staging/go7007/README               |   11 +
 drivers/staging/go7007/go7007-driver.c      |  688 ++
 drivers/staging/go7007/go7007-fw.c          | 1639 +++++
 drivers/staging/go7007/go7007-i2c.c         |  309 +
 drivers/staging/go7007/go7007-priv.h        |  279 +
 drivers/staging/go7007/go7007-usb.c         | 1229 ++++
 drivers/staging/go7007/go7007-v4l2.c        | 1499 ++++
 drivers/staging/go7007/go7007.h             |  114 +
 drivers/staging/go7007/saa7134-go7007.c     |  484 ++
 drivers/staging/go7007/snd-go7007.c         |  305 +
 drivers/staging/go7007/wis-i2c.h            |   55 +
 drivers/staging/go7007/wis-ov7640.c         |  130 +
 drivers/staging/go7007/wis-saa7113.c        |  358 +
 drivers/staging/go7007/wis-saa7115.c        |  491 ++
 drivers/staging/go7007/wis-sony-tuner.c     |  742 ++
 drivers/staging/go7007/wis-tw2804.c         |  380 +
 drivers/staging/go7007/wis-tw9903.c         |  362 +
 drivers/staging/go7007/wis-uda1342.c        |  136 +
 drivers/staging/me4000/Kconfig              |   10 +
 drivers/staging/me4000/Makefile             |    1 +
 drivers/staging/me4000/README               |   13 +
 drivers/staging/me4000/me4000.c             | 6133 ++++++++++++++++
 drivers/staging/me4000/me4000.h             |  954 +++
 drivers/staging/me4000/me4000_firmware.h    |10033 +++++++++++++++++++++++++++
 drivers/staging/me4000/me4610_firmware.h    | 5409 +++++++++++++++
 drivers/staging/slicoss/Kconfig             |   14 +
 drivers/staging/slicoss/Makefile            |    1 +
 drivers/staging/slicoss/README              |   19 +
 drivers/staging/slicoss/gbdownload.h        | 8215 ++++++++++++++++++++++
 drivers/staging/slicoss/gbrcvucode.h        |  238 +
 drivers/staging/slicoss/oasisdbgdownload.h  | 6850 ++++++++++++++++++
 drivers/staging/slicoss/oasisdownload.h     | 6848 ++++++++++++++++++
 drivers/staging/slicoss/oasisrcvucode.h     |  205 +
 drivers/staging/slicoss/slic.h              |  598 ++
 drivers/staging/slicoss/slic_os.h           |   84 +
 drivers/staging/slicoss/slicbuild.h         |   96 +
 drivers/staging/slicoss/slicdbg.h           |  100 +
 drivers/staging/slicoss/slicdump.h          |  278 +
 drivers/staging/slicoss/slichw.h            |  845 +++
 drivers/staging/slicoss/slicinc.h           |  185 +
 drivers/staging/slicoss/slicoss.c           | 5936 ++++++++++++++++
 drivers/staging/sxg/Kconfig                 |   10 +
 drivers/staging/sxg/Makefile                |    1 +
 drivers/staging/sxg/README                  |   13 +
 drivers/staging/sxg/saharadbgdownload.h     | 4854 +++++++++++++
 drivers/staging/sxg/sxg.c                   | 3624 ++++++++++
 drivers/staging/sxg/sxg.h                   |  773 +++
 drivers/staging/sxg/sxg_os.h                |  154 +
 drivers/staging/sxg/sxgdbg.h                |  190 +
 drivers/staging/sxg/sxghif.h                |  861 +++
 drivers/staging/sxg/sxghw.h                 |  734 ++
 drivers/staging/sxg/sxgphycode.h            |  349 +
 drivers/staging/usbip/Kconfig               |   36 +
 drivers/staging/usbip/Makefile              |   12 +
 drivers/staging/usbip/README                |    6 +
 drivers/staging/usbip/stub.h                |   95 +
 drivers/staging/usbip/stub_dev.c            |  483 ++
 drivers/staging/usbip/stub_main.c           |  300 +
 drivers/staging/usbip/stub_rx.c             |  615 ++
 drivers/staging/usbip/stub_tx.c             |  371 +
 drivers/staging/usbip/usbip_common.c        |  997 +++
 drivers/staging/usbip/usbip_common.h        |  406 ++
 drivers/staging/usbip/usbip_event.c         |  141 +
 drivers/staging/usbip/vhci.h                |  142 +
 drivers/staging/usbip/vhci_hcd.c            | 1275 ++++
 drivers/staging/usbip/vhci_rx.c             |  251 +
 drivers/staging/usbip/vhci_sysfs.c          |  250 +
 drivers/staging/usbip/vhci_tx.c             |  239 +
 drivers/staging/winbond/Kconfig             |    7 +
 drivers/staging/winbond/Makefile            |   18 +
 drivers/staging/winbond/README              |   10 +
 drivers/staging/winbond/adapter.h           |   23 +
 drivers/staging/winbond/bss_f.h             |   59 +
 drivers/staging/winbond/bssdscpt.h          |  156 +
 drivers/staging/winbond/ds_tkip.h           |   33 +
 drivers/staging/winbond/gl_80211.h          |  125 +
 drivers/staging/winbond/ioctls.h            |  678 ++
 drivers/staging/winbond/linux/common.h      |  143 +
 drivers/staging/winbond/linux/sysdef.h      |   73 +
 drivers/staging/winbond/linux/wb35reg.c     |  747 ++
 drivers/staging/winbond/linux/wb35reg_f.h   |   56 +
 drivers/staging/winbond/linux/wb35reg_s.h   |  170 +
 drivers/staging/winbond/linux/wb35rx.c      |  337 +
 drivers/staging/winbond/linux/wb35rx_f.h    |   17 +
 drivers/staging/winbond/linux/wb35rx_s.h    |   48 +
 drivers/staging/winbond/linux/wb35tx.c      |  313 +
 drivers/staging/winbond/linux/wb35tx_f.h    |   20 +
 drivers/staging/winbond/linux/wb35tx_s.h    |   47 +
 drivers/staging/winbond/linux/wbusb.c       |  404 ++
 drivers/staging/winbond/linux/wbusb_f.h     |   34 +
 drivers/staging/winbond/linux/wbusb_s.h     |   42 +
 drivers/staging/winbond/localpara.h         |  275 +
 drivers/staging/winbond/mac_structures.h    |  670 ++
 drivers/staging/winbond/mds.c               |  630 ++
 drivers/staging/winbond/mds_f.h             |   33 +
 drivers/staging/winbond/mds_s.h             |  183 +
 drivers/staging/winbond/mlme_mib.h          |   84 +
 drivers/staging/winbond/mlme_s.h            |  195 +
 drivers/staging/winbond/mlmetxrx.c          |  150 +
 drivers/staging/winbond/mlmetxrx_f.h        |   52 +
 drivers/staging/winbond/mto.c               | 1229 ++++
 drivers/staging/winbond/mto.h               |  265 +
 drivers/staging/winbond/mto_f.h             |    7 +
 drivers/staging/winbond/os_common.h         |    2 +
 drivers/staging/winbond/phy_calibration.c   | 1759 +++++
 drivers/staging/winbond/phy_calibration.h   |  101 +
 drivers/staging/winbond/reg.c               | 2683 +++++++
 drivers/staging/winbond/rxisr.c             |   30 +
 drivers/staging/winbond/scan_s.h            |  115 +
 drivers/staging/winbond/sme_api.c           |   13 +
 drivers/staging/winbond/sme_api.h           |  265 +
 drivers/staging/winbond/sme_s.h             |  228 +
 drivers/staging/winbond/wb35_ver.h          |   30 +
 drivers/staging/winbond/wbhal.c             |  878 +++
 drivers/staging/winbond/wbhal_f.h           |  122 +
 drivers/staging/winbond/wbhal_s.h           |  615 ++
 drivers/staging/winbond/wblinux.c           |  277 +
 drivers/staging/winbond/wblinux_f.h         |   23 +
 drivers/staging/winbond/wblinux_s.h         |   45 +
 drivers/staging/wlan-ng/Kconfig             |   10 +
 drivers/staging/wlan-ng/Makefile            |    9 +
 drivers/staging/wlan-ng/README              |    8 +
 drivers/staging/wlan-ng/hfa384x.c           | 4018 +++++++++++
 drivers/staging/wlan-ng/hfa384x.h           | 3067 ++++++++
 drivers/staging/wlan-ng/hfa384x_usb.c       | 5027 ++++++++++++++
 drivers/staging/wlan-ng/p80211conv.c        |  683 ++
 drivers/staging/wlan-ng/p80211conv.h        |  186 +
 drivers/staging/wlan-ng/p80211hdr.h         |  299 +
 drivers/staging/wlan-ng/p80211ioctl.h       |  123 +
 drivers/staging/wlan-ng/p80211meta.h        |  169 +
 drivers/staging/wlan-ng/p80211metadef.h     | 2524 +++++++
 drivers/staging/wlan-ng/p80211metamib.h     |  105 +
 drivers/staging/wlan-ng/p80211metamsg.h     |  105 +
 drivers/staging/wlan-ng/p80211metastruct.h  |  644 ++
 drivers/staging/wlan-ng/p80211mgmt.h        |  575 ++
 drivers/staging/wlan-ng/p80211mod.c         |  216 +
 drivers/staging/wlan-ng/p80211msg.h         |  102 +
 drivers/staging/wlan-ng/p80211netdev.c      | 1502 ++++
 drivers/staging/wlan-ng/p80211netdev.h      |  336 +
 drivers/staging/wlan-ng/p80211req.c         |  329 +
 drivers/staging/wlan-ng/p80211req.h         |   68 +
 drivers/staging/wlan-ng/p80211types.h       |  675 ++
 drivers/staging/wlan-ng/p80211wep.c         |  317 +
 drivers/staging/wlan-ng/p80211wext.c        | 2048 ++++++
 drivers/staging/wlan-ng/prism2_cs.c         | 1487 ++++
 drivers/staging/wlan-ng/prism2_pci.c        |  332 +
 drivers/staging/wlan-ng/prism2_plx.c        |  472 ++
 drivers/staging/wlan-ng/prism2_usb.c        |  361 +
 drivers/staging/wlan-ng/prism2mgmt.c        | 2956 ++++++++
 drivers/staging/wlan-ng/prism2mgmt.h        |  182 +
 drivers/staging/wlan-ng/prism2mib.c         | 3799 ++++++++++
 drivers/staging/wlan-ng/prism2sta.c         | 2502 +++++++
 drivers/staging/wlan-ng/version.h           |   64 +
 drivers/staging/wlan-ng/wlan_compat.h       |  757 ++
 include/linux/kernel.h                      |    1 +
 kernel/module.c                             |   11 +
 kernel/panic.c                              |    6 +-
 scripts/mod/modpost.c                       |    9 +
 205 files changed, 146209 insertions(+), 2 deletions(-)
 create mode 100644 drivers/staging/Kconfig
 create mode 100644 drivers/staging/Makefile
 create mode 100644 drivers/staging/echo/Kconfig
 create mode 100644 drivers/staging/echo/Makefile
 create mode 100644 drivers/staging/echo/TODO
 create mode 100644 drivers/staging/echo/bit_operations.h
 create mode 100644 drivers/staging/echo/echo.c
 create mode 100644 drivers/staging/echo/echo.h
 create mode 100644 drivers/staging/echo/fir.h
 create mode 100644 drivers/staging/echo/mmx.h
 create mode 100644 drivers/staging/et131x/Kconfig
 create mode 100644 drivers/staging/et131x/Makefile
 create mode 100644 drivers/staging/et131x/README
 create mode 100644 drivers/staging/et131x/et1310_address_map.h
 create mode 100644 drivers/staging/et131x/et1310_eeprom.c
 create mode 100644 drivers/staging/et131x/et1310_eeprom.h
 create mode 100644 drivers/staging/et131x/et1310_jagcore.c
 create mode 100644 drivers/staging/et131x/et1310_jagcore.h
 create mode 100644 drivers/staging/et131x/et1310_mac.c
 create mode 100644 drivers/staging/et131x/et1310_mac.h
 create mode 100644 drivers/staging/et131x/et1310_phy.c
 create mode 100644 drivers/staging/et131x/et1310_phy.h
 create mode 100644 drivers/staging/et131x/et1310_pm.c
 create mode 100644 drivers/staging/et131x/et1310_pm.h
 create mode 100644 drivers/staging/et131x/et1310_rx.c
 create mode 100644 drivers/staging/et131x/et1310_rx.h
 create mode 100644 drivers/staging/et131x/et1310_tx.c
 create mode 100644 drivers/staging/et131x/et1310_tx.h
 create mode 100644 drivers/staging/et131x/et131x_adapter.h
 create mode 100644 drivers/staging/et131x/et131x_config.c
 create mode 100644 drivers/staging/et131x/et131x_config.h
 create mode 100644 drivers/staging/et131x/et131x_debug.c
 create mode 100644 drivers/staging/et131x/et131x_debug.h
 create mode 100644 drivers/staging/et131x/et131x_defs.h
 create mode 100644 drivers/staging/et131x/et131x_initpci.c
 create mode 100644 drivers/staging/et131x/et131x_initpci.h
 create mode 100644 drivers/staging/et131x/et131x_isr.c
 create mode 100644 drivers/staging/et131x/et131x_isr.h
 create mode 100644 drivers/staging/et131x/et131x_netdev.c
 create mode 100644 drivers/staging/et131x/et131x_netdev.h
 create mode 100644 drivers/staging/et131x/et131x_version.h
 create mode 100644 drivers/staging/go7007/Kconfig
 create mode 100644 drivers/staging/go7007/Makefile
 create mode 100644 drivers/staging/go7007/README
 create mode 100644 drivers/staging/go7007/go7007-driver.c
 create mode 100644 drivers/staging/go7007/go7007-fw.c
 create mode 100644 drivers/staging/go7007/go7007-i2c.c
 create mode 100644 drivers/staging/go7007/go7007-priv.h
 create mode 100644 drivers/staging/go7007/go7007-usb.c
 create mode 100644 drivers/staging/go7007/go7007-v4l2.c
 create mode 100644 drivers/staging/go7007/go7007.h
 create mode 100644 drivers/staging/go7007/saa7134-go7007.c
 create mode 100644 drivers/staging/go7007/snd-go7007.c
 create mode 100644 drivers/staging/go7007/wis-i2c.h
 create mode 100644 drivers/staging/go7007/wis-ov7640.c
 create mode 100644 drivers/staging/go7007/wis-saa7113.c
 create mode 100644 drivers/staging/go7007/wis-saa7115.c
 create mode 100644 drivers/staging/go7007/wis-sony-tuner.c
 create mode 100644 drivers/staging/go7007/wis-tw2804.c
 create mode 100644 drivers/staging/go7007/wis-tw9903.c
 create mode 100644 drivers/staging/go7007/wis-uda1342.c
 create mode 100644 drivers/staging/me4000/Kconfig
 create mode 100644 drivers/staging/me4000/Makefile
 create mode 100644 drivers/staging/me4000/README
 create mode 100644 drivers/staging/me4000/me4000.c
 create mode 100644 drivers/staging/me4000/me4000.h
 create mode 100644 drivers/staging/me4000/me4000_firmware.h
 create mode 100644 drivers/staging/me4000/me4610_firmware.h
 create mode 100644 drivers/staging/slicoss/Kconfig
 create mode 100644 drivers/staging/slicoss/Makefile
 create mode 100644 drivers/staging/slicoss/README
 create mode 100644 drivers/staging/slicoss/gbdownload.h
 create mode 100644 drivers/staging/slicoss/gbrcvucode.h
 create mode 100644 drivers/staging/slicoss/oasisdbgdownload.h
 create mode 100644 drivers/staging/slicoss/oasisdownload.h
 create mode 100644 drivers/staging/slicoss/oasisrcvucode.h
 create mode 100644 drivers/staging/slicoss/slic.h
 create mode 100644 drivers/staging/slicoss/slic_os.h
 create mode 100644 drivers/staging/slicoss/slicbuild.h
 create mode 100644 drivers/staging/slicoss/slicdbg.h
 create mode 100644 drivers/staging/slicoss/slicdump.h
 create mode 100644 drivers/staging/slicoss/slichw.h
 create mode 100644 drivers/staging/slicoss/slicinc.h
 create mode 100644 drivers/staging/slicoss/slicoss.c
 create mode 100644 drivers/staging/sxg/Kconfig
 create mode 100644 drivers/staging/sxg/Makefile
 create mode 100644 drivers/staging/sxg/README
 create mode 100644 drivers/staging/sxg/saharadbgdownload.h
 create mode 100644 drivers/staging/sxg/sxg.c
 create mode 100644 drivers/staging/sxg/sxg.h
 create mode 100644 drivers/staging/sxg/sxg_os.h
 create mode 100644 drivers/staging/sxg/sxgdbg.h
 create mode 100644 drivers/staging/sxg/sxghif.h
 create mode 100644 drivers/staging/sxg/sxghw.h
 create mode 100644 drivers/staging/sxg/sxgphycode.h
 create mode 100644 drivers/staging/usbip/Kconfig
 create mode 100644 drivers/staging/usbip/Makefile
 create mode 100644 drivers/staging/usbip/README
 create mode 100644 drivers/staging/usbip/stub.h
 create mode 100644 drivers/staging/usbip/stub_dev.c
 create mode 100644 drivers/staging/usbip/stub_main.c
 create mode 100644 drivers/staging/usbip/stub_rx.c
 create mode 100644 drivers/staging/usbip/stub_tx.c
 create mode 100644 drivers/staging/usbip/usbip_common.c
 create mode 100644 drivers/staging/usbip/usbip_common.h
 create mode 100644 drivers/staging/usbip/usbip_event.c
 create mode 100644 drivers/staging/usbip/vhci.h
 create mode 100644 drivers/staging/usbip/vhci_hcd.c
 create mode 100644 drivers/staging/usbip/vhci_rx.c
 create mode 100644 drivers/staging/usbip/vhci_sysfs.c
 create mode 100644 drivers/staging/usbip/vhci_tx.c
 create mode 100644 drivers/staging/winbond/Kconfig
 create mode 100644 drivers/staging/winbond/Makefile
 create mode 100644 drivers/staging/winbond/README
 create mode 100644 drivers/staging/winbond/adapter.h
 create mode 100644 drivers/staging/winbond/bss_f.h
 create mode 100644 drivers/staging/winbond/bssdscpt.h
 create mode 100644 drivers/staging/winbond/ds_tkip.h
 create mode 100644 drivers/staging/winbond/gl_80211.h
 create mode 100644 drivers/staging/winbond/ioctls.h
 create mode 100644 drivers/staging/winbond/linux/common.h
 create mode 100644 drivers/staging/winbond/linux/sysdef.h
 create mode 100644 drivers/staging/winbond/linux/wb35reg.c
 create mode 100644 drivers/staging/winbond/linux/wb35reg_f.h
 create mode 100644 drivers/staging/winbond/linux/wb35reg_s.h
 create mode 100644 drivers/staging/winbond/linux/wb35rx.c
 create mode 100644 drivers/staging/winbond/linux/wb35rx_f.h
 create mode 100644 drivers/staging/winbond/linux/wb35rx_s.h
 create mode 100644 drivers/staging/winbond/linux/wb35tx.c
 create mode 100644 drivers/staging/winbond/linux/wb35tx_f.h
 create mode 100644 drivers/staging/winbond/linux/wb35tx_s.h
 create mode 100644 drivers/staging/winbond/linux/wbusb.c
 create mode 100644 drivers/staging/winbond/linux/wbusb_f.h
 create mode 100644 drivers/staging/winbond/linux/wbusb_s.h
 create mode 100644 drivers/staging/winbond/localpara.h
 create mode 100644 drivers/staging/winbond/mac_structures.h
 create mode 100644 drivers/staging/winbond/mds.c
 create mode 100644 drivers/staging/winbond/mds_f.h
 create mode 100644 drivers/staging/winbond/mds_s.h
 create mode 100644 drivers/staging/winbond/mlme_mib.h
 create mode 100644 drivers/staging/winbond/mlme_s.h
 create mode 100644 drivers/staging/winbond/mlmetxrx.c
 create mode 100644 drivers/staging/winbond/mlmetxrx_f.h
 create mode 100644 drivers/staging/winbond/mto.c
 create mode 100644 drivers/staging/winbond/mto.h
 create mode 100644 drivers/staging/winbond/mto_f.h
 create mode 100644 drivers/staging/winbond/os_common.h
 create mode 100644 drivers/staging/winbond/phy_calibration.c
 create mode 100644 drivers/staging/winbond/phy_calibration.h
 create mode 100644 drivers/staging/winbond/reg.c
 create mode 100644 drivers/staging/winbond/rxisr.c
 create mode 100644 drivers/staging/winbond/scan_s.h
 create mode 100644 drivers/staging/winbond/sme_api.c
 create mode 100644 drivers/staging/winbond/sme_api.h
 create mode 100644 drivers/staging/winbond/sme_s.h
 create mode 100644 drivers/staging/winbond/wb35_ver.h
 create mode 100644 drivers/staging/winbond/wbhal.c
 create mode 100644 drivers/staging/winbond/wbhal_f.h
 create mode 100644 drivers/staging/winbond/wbhal_s.h
 create mode 100644 drivers/staging/winbond/wblinux.c
 create mode 100644 drivers/staging/winbond/wblinux_f.h
 create mode 100644 drivers/staging/winbond/wblinux_s.h
 create mode 100644 drivers/staging/wlan-ng/Kconfig
 create mode 100644 drivers/staging/wlan-ng/Makefile
 create mode 100644 drivers/staging/wlan-ng/README
 create mode 100644 drivers/staging/wlan-ng/hfa384x.c
 create mode 100644 drivers/staging/wlan-ng/hfa384x.h
 create mode 100644 drivers/staging/wlan-ng/hfa384x_usb.c
 create mode 100644 drivers/staging/wlan-ng/p80211conv.c
 create mode 100644 drivers/staging/wlan-ng/p80211conv.h
 create mode 100644 drivers/staging/wlan-ng/p80211hdr.h
 create mode 100644 drivers/staging/wlan-ng/p80211ioctl.h
 create mode 100644 drivers/staging/wlan-ng/p80211meta.h
 create mode 100644 drivers/staging/wlan-ng/p80211metadef.h
 create mode 100644 drivers/staging/wlan-ng/p80211metamib.h
 create mode 100644 drivers/staging/wlan-ng/p80211metamsg.h
 create mode 100644 drivers/staging/wlan-ng/p80211metastruct.h
 create mode 100644 drivers/staging/wlan-ng/p80211mgmt.h
 create mode 100644 drivers/staging/wlan-ng/p80211mod.c
 create mode 100644 drivers/staging/wlan-ng/p80211msg.h
 create mode 100644 drivers/staging/wlan-ng/p80211netdev.c
 create mode 100644 drivers/staging/wlan-ng/p80211netdev.h
 create mode 100644 drivers/staging/wlan-ng/p80211req.c
 create mode 100644 drivers/staging/wlan-ng/p80211req.h
 create mode 100644 drivers/staging/wlan-ng/p80211types.h
 create mode 100644 drivers/staging/wlan-ng/p80211wep.c
 create mode 100644 drivers/staging/wlan-ng/p80211wext.c
 create mode 100644 drivers/staging/wlan-ng/prism2_cs.c
 create mode 100644 drivers/staging/wlan-ng/prism2_pci.c
 create mode 100644 drivers/staging/wlan-ng/prism2_plx.c
 create mode 100644 drivers/staging/wlan-ng/prism2_usb.c
 create mode 100644 drivers/staging/wlan-ng/prism2mgmt.c
 create mode 100644 drivers/staging/wlan-ng/prism2mgmt.h
 create mode 100644 drivers/staging/wlan-ng/prism2mib.c
 create mode 100644 drivers/staging/wlan-ng/prism2sta.c
 create mode 100644 drivers/staging/wlan-ng/version.h
 create mode 100644 drivers/staging/wlan-ng/wlan_compat.h

---------------

David Rowe (1):
Staging: add echo cancelation module

Greg Kroah-Hartman (11):
Staging: add TAINT_CRAP for all drivers/staging code
Staging: add TAINT_CRAP flag to drivers/staging modules
Staging: add Kconfig entries and Makefile infrastructure
Staging: add MAINTAINERS entry
Staging: add et131x network driver
Staging: add Alacritech slicoss network driver
Staging: add sxg network driver
Staging: add me4000 firmware files
Staging: add me4000 pci data collection driver
Staging: add the go7007 video driver
Staging: add wlan-ng prism2 usb driver

J.R. Mauro (2):
Staging: Fix gcc warnings in sxg
Staging: Lindent sxg.c

Lior Dotan (4):
Staging: SLICOSS: lots of checkpatch fixes
Staging: SLICOSS: Fix warnings due to static usage
Staging: SLICOSS: Fix remaining type names
Staging: SLICOSS: Call pci_release_regions at driver exit

Pavel Machek (1):
Staging: add w35und wifi driver

Ross Cohen (1):
Staging: go7007 v4l fixes

Takahiro Hirofuchi (3):
Staging: USB/IP: add common functions needed
Staging: USB/IP: add client driver
Staging: USB/IP: add host driver

author
#1 lore raw

PATCH 1/23 Staging: add TAINT_CRAP for all drivers/staging code

From: Greg Kroah-Hartman <[email protected]>

We need to add a flag for all code that is in the drivers/staging/ directory to prevent all other kernel developers from worrying about issues here, and to notify users that the drivers might not be as good as they are normally used to.

Based on code from Andreas Gruenbacher and Jeff Mahoney to provide a TAINT flag for the support level of a kernel module in the Novell enterprise kernel release.

This is the kernel portion of this feature, the ability for the flag to be set needs to be done in the build process and will happen in a follow-up patch.

Cc Andreas Gruenbacher <[email protected]>
Cc Jeff Mahoney <[email protected]>
---
 Documentation/sysctl/kernel.txt |    1 +
 include/linux/kernel.h          |    1 +
 kernel/module.c                 |   11 +++++++++++
 kernel/panic.c                  |    6 ++++--
 4 files changed, 17 insertions(+), 2 deletions(-)
Documentation/sysctl/kernel.txt +1 -0
index e1ff0d9..bde799e 100644
@@ -369,4 +369,5 @@ can be ORed together:
   2 - A module was force loaded by insmod -f.
       Set by modutils >= 2.4.9 and module-init-tools.
   4 - Unsafe SMP processors: SMP with CPUs not designed for SMP.
+ 64 - A module from drivers/staging was loaded.
 
include/linux/kernel.h +1 -0
index 2651f80..b36805c 100644
@@ -260,6 +260,7 @@ extern enum system_states {
 #define TAINT_DIE			(1<<7)
 #define TAINT_OVERRIDDEN_ACPI_TABLE	(1<<8)
 #define TAINT_WARN			(1<<9)
+#define TAINT_CRAP			(1<<10)
 
 extern void dump_stack(void) __cold;
 
kernel/module.c +11 -0
index 9db1191..152b165 100644
@@ -1806,6 +1806,7 @@ static noinline struct module *load_module(void __user *umod,
 	Elf_Ehdr *hdr;
 	Elf_Shdr *sechdrs;
 	char *secstrings, *args, *modmagic, *strtab = NULL;
+	char *staging;
 	unsigned int i;
 	unsigned int symindex = 0;
 	unsigned int strindex = 0;
@@ -1960,6 +1961,14 @@ static noinline struct module *load_module(void __user *umod,
 		goto free_hdr;
 	}
 
+	staging = get_modinfo(sechdrs, infoindex, "staging");
+	if (staging) {
+		add_taint_module(mod, TAINT_CRAP);
+		printk(KERN_WARNING "%s: module is from the staging directory,"
+		       " the quality is unknown, you have been warned.\n",
+		       mod->name);
+	}
+
 	/* Now copy in args */
 	args = strndup_user(uargs, ~0UL >> 1);
 	if (IS_ERR(args)) {
@@ -2556,6 +2565,8 @@ static char *module_flags(struct module *mod, char *buf)
 			buf[bx++] = 'P';
 		if (mod->taints & TAINT_FORCED_MODULE)
 			buf[bx++] = 'F';
+		if (mod->taints & TAINT_CRAP)
+			buf[bx++] = 'C';
 		/*
 		 * TAINT_FORCED_RMMOD: could be added.
 		 * TAINT_UNSAFE_SMP, TAINT_MACHINE_CHECK, TAINT_BAD_PAGE don't
kernel/panic.c +4 -2
index 12c5a0a..98e2047 100644
@@ -155,6 +155,7 @@ EXPORT_SYMBOL(panic);
  *  'U' - Userspace-defined naughtiness.
  *  'A' - ACPI table overridden.
  *  'W' - Taint on warning.
+ *  'C' - modules from drivers/staging are loaded.
  *
  *	The string is overwritten by the next call to print_taint().
  */
@@ -163,7 +164,7 @@ const char *print_tainted(void)
 {
 	static char buf[20];
 	if (tainted) {
-		snprintf(buf, sizeof(buf), "Tainted: %c%c%c%c%c%c%c%c%c%c",
+		snprintf(buf, sizeof(buf), "Tainted: %c%c%c%c%c%c%c%c%c%c%c",
 			tainted & TAINT_PROPRIETARY_MODULE ? 'P' : 'G',
 			tainted & TAINT_FORCED_MODULE ? 'F' : ' ',
 			tainted & TAINT_UNSAFE_SMP ? 'S' : ' ',
@@ -173,7 +174,8 @@ const char *print_tainted(void)
 			tainted & TAINT_USER ? 'U' : ' ',
 			tainted & TAINT_DIE ? 'D' : ' ',
 			tainted & TAINT_OVERRIDDEN_ACPI_TABLE ? 'A' : ' ',
-			tainted & TAINT_WARN ? 'W' : ' ');
+			tainted & TAINT_WARN ? 'W' : ' ',
+			tainted & TAINT_CRAP ? 'C' : ' ');
 	}
 	else
 		snprintf(buf, sizeof(buf), "Not tainted");
Signature · 1 line
1.6.0.2
author
#2 lore raw

PATCH 2/23 Staging: add TAINT_CRAP flag to drivers/staging modules

In reply to Greg KH

From: Greg Kroah-Hartman <[email protected]>

We need to add a flag for all code that is in the drivers/staging/ directory to prevent all other kernel developers from worrying about issues here, and to notify users that the drivers might not be as good as they are normally used to.

Based on code from Andreas Gruenbacher and Jeff Mahoney to provide a TAINT flag for the support level of a kernel module in the Novell enterprise kernel release.

This is the code that actually modifies the modules, adding the flag to any files in the drivers/staging directory.

Cc Andreas Gruenbacher <[email protected]>
Cc Jeff Mahoney <[email protected]>
---
 scripts/mod/modpost.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)
scripts/mod/modpost.c +9 -0
index 8e0de6a..8892161 100644
@@ -1726,6 +1726,14 @@ static void add_header(struct buffer *b, struct module *mod)
 	buf_printf(b, "};\n");
 }
 
+void add_staging_flag(struct buffer *b, const char *name)
+{
+	static const char *staging_dir = "drivers/staging";
+
+	if (strncmp(staging_dir, name, strlen(staging_dir)) == 0)
+		buf_printf(b, "\nMODULE_INFO(staging, \"Y\");\n");
+}
+
 /**
  * Record CRCs for unresolved symbols
  **/
@@ -2135,6 +2143,7 @@ int main(int argc, char **argv)
 		buf.pos = 0;
 
 		add_header(&buf, mod);
+		add_staging_flag(&buf, mod->name);
 		err |= add_versions(&buf, mod);
 		add_depends(&buf, mod, modules);
 		add_moddevtable(&buf, mod);
Signature · 1 line
1.6.0.2
author
#3 lore raw

PATCH 3/23 Staging: add Kconfig entries and Makefile infrastructure

In reply to Greg KH

From: Greg Kroah-Hartman <[email protected]>

This hooks up the drivers/staging directory to the build system

---
 drivers/Kconfig          |    2 ++
 drivers/Makefile         |    1 +
 drivers/staging/Kconfig  |   27 +++++++++++++++++++++++++++
 drivers/staging/Makefile |    2 ++
 4 files changed, 32 insertions(+), 0 deletions(-)
 create mode 100644 drivers/staging/Kconfig
 create mode 100644 drivers/staging/Makefile
drivers/Kconfig +2 -0
index 59f33fa..d19b6f5 100644
@@ -101,4 +101,6 @@ source "drivers/auxdisplay/Kconfig"
 source "drivers/uio/Kconfig"
 
 source "drivers/xen/Kconfig"
+
+source "drivers/staging/Kconfig"
 endmenu
drivers/Makefile +1 -0
index 2735bde..46c8681 100644
@@ -99,3 +99,4 @@ obj-$(CONFIG_OF)		+= of/
 obj-$(CONFIG_SSB)		+= ssb/
 obj-$(CONFIG_VIRTIO)		+= virtio/
 obj-$(CONFIG_REGULATOR)		+= regulator/
+obj-$(CONFIG_STAGING)		+= staging/
drivers/staging/Kconfig new file +27 -0
new file mode 100644
index 0000000..84832fe
@@ -0,0 +1,27 @@
+menuconfig STAGING
+	bool "Staging drivers"
+	default n
+	---help---
+	  This option allows you to select a number of drivers that are
+	  not of the "normal" Linux kernel quality level.  These drivers
+	  are placed here in order to get a wider audience for use of
+	  them.  Please note that these drivers are under heavy
+	  development, may or may not work, and may contain userspace
+	  interfaces that most likely will be changed in the near
+	  future.
+
+	  Using any of these drivers will taint your kernel which might
+	  affect support options from both the community, and various
+	  commercial support orginizations.
+
+	  If you wish to work on these drivers, to help improve them, or
+	  to report problems you have with them, please see the
+	  driver_name.README file in the drivers/staging/ directory to
+	  see what needs to be worked on, and who to contact.
+
+	  If in doubt, say N here.
+
+if STAGING
+
+
+endif # STAGING
drivers/staging/Makefile new file +2 -0
new file mode 100644
index 0000000..ceb0328
@@ -0,0 +1,2 @@
+# Makefile for staging directory
+
Signature · 1 line
1.6.0.2
author
#4 lore raw

PATCH 4/23 Staging: add MAINTAINERS entry

In reply to Greg KH

From: Greg Kroah-Hartman <[email protected]>

Someone has to claim this mess, might as well let everyone know who to blame.

---
 MAINTAINERS |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)
MAINTAINERS +7 -0
index 7a03bd5..ea6b478 100644
@@ -3863,6 +3863,13 @@ M:	[email protected]
 L:	[email protected]
 S:	Maintained
 
+STAGING SUBSYSTEM:
+P:	Greg Kroah-Hartman
+M:	[email protected]
+L:	[email protected]
+T:	quilt kernel.org/pub/linux/kernel/people/gregkh/gregkh-2.6/
+S:	Maintained
+
 SHARP LH SUPPORT (LH7952X & LH7A40X)
 P:	Marc Singer
 M:	[email protected]
Signature · 1 line
1.6.0.2
author
#5 lore raw

PATCH 5/23 Staging: add et131x network driver

In reply to Greg KH

From: Greg Kroah-Hartman <[email protected]>

This is a driver for the ET1310 network device.

Based on the driver found at https://sourceforge.net/projects/et131x/

Cleaned up immensely by Olaf Hartman <[email protected]> and Christoph Hellwig <[email protected]>

Note, the powermanagement options were removed from the vendor provided driver as they did not build properly at the time.

TODO:
- kernel coding style cleanups
- forward port for latest network driver changes
- kill useless typecasts (e.g. in et1310_phy.c)
- alloc_etherdev is initializing memory with zero?!?
- add_timer call in et131x_netdev.c is correct?
- Add power saving functionality (suspend, sleep, resume)
- Implement a few more kernel Parameter (set mac )

Cc Olaf Hartmann <[email protected]>
Cc Christoph Hellwig <[email protected]>
Cc Dean Adams <[email protected]>
Cc Victor Soriano <[email protected]>
Cc Andre-Sebastian Liebe <[email protected]>
---
 drivers/staging/Kconfig                     |    1 +
 drivers/staging/Makefile                    |    1 +
 drivers/staging/et131x/Kconfig              |   18 +
 drivers/staging/et131x/Makefile             |   18 +
 drivers/staging/et131x/README               |   25 +
 drivers/staging/et131x/et1310_address_map.h | 2399 +++++++++++++++++++++++++++
 drivers/staging/et131x/et1310_eeprom.c      |  480 ++++++
 drivers/staging/et131x/et1310_eeprom.h      |   89 +
 drivers/staging/et131x/et1310_jagcore.c     |  220 +++
 drivers/staging/et131x/et1310_jagcore.h     |  112 ++
 drivers/staging/et131x/et1310_mac.c         |  792 +++++++++
 drivers/staging/et131x/et1310_mac.h         |   93 +
 drivers/staging/et131x/et1310_phy.c         | 1281 ++++++++++++++
 drivers/staging/et131x/et1310_phy.h         |  910 ++++++++++
 drivers/staging/et131x/et1310_pm.c          |  207 +++
 drivers/staging/et131x/et1310_pm.h          |  125 ++
 drivers/staging/et131x/et1310_rx.c          | 1391 ++++++++++++++++
 drivers/staging/et131x/et1310_rx.h          |  373 +++++
 drivers/staging/et131x/et1310_tx.c          | 1525 +++++++++++++++++
 drivers/staging/et131x/et1310_tx.h          |  242 +++
 drivers/staging/et131x/et131x_adapter.h     |  347 ++++
 drivers/staging/et131x/et131x_config.c      |  325 ++++
 drivers/staging/et131x/et131x_config.h      |   67 +
 drivers/staging/et131x/et131x_debug.c       |  218 +++
 drivers/staging/et131x/et131x_debug.h       |  201 +++
 drivers/staging/et131x/et131x_defs.h        |  128 ++
 drivers/staging/et131x/et131x_initpci.c     | 1046 ++++++++++++
 drivers/staging/et131x/et131x_initpci.h     |   73 +
 drivers/staging/et131x/et131x_isr.c         |  488 ++++++
 drivers/staging/et131x/et131x_isr.h         |   65 +
 drivers/staging/et131x/et131x_netdev.c      |  856 ++++++++++
 drivers/staging/et131x/et131x_netdev.h      |   64 +
 drivers/staging/et131x/et131x_version.h     |   81 +
 33 files changed, 14261 insertions(+), 0 deletions(-)
 create mode 100644 drivers/staging/et131x/Kconfig
 create mode 100644 drivers/staging/et131x/Makefile
 create mode 100644 drivers/staging/et131x/README
 create mode 100644 drivers/staging/et131x/et1310_address_map.h
 create mode 100644 drivers/staging/et131x/et1310_eeprom.c
 create mode 100644 drivers/staging/et131x/et1310_eeprom.h
 create mode 100644 drivers/staging/et131x/et1310_jagcore.c
 create mode 100644 drivers/staging/et131x/et1310_jagcore.h
 create mode 100644 drivers/staging/et131x/et1310_mac.c
 create mode 100644 drivers/staging/et131x/et1310_mac.h
 create mode 100644 drivers/staging/et131x/et1310_phy.c
 create mode 100644 drivers/staging/et131x/et1310_phy.h
 create mode 100644 drivers/staging/et131x/et1310_pm.c
 create mode 100644 drivers/staging/et131x/et1310_pm.h
 create mode 100644 drivers/staging/et131x/et1310_rx.c
 create mode 100644 drivers/staging/et131x/et1310_rx.h
 create mode 100644 drivers/staging/et131x/et1310_tx.c
 create mode 100644 drivers/staging/et131x/et1310_tx.h
 create mode 100644 drivers/staging/et131x/et131x_adapter.h
 create mode 100644 drivers/staging/et131x/et131x_config.c
 create mode 100644 drivers/staging/et131x/et131x_config.h
 create mode 100644 drivers/staging/et131x/et131x_debug.c
 create mode 100644 drivers/staging/et131x/et131x_debug.h
 create mode 100644 drivers/staging/et131x/et131x_defs.h
 create mode 100644 drivers/staging/et131x/et131x_initpci.c
 create mode 100644 drivers/staging/et131x/et131x_initpci.h
 create mode 100644 drivers/staging/et131x/et131x_isr.c
 create mode 100644 drivers/staging/et131x/et131x_isr.h
 create mode 100644 drivers/staging/et131x/et131x_netdev.c
 create mode 100644 drivers/staging/et131x/et131x_netdev.h
 create mode 100644 drivers/staging/et131x/et131x_version.h
drivers/staging/Kconfig +1 -0
index 84832fe..4c3789d 100644
@@ -23,5 +23,6 @@ menuconfig STAGING
 
 if STAGING
 
+source "drivers/staging/et131x/Kconfig"
 
 endif # STAGING
drivers/staging/Makefile +1 -0
index ceb0328..933b984 100644
@@ -1,2 +1,3 @@
 # Makefile for staging directory
 
+obj-$(CONFIG_ET131X)		+= et131x/
drivers/staging/et131x/Kconfig new file +18 -0
new file mode 100644
index 0000000..e11cf34
@@ -0,0 +1,18 @@
+config ET131X
+	tristate "Agere ET-1310 Gigabit Ethernet support"
+	depends on NETDEV_1000 && PCI
+	default n
+	---help---
+	  This driver supports Agere ET-1310 ethernet adapters.
+
+	  To compile this driver as a module, choose M here. The module
+	  will be called et131x.
+
+config ET131X_DEBUG
+	bool "Enable et131x debugging"
+	depends on ET131X
+	default n
+	---help---
+	  Say Y for detailed debug information.
+
+	  If in doubt, say N.
drivers/staging/et131x/Makefile new file +18 -0
new file mode 100644
index 0000000..3ad571d
@@ -0,0 +1,18 @@
+#
+# Makefile for the Agere ET-131x ethernet driver
+#
+
+obj-$(CONFIG_ET131X) += et131x.o
+
+et131x-objs :=	et1310_eeprom.o \
+		et1310_jagcore.o \
+		et1310_mac.o \
+		et1310_phy.o \
+		et1310_pm.o \
+		et1310_rx.o \
+		et1310_tx.o \
+		et131x_config.o \
+		et131x_debug.o \
+		et131x_initpci.o \
+		et131x_isr.o \
+		et131x_netdev.o
drivers/staging/et131x/README new file +25 -0
new file mode 100644
index 0000000..28752a5
@@ -0,0 +1,25 @@
+This is a driver for the ET1310 network device.
+
+Based on the driver found at https://sourceforge.net/projects/et131x/
+
+Cleaned up immensely by Olaf Hartman <[email protected]> and Christoph
+Hellwig <[email protected]>
+
+Note, the powermanagement options were removed from the vendor provided
+driver as they did not build properly at the time.
+
+TODO:
+	- kernel coding style cleanups
+	- forward port for latest network driver changes
+	- kill useless typecasts (e.g. in et1310_phy.c)
+	- alloc_etherdev is initializing memory with zero?!?
+	- add_timer call in et131x_netdev.c is correct?
+	- Add power saving functionality (suspend, sleep, resume)
+	- Implement a few more kernel Parameter (set mac )
+
+Please send patches to:
+	Greg Kroah-Hartman <[email protected]>
+
+And Cc: Olaf Hartmann <[email protected]> as he has this device and can
+test any changes.
+
drivers/staging/et131x/et1310_address_map.h new file +2399 -0

2,399 lines not on this page · raw message

drivers/staging/et131x/et1310_eeprom.c new file +480 -0

480 lines not on this page · raw message

drivers/staging/et131x/et1310_eeprom.h new file +89 -0

51 lines not on this page · raw message

drivers/staging/et131x/et1310_jagcore.c new file +220 -0

220 lines not on this page · raw message

drivers/staging/et131x/et1310_jagcore.h new file +112 -0

112 lines not on this page · raw message

drivers/staging/et131x/et1310_mac.c new file +792 -0

792 lines not on this page · raw message

drivers/staging/et131x/et1310_mac.h new file +93 -0

93 lines not on this page · raw message

drivers/staging/et131x/et1310_phy.c new file +1281 -0

1,281 lines not on this page · raw message

drivers/staging/et131x/et1310_phy.h new file +910 -0

910 lines not on this page · raw message

drivers/staging/et131x/et1310_pm.c new file +207 -0

207 lines not on this page · raw message

drivers/staging/et131x/et1310_pm.h new file +125 -0

125 lines not on this page · raw message

drivers/staging/et131x/et1310_rx.c new file +1391 -0

1,391 lines not on this page · raw message

drivers/staging/et131x/et1310_rx.h new file +373 -0

373 lines not on this page · raw message

drivers/staging/et131x/et1310_tx.c new file +1525 -0

1,525 lines not on this page · raw message

drivers/staging/et131x/et1310_tx.h new file +242 -0

242 lines not on this page · raw message

drivers/staging/et131x/et131x_adapter.h new file +347 -0

347 lines not on this page · raw message

drivers/staging/et131x/et131x_config.c new file +325 -0

325 lines not on this page · raw message

drivers/staging/et131x/et131x_config.h new file +67 -0

67 lines not on this page · raw message

drivers/staging/et131x/et131x_debug.c new file +218 -0

218 lines not on this page · raw message

drivers/staging/et131x/et131x_debug.h new file +201 -0

201 lines not on this page · raw message

drivers/staging/et131x/et131x_defs.h new file +128 -0

128 lines not on this page · raw message

drivers/staging/et131x/et131x_initpci.c new file +1046 -0

1,046 lines not on this page · raw message

drivers/staging/et131x/et131x_initpci.h new file +73 -0

73 lines not on this page · raw message

drivers/staging/et131x/et131x_isr.c new file +488 -0

488 lines not on this page · raw message

drivers/staging/et131x/et131x_isr.h new file +65 -0

65 lines not on this page · raw message

drivers/staging/et131x/et131x_netdev.c new file +856 -0

856 lines not on this page · raw message

drivers/staging/et131x/et131x_netdev.h new file +64 -0

64 lines not on this page · raw message

drivers/staging/et131x/et131x_version.h new file +81 -0

81 lines not on this page · raw message

The rest of this diff is not shown. View the raw message.

Signature · 1 line
1.6.0.2

Part of the diff is not shown here. View the raw message.

author
#6 lore raw

PATCH 9/23 Staging: add me4000 pci data collection driver

In reply to Greg KH

From: Greg Kroah-Hartman <[email protected]>

Originally written by Guenter Gebhardt <[email protected]>

TODO:
- checkpatch.pl cleanups
- sparse cleanups
- possible /proc interaction cleanups
- more info needed for Kconfig entry
- real device id?
- module parameter cleanup

Cc Wolfgang Beiter <[email protected]>
Cc Guenter Gebhardt <[email protected]>
---
 drivers/staging/Kconfig         |    2 +
 drivers/staging/Makefile        |    1 +
 drivers/staging/me4000/Kconfig  |   10 +
 drivers/staging/me4000/Makefile |    1 +
 drivers/staging/me4000/README   |   13 +
 drivers/staging/me4000/me4000.c | 6133 +++++++++++++++++++++++++++++++++++++++
 drivers/staging/me4000/me4000.h |  954 ++++++
 7 files changed, 7114 insertions(+), 0 deletions(-)
 create mode 100644 drivers/staging/me4000/Kconfig
 create mode 100644 drivers/staging/me4000/Makefile
 create mode 100644 drivers/staging/me4000/README
 create mode 100644 drivers/staging/me4000/me4000.c
 create mode 100644 drivers/staging/me4000/me4000.h
drivers/staging/Kconfig +2 -0
index 6da7662..56c73bc 100644
@@ -29,4 +29,6 @@ source "drivers/staging/slicoss/Kconfig"
 
 source "drivers/staging/sxg/Kconfig"
 
+source "drivers/staging/me4000/Kconfig"
+
 endif # STAGING
drivers/staging/Makefile +1 -0
index cd6d6a5..97df19b 100644
@@ -3,3 +3,4 @@
 obj-$(CONFIG_ET131X)		+= et131x/
 obj-$(CONFIG_SLICOSS)		+= slicoss/
 obj-$(CONFIG_SXG)		+= sxg/
+obj-$(CONFIG_ME4000)		+= me4000/
drivers/staging/me4000/Kconfig new file +10 -0
new file mode 100644
index 0000000..5e6c9de
@@ -0,0 +1,10 @@
+config ME4000
+	tristate "Meilhaus ME-4000 support"
+	default n
+	depends on PCI
+	help
+	  This driver supports the Meilhaus ME-4000 family of boards
+	  that do data collection and multipurpose I/O.
+
+	  To compile this driver as a module, choose M here: the module
+	  will be called me4000.
drivers/staging/me4000/Makefile new file +1 -0
new file mode 100644
index 0000000..74487cd
@@ -0,0 +1 @@
+obj-$(CONFIG_ME4000)		+= me4000.o
drivers/staging/me4000/README new file +13 -0
new file mode 100644
index 0000000..bbb8386
@@ -0,0 +1,13 @@
+
+TODO:
+	- checkpatch.pl cleanups
+	- sparse cleanups
+	- possible /proc interaction cleanups
+	- more info needed for Kconfig entry
+	- real device id?
+	- module parameter cleanup
+
+Please send patches to Greg Kroah-Hartman <[email protected]>
+and Cc: Wolfgang Beiter <[email protected]> and
+Guenter Gebhardt <[email protected]>
+
drivers/staging/me4000/me4000.c new file +6133 -0

2,966 lines not on this page · raw message

drivers/staging/me4000/me4000.h new file +954 -0

954 lines not on this page · raw message

The rest of this diff is not shown. View the raw message.

Signature · 1 line
1.6.0.2

Part of the diff is not shown here. View the raw message.

#7 lore raw

Re: [PATCH 09/23] Staging: add me4000 pci data collection driver

Quoted 5 lines · On Fri, 10 Oct 2008 15:42:33 -0700 Greg KH <[email protected]> wrote:

From: Greg Kroah-Hartman <[email protected]>

Originally written by Guenter Gebhardt <[email protected]>

Quoted 7 lines

TODO:
- checkpatch.pl cleanups
- sparse cleanups
- possible /proc interaction cleanups
- more info needed for Kconfig entry
- real device id?
- module parameter cleanup

- sort includes (include/linux before asm/)

- Make me4000_board_info_list static

Quoted 119 lines
Cc Wolfgang Beiter <[email protected]>
Cc Guenter Gebhardt <[email protected]>
---
 drivers/staging/Kconfig         |    2 +
 drivers/staging/Makefile        |    1 +
 drivers/staging/me4000/Kconfig  |   10 +
 drivers/staging/me4000/Makefile |    1 +
 drivers/staging/me4000/README   |   13 +
 drivers/staging/me4000/me4000.c | 6133 +++++++++++++++++++++++++++++++++++++++
 drivers/staging/me4000/me4000.h |  954 ++++++
 7 files changed, 7114 insertions(+), 0 deletions(-)
 create mode 100644 drivers/staging/me4000/Kconfig
 create mode 100644 drivers/staging/me4000/Makefile
 create mode 100644 drivers/staging/me4000/README
 create mode 100644 drivers/staging/me4000/me4000.c
 create mode 100644 drivers/staging/me4000/me4000.h
drivers/staging/Kconfig +2 -0
index 6da7662..56c73bc 100644
@@ -29,4 +29,6 @@ source "drivers/staging/slicoss/Kconfig"
 
 source "drivers/staging/sxg/Kconfig"
 
+source "drivers/staging/me4000/Kconfig"
+
 endif # STAGING
drivers/staging/Makefile +1 -0
index cd6d6a5..97df19b 100644
@@ -3,3 +3,4 @@
 obj-$(CONFIG_ET131X)		+= et131x/
 obj-$(CONFIG_SLICOSS)		+= slicoss/
 obj-$(CONFIG_SXG)		+= sxg/
+obj-$(CONFIG_ME4000)		+= me4000/
drivers/staging/me4000/Kconfig new file +10 -0
new file mode 100644
index 0000000..5e6c9de
@@ -0,0 +1,10 @@
+config ME4000
+	tristate "Meilhaus ME-4000 support"
+	default n
+	depends on PCI
+	help
+	  This driver supports the Meilhaus ME-4000 family of boards
+	  that do data collection and multipurpose I/O.
+
+	  To compile this driver as a module, choose M here: the module
+	  will be called me4000.
drivers/staging/me4000/Makefile new file +1 -0
new file mode 100644
index 0000000..74487cd
@@ -0,0 +1 @@
+obj-$(CONFIG_ME4000)		+= me4000.o
drivers/staging/me4000/README new file +13 -0
new file mode 100644
index 0000000..bbb8386
@@ -0,0 +1,13 @@
+
+TODO:
+	- checkpatch.pl cleanups
+	- sparse cleanups
+	- possible /proc interaction cleanups
+	- more info needed for Kconfig entry
+	- real device id?
+	- module parameter cleanup
+
+Please send patches to Greg Kroah-Hartman <[email protected]>
+and Cc: Wolfgang Beiter <[email protected]> and
+Guenter Gebhardt <[email protected]>
+
drivers/staging/me4000/me4000.c new file +33 -0
new file mode 100644
index 0000000..862dd7f
@@ -0,0 +1,6133 @@
+/* Device driver for Meilhaus ME-4000 board family.
+ * ================================================
+ *
+ *  Copyright (C) 2003 Meilhaus Electronic GmbH ([email protected])
+ *
+ *  This file 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., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ *  Author:	Guenter Gebhardt	<[email protected]>
+ */
+
+#include <linux/module.h>
+#include <linux/fs.h>
+#include <linux/sched.h>
+#include <linux/interrupt.h>
+#include <linux/pci.h>
+#include <asm/io.h>
+#include <asm/system.h>
+#include <asm/uaccess.h>
+#include <linux/errno.h>
+#include <linux/delay.h>
+#include <linux/fs.h>

drivers/staging/me4000/me4000.c line 43

Quoted 10 lines
drivers/staging/me4000/me4000.c new file +10 -0
+#include <linux/mm.h>
+#include <linux/unistd.h>
+#include <linux/list.h>
+#include <linux/proc_fs.h>
+
+#include <linux/poll.h>
+#include <linux/vmalloc.h>
+#include <asm/pgtable.h>
+#include <asm/uaccess.h>
+#include <linux/types.h>

Reorder includes (inxlude/linux before include/asm)

Quoted 6 lines
drivers/staging/me4000/me4000.c new file +6 -0
+#include <linux/slab.h>
+
+/* Include-File for the Meilhaus ME-4000 I/O board */
+#include "me4000.h"
+#include "me4000_firmware.h"
+#include "me4610_firmware.h"

drivers/staging/me4000/me4000.c line 60

Quoted 10 lines
drivers/staging/me4000/me4000.c new file +10 -0
+
+/* Administrative stuff for modinfo */
+MODULE_AUTHOR("Guenter Gebhardt <[email protected]>");
+MODULE_DESCRIPTION
+    ("Device Driver Module for Meilhaus ME-4000 boards version 1.0.5");
+MODULE_SUPPORTED_DEVICE("Meilhaus ME-4000 Multi I/O boards");
+MODULE_LICENSE("GPL");
+
+/* Board specific data are kept in a global list */
+LIST_HEAD(me4000_board_info_list);

static

drivers/staging/me4000/me4000.c line 67

Quoted 6 lines
drivers/staging/me4000/me4000.c new file +6 -0
+/* Major Device Numbers. 0 means to get it automatically from the System */
+static int me4000_ao_major_driver_no = 0;
+static int me4000_ai_major_driver_no = 0;
+static int me4000_dio_major_driver_no = 0;
+static int me4000_cnt_major_driver_no = 0;
+static int me4000_ext_int_major_driver_no = 0;

s/= 0//

Quoted 16 lines
drivers/staging/me4000/me4000.c new file +16 -0
+/* Let the user specify a custom major driver number */
+module_param(me4000_ao_major_driver_no, int, 0);
+MODULE_PARM_DESC(me4000_ao_major_driver_no,
+		 "Major driver number for analog output (default 0)");
+
+module_param(me4000_ai_major_driver_no, int, 0);
+MODULE_PARM_DESC(me4000_ai_major_driver_no,
+		 "Major driver number for analog input (default 0)");
+
+module_param(me4000_dio_major_driver_no, int, 0);
+MODULE_PARM_DESC(me4000_dio_major_driver_no,
+		 "Major driver number digital I/O (default 0)");
+
+module_param(me4000_cnt_major_driver_no, int, 0);
+MODULE_PARM_DESC(me4000_cnt_major_driver_no,
+		 "Major driver number for counter (default 0)");

drivers/staging/me4000/me4000.c line 94

Quoted 10 lines
drivers/staging/me4000/me4000.c new file +10 -0
+
+module_param(me4000_ext_int_major_driver_no, int, 0);
+MODULE_PARM_DESC(me4000_ext_int_major_driver_no,
+		 "Major driver number for external interrupt (default 0)");
+
+/*-----------------------------------------------------------------------------
+  Module stuff
+  ---------------------------------------------------------------------------*/
+int init_module(void);
+void cleanup_module(void);

kill

Quoted 6 lines
drivers/staging/me4000/me4000.c new file +6 -0
+/*-----------------------------------------------------------------------------
+  Board detection and initialization
+  ---------------------------------------------------------------------------*/
+static int me4000_probe(struct pci_dev *dev, const struct pci_device_id *id);
+static int me4000_xilinx_download(me4000_info_t *);
+static int me4000_reset_board(me4000_info_t *);

drivers/staging/me4000/me4000.c line 111

Quoted 10 lines
drivers/staging/me4000/me4000.c new file +10 -0
+
+static void clear_board_info_list(void);
+static int get_registers(struct pci_dev *dev, me4000_info_t * info);
+static int init_board_info(struct pci_dev *dev, me4000_info_t * board_info);
+static int alloc_ao_contexts(me4000_info_t * info);
+static void release_ao_contexts(me4000_info_t * board_info);
+static int alloc_ai_context(me4000_info_t * info);
+static int alloc_dio_context(me4000_info_t * info);
+static int alloc_cnt_context(me4000_info_t * info);
+static int alloc_ext_int_context(me4000_info_t * info);

lots of these are unneeded.

Quoted 49 lines
drivers/staging/me4000/me4000.c new file +49 -0
+/*-----------------------------------------------------------------------------
+  Stuff used by all device parts
+  ---------------------------------------------------------------------------*/
+static int me4000_open(struct inode *, struct file *);
+static int me4000_release(struct inode *, struct file *);
+
+static int me4000_get_user_info(me4000_user_info_t *,
+				me4000_info_t * board_info);
+static int me4000_read_procmem(char *, char **, off_t, int, int *, void *);
+
+/*-----------------------------------------------------------------------------
+  Analog output stuff
+  ---------------------------------------------------------------------------*/
+static ssize_t me4000_ao_write_sing(struct file *, const char *, size_t,
+				    loff_t *);
+static ssize_t me4000_ao_write_wrap(struct file *, const char *, size_t,
+				    loff_t *);
+static ssize_t me4000_ao_write_cont(struct file *, const char *, size_t,
+				    loff_t *);
+
+static int me4000_ao_ioctl_sing(struct inode *, struct file *, unsigned int,
+				unsigned long);
+static int me4000_ao_ioctl_wrap(struct inode *, struct file *, unsigned int,
+				unsigned long);
+static int me4000_ao_ioctl_cont(struct inode *, struct file *, unsigned int,
+				unsigned long);
+
+static unsigned int me4000_ao_poll_cont(struct file *, poll_table *);
+static int me4000_ao_fsync_cont(struct file *, struct dentry *, int);
+
+static int me4000_ao_start(unsigned long *, me4000_ao_context_t *);
+static int me4000_ao_stop(me4000_ao_context_t *);
+static int me4000_ao_immediate_stop(me4000_ao_context_t *);
+static int me4000_ao_timer_set_divisor(u32 *, me4000_ao_context_t *);
+static int me4000_ao_preload(me4000_ao_context_t *);
+static int me4000_ao_preload_update(me4000_ao_context_t *);
+static int me4000_ao_ex_trig_set_edge(int *, me4000_ao_context_t *);
+static int me4000_ao_ex_trig_enable(me4000_ao_context_t *);
+static int me4000_ao_ex_trig_disable(me4000_ao_context_t *);
+static int me4000_ao_prepare(me4000_ao_context_t * ao_info);
+static int me4000_ao_reset(me4000_ao_context_t * ao_info);
+static int me4000_ao_enable_do(me4000_ao_context_t *);
+static int me4000_ao_disable_do(me4000_ao_context_t *);
+static int me4000_ao_fsm_state(int *, me4000_ao_context_t *);
+
+static int me4000_ao_simultaneous_ex_trig(me4000_ao_context_t * ao_context);
+static int me4000_ao_simultaneous_sw(me4000_ao_context_t * ao_context);
+static int me4000_ao_simultaneous_disable(me4000_ao_context_t * ao_context);
+static int me4000_ao_simultaneous_update(me4000_ao_channel_list_t * channels,

drivers/staging/me4000/me4000.c line 171

Quoted 10 lines
drivers/staging/me4000/me4000.c new file +10 -0
+					 me4000_ao_context_t * ao_context);
+
+static int me4000_ao_synchronous_ex_trig(me4000_ao_context_t * ao_context);
+static int me4000_ao_synchronous_sw(me4000_ao_context_t * ao_context);
+static int me4000_ao_synchronous_disable(me4000_ao_context_t * ao_context);
+
+static int me4000_ao_ex_trig_timeout(unsigned long *arg,
+				     me4000_ao_context_t * ao_context);
+static int me4000_ao_get_free_buffer(unsigned long *arg,
+				     me4000_ao_context_t * ao_context);

probably lots of those too.

Quoted 26 lines
drivers/staging/me4000/me4000.c new file +26 -0
+/*-----------------------------------------------------------------------------
+  Analog input stuff
+  ---------------------------------------------------------------------------*/
+static int me4000_ai_single(me4000_ai_single_t *, me4000_ai_context_t *);
+static int me4000_ai_ioctl_sing(struct inode *, struct file *, unsigned int,
+				unsigned long);
+
+static ssize_t me4000_ai_read(struct file *, char *, size_t, loff_t *);
+static int me4000_ai_ioctl_sw(struct inode *, struct file *, unsigned int,
+			      unsigned long);
+static unsigned int me4000_ai_poll(struct file *, poll_table *);
+static int me4000_ai_fasync(int fd, struct file *file_p, int mode);
+
+static int me4000_ai_ioctl_ext(struct inode *, struct file *, unsigned int,
+			       unsigned long);
+
+static int me4000_ai_prepare(me4000_ai_context_t * ai_context);
+static int me4000_ai_reset(me4000_ai_context_t * ai_context);
+static int me4000_ai_config(me4000_ai_config_t *, me4000_ai_context_t *);
+static int me4000_ai_start(me4000_ai_context_t *);
+static int me4000_ai_start_ex(unsigned long *, me4000_ai_context_t *);
+static int me4000_ai_stop(me4000_ai_context_t *);
+static int me4000_ai_immediate_stop(me4000_ai_context_t *);
+static int me4000_ai_ex_trig_enable(me4000_ai_context_t *);
+static int me4000_ai_ex_trig_disable(me4000_ai_context_t *);
+static int me4000_ai_ex_trig_setup(me4000_ai_trigger_t *,

drivers/staging/me4000/me4000.c line 208

Quoted 10 lines
drivers/staging/me4000/me4000.c new file +10 -0
+				   me4000_ai_context_t *);
+static int me4000_ai_sc_setup(me4000_ai_sc_t * arg,
+			      me4000_ai_context_t * ai_context);
+static int me4000_ai_offset_enable(me4000_ai_context_t * ai_context);
+static int me4000_ai_offset_disable(me4000_ai_context_t * ai_context);
+static int me4000_ai_fullscale_enable(me4000_ai_context_t * ai_context);
+static int me4000_ai_fullscale_disable(me4000_ai_context_t * ai_context);
+static int me4000_ai_fsm_state(int *arg, me4000_ai_context_t * ai_context);
+static int me4000_ai_get_count_buffer(unsigned long *arg,
+				      me4000_ai_context_t * ai_context);

blah

Quoted 52 lines
drivers/staging/me4000/me4000.c new file +52 -0
+/*-----------------------------------------------------------------------------
+  EEPROM stuff
+  ---------------------------------------------------------------------------*/
+static int me4000_eeprom_read(me4000_eeprom_t * arg,
+			      me4000_ai_context_t * ai_context);
+static int me4000_eeprom_write(me4000_eeprom_t * arg,
+			       me4000_ai_context_t * ai_context);
+static unsigned short eeprom_read_cmd(me4000_ai_context_t * ai_context,
+				      unsigned long cmd, int length);
+static int eeprom_write_cmd(me4000_ai_context_t * ai_context, unsigned long cmd,
+			    int length);
+
+/*-----------------------------------------------------------------------------
+  Digital I/O stuff
+  ---------------------------------------------------------------------------*/
+static int me4000_dio_ioctl(struct inode *, struct file *, unsigned int,
+			    unsigned long);
+static int me4000_dio_config(me4000_dio_config_t *, me4000_dio_context_t *);
+static int me4000_dio_get_byte(me4000_dio_byte_t *, me4000_dio_context_t *);
+static int me4000_dio_set_byte(me4000_dio_byte_t *, me4000_dio_context_t *);
+static int me4000_dio_reset(me4000_dio_context_t *);
+
+/*-----------------------------------------------------------------------------
+  Counter stuff
+  ---------------------------------------------------------------------------*/
+static int me4000_cnt_ioctl(struct inode *, struct file *, unsigned int,
+			    unsigned long);
+static int me4000_cnt_config(me4000_cnt_config_t *, me4000_cnt_context_t *);
+static int me4000_cnt_read(me4000_cnt_t *, me4000_cnt_context_t *);
+static int me4000_cnt_write(me4000_cnt_t *, me4000_cnt_context_t *);
+static int me4000_cnt_reset(me4000_cnt_context_t *);
+
+/*-----------------------------------------------------------------------------
+  External interrupt routines
+  ---------------------------------------------------------------------------*/
+static int me4000_ext_int_ioctl(struct inode *, struct file *, unsigned int,
+				unsigned long);
+static int me4000_ext_int_enable(me4000_ext_int_context_t *);
+static int me4000_ext_int_disable(me4000_ext_int_context_t *);
+static int me4000_ext_int_count(unsigned long *arg,
+				me4000_ext_int_context_t * ext_int_context);
+static int me4000_ext_int_fasync(int fd, struct file *file_ptr, int mode);
+
+/*-----------------------------------------------------------------------------
+  The interrupt service routines
+  ---------------------------------------------------------------------------*/
+static irqreturn_t me4000_ao_isr(int, void *);
+static irqreturn_t me4000_ai_isr(int, void *);
+static irqreturn_t me4000_ext_int_isr(int, void *);
+
+/*-----------------------------------------------------------------------------
+  Inline functions

drivers/staging/me4000/me4000.c line 271

Quoted 10 lines
drivers/staging/me4000/me4000.c new file +10 -0
+  ---------------------------------------------------------------------------*/
+static int inline me4000_buf_count(me4000_circ_buf_t, int);
+static int inline me4000_buf_space(me4000_circ_buf_t, int);
+static int inline me4000_space_to_end(me4000_circ_buf_t, int);
+static int inline me4000_values_to_end(me4000_circ_buf_t, int);
+
+static void inline me4000_outb(unsigned char value, unsigned long port);
+static void inline me4000_outl(unsigned long value, unsigned long port);
+static unsigned long inline me4000_inl(unsigned long port);
+static unsigned char inline me4000_inb(unsigned long port);

wtf

Quoted 18 lines
drivers/staging/me4000/me4000.c new file +17 -0
+static int me4000_buf_count(me4000_circ_buf_t buf, int size)
+{
+	return ((buf.head - buf.tail) & (size - 1));
+}
+
+static int me4000_buf_space(me4000_circ_buf_t buf, int size)
+{
+	return ((buf.tail - (buf.head + 1)) & (size - 1));
+}
 
+static int me4000_values_to_end(me4000_circ_buf_t buf, int size)
+{
+	int end;
+	int n;
+	end = size - buf.tail;
+	n = (buf.head + end) & (size - 1);
+	return (n < end) ? n : end;
+}

drivers/staging/me4000/me4000.c line 300

Quoted 10 lines
drivers/staging/me4000/me4000.c new file +10 -0
+
+static int me4000_space_to_end(me4000_circ_buf_t buf, int size)
+{
+	int end;
+	int n;
+
+	end = size - 1 - buf.head;
+	n = (end + buf.tail) & (size - 1);
+	return (n <= end) ? n : (end + 1);
+}

yet another home-made circular buffer implementation

rename all struct foo_t to struct foo

Quoted 31 lines
drivers/staging/me4000/me4000.c new file +31 -0
+static void me4000_outb(unsigned char value, unsigned long port)
+{
+	PORT_PDEBUG("--> 0x%02X port 0x%04lX\n", value, port);
+	outb(value, port);
+}
+
+static void me4000_outl(unsigned long value, unsigned long port)
+{
+	PORT_PDEBUG("--> 0x%08lX port 0x%04lX\n", value, port);
+	outl(value, port);
+}
+
+static unsigned long me4000_inl(unsigned long port)
+{
+	unsigned long value;
+	value = inl(port);
+	PORT_PDEBUG("<-- 0x%08lX port 0x%04lX\n", value, port);
+	return value;
+}
+
+static unsigned char me4000_inb(unsigned long port)
+{
+	unsigned char value;
+	value = inb(port);
+	PORT_PDEBUG("<-- 0x%08X port 0x%04lX\n", value, port);
+	return value;
+}
+
+struct pci_driver me4000_driver = {
+	.name = ME4000_NAME,
+	.id_table = me4000_pci_table,

drivers/staging/me4000/me4000.c line 342

Quoted 10 lines
drivers/staging/me4000/me4000.c new file +10 -0
+	.probe = me4000_probe
+};
+
+static struct file_operations me4000_ao_fops_sing = {
+      owner:THIS_MODULE,
+      write:me4000_ao_write_sing,
+      ioctl:me4000_ao_ioctl_sing,
+      open:me4000_open,
+      release:me4000_release,
+};
	.foo = bar,
Quoted 73 lines
drivers/staging/me4000/me4000.c new file +73 -0
+static struct file_operations me4000_ao_fops_wrap = {
+      owner:THIS_MODULE,
+      write:me4000_ao_write_wrap,
+      ioctl:me4000_ao_ioctl_wrap,
+      open:me4000_open,
+      release:me4000_release,
+};
+
+static struct file_operations me4000_ao_fops_cont = {
+      owner:THIS_MODULE,
+      write:me4000_ao_write_cont,
+      poll:me4000_ao_poll_cont,
+      ioctl:me4000_ao_ioctl_cont,
+      open:me4000_open,
+      release:me4000_release,
+      fsync:me4000_ao_fsync_cont,
+};
+
+static struct file_operations me4000_ai_fops_sing = {
+      owner:THIS_MODULE,
+      ioctl:me4000_ai_ioctl_sing,
+      open:me4000_open,
+      release:me4000_release,
+};
+
+static struct file_operations me4000_ai_fops_cont_sw = {
+      owner:THIS_MODULE,
+      read:me4000_ai_read,
+      poll:me4000_ai_poll,
+      ioctl:me4000_ai_ioctl_sw,
+      open:me4000_open,
+      release:me4000_release,
+      fasync:me4000_ai_fasync,
+};
+
+static struct file_operations me4000_ai_fops_cont_et = {
+      owner:THIS_MODULE,
+      read:me4000_ai_read,
+      poll:me4000_ai_poll,
+      ioctl:me4000_ai_ioctl_ext,
+      open:me4000_open,
+      release:me4000_release,
+};
+
+static struct file_operations me4000_ai_fops_cont_et_value = {
+      owner:THIS_MODULE,
+      read:me4000_ai_read,
+      poll:me4000_ai_poll,
+      ioctl:me4000_ai_ioctl_ext,
+      open:me4000_open,
+      release:me4000_release,
+};
+
+static struct file_operations me4000_ai_fops_cont_et_chanlist = {
+      owner:THIS_MODULE,
+      read:me4000_ai_read,
+      poll:me4000_ai_poll,
+      ioctl:me4000_ai_ioctl_ext,
+      open:me4000_open,
+      release:me4000_release,
+};
+
+static struct file_operations me4000_dio_fops = {
+      owner:THIS_MODULE,
+      ioctl:me4000_dio_ioctl,
+      open:me4000_open,
+      release:me4000_release,
+};
+
+static struct file_operations me4000_cnt_fops = {
+      owner:THIS_MODULE,
+      ioctl:me4000_cnt_ioctl,
+      open:me4000_open,

drivers/staging/me4000/me4000.c line 426

Quoted 10 lines
drivers/staging/me4000/me4000.c new file +10 -0
+      release:me4000_release,
+};
+
+static struct file_operations me4000_ext_int_fops = {
+      owner:THIS_MODULE,
+      ioctl:me4000_ext_int_ioctl,
+      open:me4000_open,
+      release:me4000_release,
+      fasync:me4000_ext_int_fasync,
+};

dittoes

drivers/staging/me4000/me4000.c line 440

Quoted 13 lines
drivers/staging/me4000/me4000.c new file +13 -0
+static struct file_operations *me4000_ao_fops_array[] = {
+	&me4000_ao_fops_sing,	// single operations
+	&me4000_ao_fops_wrap,	// wraparound operations
+	&me4000_ao_fops_cont,	// continous operations
+};
+
+static struct file_operations *me4000_ai_fops_array[] = {
+	&me4000_ai_fops_sing,	// single operations
+	&me4000_ai_fops_cont_sw,	// continuous operations with software start
+	&me4000_ai_fops_cont_et,	// continous operations with external trigger
+	&me4000_ai_fops_cont_et_value,	// sample values by external trigger
+	&me4000_ai_fops_cont_et_chanlist,	// work through one channel list by external trigger
+};

ditto

Quoted 1 line

+int __init me4000_init_module(void)

static

drivers/staging/me4000/me4000.c

Quoted 2 lines
drivers/staging/me4000/me4000.c new file +2 -0
+{
+	int result = 0;

unneeded initialisation

Quoted 66 lines
drivers/staging/me4000/me4000.c new file +66 -0
+	CALL_PDEBUG("init_module() is executed\n");
+
+	/* Register driver capabilities */
+	result = pci_register_driver(&me4000_driver);
+	PDEBUG("init_module():%d devices detected\n", result);
+	if (result < 0) {
+		printk(KERN_ERR "ME4000:init_module():Can't register driver\n");
+		goto INIT_ERROR_1;
+	}
+
+	/* Allocate major number for analog output */
+	result =
+	    register_chrdev(me4000_ao_major_driver_no, ME4000_AO_NAME,
+			    &me4000_ao_fops_sing);
+	if (result < 0) {
+		printk(KERN_ERR "ME4000:init_module():Can't get AO major no\n");
+		goto INIT_ERROR_2;
+	} else {
+		me4000_ao_major_driver_no = result;
+	}
+	PDEBUG("init_module():Major driver number for AO = %ld\n",
+	       me4000_ao_major_driver_no);
+
+	/* Allocate major number for analog input  */
+	result =
+	    register_chrdev(me4000_ai_major_driver_no, ME4000_AI_NAME,
+			    &me4000_ai_fops_sing);
+	if (result < 0) {
+		printk(KERN_ERR "ME4000:init_module():Can't get AI major no\n");
+		goto INIT_ERROR_3;
+	} else {
+		me4000_ai_major_driver_no = result;
+	}
+	PDEBUG("init_module():Major driver number for AI = %ld\n",
+	       me4000_ai_major_driver_no);
+
+	/* Allocate major number for digital I/O */
+	result =
+	    register_chrdev(me4000_dio_major_driver_no, ME4000_DIO_NAME,
+			    &me4000_dio_fops);
+	if (result < 0) {
+		printk(KERN_ERR
+		       "ME4000:init_module():Can't get DIO major no\n");
+		goto INIT_ERROR_4;
+	} else {
+		me4000_dio_major_driver_no = result;
+	}
+	PDEBUG("init_module():Major driver number for DIO = %ld\n",
+	       me4000_dio_major_driver_no);
+
+	/* Allocate major number for counter */
+	result =
+	    register_chrdev(me4000_cnt_major_driver_no, ME4000_CNT_NAME,
+			    &me4000_cnt_fops);
+	if (result < 0) {
+		printk(KERN_ERR
+		       "ME4000:init_module():Can't get CNT major no\n");
+		goto INIT_ERROR_5;
+	} else {
+		me4000_cnt_major_driver_no = result;
+	}
+	PDEBUG("init_module():Major driver number for CNT = %ld\n",
+	       me4000_cnt_major_driver_no);
+
+	/* Allocate major number for external interrupt */
+	result =

drivers/staging/me4000/me4000.c line 521

Quoted 10 lines
drivers/staging/me4000/me4000.c new file +10 -0
+	    register_chrdev(me4000_ext_int_major_driver_no, ME4000_EXT_INT_NAME,
+			    &me4000_ext_int_fops);
+	if (result < 0) {
+		printk(KERN_ERR
+		       "ME4000:init_module():Can't get major no for external interrupt\n");
+		goto INIT_ERROR_6;
+	} else {
+		me4000_ext_int_major_driver_no = result;
+	}
+	PDEBUG

Yet another home-made prdebug?

Quoted 5 lines
drivers/staging/me4000/me4000.c new file +5 -0
+	    ("init_module():Major driver number for external interrupt = %ld\n",
+	     me4000_ext_int_major_driver_no);
+
+	/* Create the /proc/me4000 entry */
+	if (!create_proc_read_entry

drivers/staging/me4000/me4000.c line 536

Quoted 10 lines
drivers/staging/me4000/me4000.c new file +10 -0
+	    ("me4000", 0, NULL, me4000_read_procmem, NULL)) {
+		result = -ENODEV;
+		printk(KERN_ERR
+		       "ME4000:init_module():Can't create proc entry\n");
+		goto INIT_ERROR_7;
+	}
+
+	return 0;
+
+      INIT_ERROR_7:

crazy label indenting

Quoted 62 lines
drivers/staging/me4000/me4000.c new file +62 -0
+	unregister_chrdev(me4000_ext_int_major_driver_no, ME4000_EXT_INT_NAME);
+
+      INIT_ERROR_6:
+	unregister_chrdev(me4000_cnt_major_driver_no, ME4000_CNT_NAME);
+
+      INIT_ERROR_5:
+	unregister_chrdev(me4000_dio_major_driver_no, ME4000_DIO_NAME);
+
+      INIT_ERROR_4:
+	unregister_chrdev(me4000_ai_major_driver_no, ME4000_AI_NAME);
+
+      INIT_ERROR_3:
+	unregister_chrdev(me4000_ao_major_driver_no, ME4000_AO_NAME);
+
+      INIT_ERROR_2:
+	pci_unregister_driver(&me4000_driver);
+	clear_board_info_list();
+
+      INIT_ERROR_1:
+	return result;
+}
+
+module_init(me4000_init_module);
+
+static void clear_board_info_list(void)
+{
+	struct list_head *board_p;
+	struct list_head *dac_p;
+	me4000_info_t *board_info;
+	me4000_ao_context_t *ao_context;
+
+	/* Clear context lists */
+	for (board_p = me4000_board_info_list.next;
+	     board_p != &me4000_board_info_list; board_p = board_p->next) {
+		board_info = list_entry(board_p, me4000_info_t, list);
+		/* Clear analog output context list */
+		while (!list_empty(&board_info->ao_context_list)) {
+			dac_p = board_info->ao_context_list.next;
+			ao_context =
+			    list_entry(dac_p, me4000_ao_context_t, list);
+			me4000_ao_reset(ao_context);
+			free_irq(ao_context->irq, ao_context);
+			if (ao_context->circ_buf.buf)
+				kfree(ao_context->circ_buf.buf);
+			list_del(dac_p);
+			kfree(ao_context);
+		}
+
+		/* Clear analog input context */
+		if (board_info->ai_context->circ_buf.buf)
+			kfree(board_info->ai_context->circ_buf.buf);
+		kfree(board_info->ai_context);
+
+		/* Clear digital I/O context */
+		kfree(board_info->dio_context);
+
+		/* Clear counter context */
+		kfree(board_info->cnt_context);
+
+		/* Clear external interrupt context */
+		kfree(board_info->ext_int_context);
+	}

drivers/staging/me4000/me4000.c line 608

Quoted 10 lines
drivers/staging/me4000/me4000.c new file +10 -0
+
+	/* Clear the board info list */
+	while (!list_empty(&me4000_board_info_list)) {
+		board_p = me4000_board_info_list.next;
+		board_info = list_entry(board_p, me4000_info_t, list);
+		pci_release_regions(board_info->pci_dev_p);
+		list_del(board_p);
+		kfree(board_info);
+	}
+}

locking for me4000_board_info_list

Quoted 16 lines
drivers/staging/me4000/me4000.c new file +16 -0
+static int get_registers(struct pci_dev *dev, me4000_info_t * board_info)
+{
+
+	/*--------------------------- plx regbase ---------------------------------*/
+
+	board_info->plx_regbase = pci_resource_start(dev, 1);
+	if (board_info->plx_regbase == 0) {
+		printk(KERN_ERR
+		       "ME4000:get_registers():PCI base address 1 is not available\n");
+		return -ENODEV;
+	}
+	board_info->plx_regbase_size = pci_resource_len(dev, 1);
+
+	PDEBUG
+	    ("get_registers():PLX configuration registers at address 0x%4lX [0x%4lX]\n",
+	     board_info->plx_regbase, board_info->plx_regbase_size);

drivers/staging/me4000/me4000.c line 635

Quoted 10 lines
drivers/staging/me4000/me4000.c new file +10 -0
+
+	/*--------------------------- me4000 regbase ------------------------------*/
+
+	board_info->me4000_regbase = pci_resource_start(dev, 2);
+	if (board_info->me4000_regbase == 0) {
+		printk(KERN_ERR
+		       "ME4000:get_registers():PCI base address 2 is not available\n");
+		return -ENODEV;
+	}
+	board_info->me4000_regbase_size = pci_resource_len(dev, 2);

me4000_regbase and me4000_regbase_size should become resource_size_t.

Quoted 18 lines
drivers/staging/me4000/me4000.c new file +17 -0
+	PDEBUG("get_registers():ME4000 registers at address 0x%4lX [0x%4lX]\n",
+	       board_info->me4000_regbase, board_info->me4000_regbase_size);
 
+	/*--------------------------- timer regbase ------------------------------*/
+
+	board_info->timer_regbase = pci_resource_start(dev, 3);
+	if (board_info->timer_regbase == 0) {
+		printk(KERN_ERR
+		       "ME4000:get_registers():PCI base address 3 is not available\n");
+		return -ENODEV;
+	}
+	board_info->timer_regbase_size = pci_resource_len(dev, 3);
+
+	PDEBUG("get_registers():Timer registers at address 0x%4lX [0x%4lX]\n",
+	       board_info->timer_regbase, board_info->timer_regbase_size);
+
+	/*--------------------------- program regbase ------------------------------*/
+

drivers/staging/me4000/me4000.c line 664

Quoted 10 lines
drivers/staging/me4000/me4000.c new file +10 -0
+	board_info->program_regbase = pci_resource_start(dev, 5);
+	if (board_info->program_regbase == 0) {
+		printk(KERN_ERR
+		       "get_registers():ME4000:PCI base address 5 is not available\n");
+		return -ENODEV;
+	}
+	board_info->program_regbase_size = pci_resource_len(dev, 5);
+
+	PDEBUG("get_registers():Program registers at address 0x%4lX [0x%4lX]\n",
+	       board_info->program_regbase, board_info->program_regbase_size);

dittoes

Quoted 97 lines
drivers/staging/me4000/me4000.c new file +97 -0
+	return 0;
+}
+
+static int init_board_info(struct pci_dev *pci_dev_p,
+			   me4000_info_t * board_info)
+{
+	int i;
+	int result;
+	struct list_head *board_p;
+	board_info->pci_dev_p = pci_dev_p;
+
+	for (i = 0; i < ME4000_BOARD_VERSIONS; i++) {
+		if (me4000_boards[i].device_id == pci_dev_p->device) {
+			board_info->board_p = &me4000_boards[i];
+			break;
+		}
+	}
+	if (i == ME4000_BOARD_VERSIONS) {
+		printk(KERN_ERR
+		       "ME4000:init_board_info():Device ID not valid\n");
+		return -ENODEV;
+	}
+
+	/* Get the index of the board in the global list */
+	for (board_p = me4000_board_info_list.next, i = 0;
+	     board_p != &me4000_board_info_list; board_p = board_p->next, i++) {
+		if (board_p == &board_info->list) {
+			board_info->board_count = i;
+			break;
+		}
+	}
+	if (board_p == &me4000_board_info_list) {
+		printk(KERN_ERR
+		       "ME4000:init_board_info():Cannot get index of baord\n");
+		return -ENODEV;
+	}
+
+	/* Init list head for analog output contexts */
+	INIT_LIST_HEAD(&board_info->ao_context_list);
+
+	/* Init spin locks */
+	spin_lock_init(&board_info->preload_lock);
+	spin_lock_init(&board_info->ai_ctrl_lock);
+
+	/* Get the serial number */
+	result = pci_read_config_dword(pci_dev_p, 0x2C, &board_info->serial_no);
+	if (result != PCIBIOS_SUCCESSFUL) {
+		printk(KERN_WARNING
+		       "ME4000:init_board_info: Can't get serial_no\n");
+		return result;
+	}
+	PDEBUG("init_board_info():serial_no = 0x%x\n", board_info->serial_no);
+
+	/* Get the hardware revision */
+	result =
+	    pci_read_config_byte(pci_dev_p, 0x08, &board_info->hw_revision);
+	if (result != PCIBIOS_SUCCESSFUL) {
+		printk(KERN_WARNING
+		       "ME4000:init_board_info():Can't get hw_revision\n");
+		return result;
+	}
+	PDEBUG("init_board_info():hw_revision = 0x%x\n",
+	       board_info->hw_revision);
+
+	/* Get the vendor id */
+	board_info->vendor_id = pci_dev_p->vendor;
+	PDEBUG("init_board_info():vendor_id = 0x%x\n", board_info->vendor_id);
+
+	/* Get the device id */
+	board_info->device_id = pci_dev_p->device;
+	PDEBUG("init_board_info():device_id = 0x%x\n", board_info->device_id);
+
+	/* Get the pci device number */
+	board_info->pci_dev_no = PCI_FUNC(pci_dev_p->devfn);
+	PDEBUG("init_board_info():pci_func_no = 0x%x\n",
+	       board_info->pci_func_no);
+
+	/* Get the pci slot number */
+	board_info->pci_dev_no = PCI_SLOT(pci_dev_p->devfn);
+	PDEBUG("init_board_info():pci_dev_no = 0x%x\n", board_info->pci_dev_no);
+
+	/* Get the pci bus number */
+	board_info->pci_bus_no = pci_dev_p->bus->number;
+	PDEBUG("init_board_info():pci_bus_no = 0x%x\n", board_info->pci_bus_no);
+
+	/* Get the irq assigned to the board */
+	board_info->irq = pci_dev_p->irq;
+	PDEBUG("init_board_info():irq = %d\n", board_info->irq);
+
+	return 0;
+}
+
+static int alloc_ao_contexts(me4000_info_t * info)
+{
+	int i;
+	int err;
+	me4000_ao_context_t *ao_context;

drivers/staging/me4000/me4000.c line 772

Quoted 10 lines
drivers/staging/me4000/me4000.c new file +10 -0
+
+	for (i = 0; i < info->board_p->ao.count; i++) {
+		ao_context = kmalloc(sizeof(me4000_ao_context_t), GFP_KERNEL);
+		if (!ao_context) {
+			printk(KERN_ERR
+			       "alloc_ao_contexts():Can't get memory for ao context\n");
+			release_ao_contexts(info);
+			return -ENOMEM;
+		}
+		memset(ao_context, 0, sizeof(me4000_ao_context_t));

kzalloc

Quoted 8 lines
drivers/staging/me4000/me4000.c new file +8 -0
+		spin_lock_init(&ao_context->use_lock);
+		spin_lock_init(&ao_context->int_lock);
+		ao_context->irq = info->irq;
+		init_waitqueue_head(&ao_context->wait_queue);
+		ao_context->board_info = info;
+
+		if (info->board_p->ao.fifo_count) {
+			/* Allocate circular buffer */

drivers/staging/me4000/me4000.c line 791

Quoted 10 lines
drivers/staging/me4000/me4000.c new file +10 -0
+			ao_context->circ_buf.buf =
+			    kmalloc(ME4000_AO_BUFFER_SIZE, GFP_KERNEL);
+			if (!ao_context->circ_buf.buf) {
+				printk(KERN_ERR
+				       "alloc_ao_contexts():Can't get circular buffer\n");
+				release_ao_contexts(info);
+				return -ENOMEM;
+			}
+			memset(ao_context->circ_buf.buf, 0,
+			       ME4000_AO_BUFFER_SIZE);

kzalloc

Quoted 73 lines
drivers/staging/me4000/me4000.c new file +73 -0
+			/* Clear the circular buffer */
+			ao_context->circ_buf.head = 0;
+			ao_context->circ_buf.tail = 0;
+		}
+
+		switch (i) {
+		case 0:
+			ao_context->ctrl_reg =
+			    info->me4000_regbase + ME4000_AO_00_CTRL_REG;
+			ao_context->status_reg =
+			    info->me4000_regbase + ME4000_AO_00_STATUS_REG;
+			ao_context->fifo_reg =
+			    info->me4000_regbase + ME4000_AO_00_FIFO_REG;
+			ao_context->single_reg =
+			    info->me4000_regbase + ME4000_AO_00_SINGLE_REG;
+			ao_context->timer_reg =
+			    info->me4000_regbase + ME4000_AO_00_TIMER_REG;
+			ao_context->irq_status_reg =
+			    info->me4000_regbase + ME4000_IRQ_STATUS_REG;
+			ao_context->preload_reg =
+			    info->me4000_regbase + ME4000_AO_LOADSETREG_XX;
+			break;
+		case 1:
+			ao_context->ctrl_reg =
+			    info->me4000_regbase + ME4000_AO_01_CTRL_REG;
+			ao_context->status_reg =
+			    info->me4000_regbase + ME4000_AO_01_STATUS_REG;
+			ao_context->fifo_reg =
+			    info->me4000_regbase + ME4000_AO_01_FIFO_REG;
+			ao_context->single_reg =
+			    info->me4000_regbase + ME4000_AO_01_SINGLE_REG;
+			ao_context->timer_reg =
+			    info->me4000_regbase + ME4000_AO_01_TIMER_REG;
+			ao_context->irq_status_reg =
+			    info->me4000_regbase + ME4000_IRQ_STATUS_REG;
+			ao_context->preload_reg =
+			    info->me4000_regbase + ME4000_AO_LOADSETREG_XX;
+			break;
+		case 2:
+			ao_context->ctrl_reg =
+			    info->me4000_regbase + ME4000_AO_02_CTRL_REG;
+			ao_context->status_reg =
+			    info->me4000_regbase + ME4000_AO_02_STATUS_REG;
+			ao_context->fifo_reg =
+			    info->me4000_regbase + ME4000_AO_02_FIFO_REG;
+			ao_context->single_reg =
+			    info->me4000_regbase + ME4000_AO_02_SINGLE_REG;
+			ao_context->timer_reg =
+			    info->me4000_regbase + ME4000_AO_02_TIMER_REG;
+			ao_context->irq_status_reg =
+			    info->me4000_regbase + ME4000_IRQ_STATUS_REG;
+			ao_context->preload_reg =
+			    info->me4000_regbase + ME4000_AO_LOADSETREG_XX;
+			break;
+		case 3:
+			ao_context->ctrl_reg =
+			    info->me4000_regbase + ME4000_AO_03_CTRL_REG;
+			ao_context->status_reg =
+			    info->me4000_regbase + ME4000_AO_03_STATUS_REG;
+			ao_context->fifo_reg =
+			    info->me4000_regbase + ME4000_AO_03_FIFO_REG;
+			ao_context->single_reg =
+			    info->me4000_regbase + ME4000_AO_03_SINGLE_REG;
+			ao_context->timer_reg =
+			    info->me4000_regbase + ME4000_AO_03_TIMER_REG;
+			ao_context->irq_status_reg =
+			    info->me4000_regbase + ME4000_IRQ_STATUS_REG;
+			ao_context->preload_reg =
+			    info->me4000_regbase + ME4000_AO_LOADSETREG_XX;
+			break;
+		default:
+			break;
+		}

drivers/staging/me4000/me4000.c line 875

Quoted 10 lines
drivers/staging/me4000/me4000.c new file +10 -0
+
+		if (info->board_p->ao.fifo_count) {
+			/* Request the interrupt line */
+			err =
+			    request_irq(ao_context->irq, me4000_ao_isr,
+					IRQF_DISABLED | IRQF_SHARED,
+					ME4000_NAME, ao_context);
+			if (err) {
+				printk(KERN_ERR
+				       "alloc_ao_contexts():Can't get interrupt line");

__func__(?)

drivers/staging/me4000/me4000.c

Quoted 2 lines
drivers/staging/me4000/me4000.c new file +2 -0
+				if (ao_context->circ_buf.buf)
+					kfree(ao_context->circ_buf.buf);

kfree(NULL) is legal

Quoted 15 lines
drivers/staging/me4000/me4000.c new file +15 -0
+				kfree(ao_context);
+				release_ao_contexts(info);
+				return -ENODEV;
+			}
+		}
+
+		list_add_tail(&ao_context->list, &info->ao_context_list);
+		ao_context->index = i;
+	}
+
+	return 0;
+}
+
+static void release_ao_contexts(me4000_info_t * board_info)
+{

drivers/staging/me4000/me4000.c line 902

Quoted 10 lines
drivers/staging/me4000/me4000.c new file +10 -0
+	struct list_head *dac_p;
+	me4000_ao_context_t *ao_context;
+
+	/* Clear analog output context list */
+	while (!list_empty(&board_info->ao_context_list)) {
+		dac_p = board_info->ao_context_list.next;
+		ao_context = list_entry(dac_p, me4000_ao_context_t, list);
+		free_irq(ao_context->irq, ao_context);
+		if (ao_context->circ_buf.buf)
+			kfree(ao_context->circ_buf.buf);

etc

Quoted 7 lines
drivers/staging/me4000/me4000.c new file +7 -0
+		list_del(dac_p);
+		kfree(ao_context);
+	}
+}
+
+static int alloc_ai_context(me4000_info_t * info)
+{

drivers/staging/me4000/me4000.c line 919

Quoted 10 lines
drivers/staging/me4000/me4000.c new file +10 -0
+	me4000_ai_context_t *ai_context;
+
+	if (info->board_p->ai.count) {
+		ai_context = kmalloc(sizeof(me4000_ai_context_t), GFP_KERNEL);
+		if (!ai_context) {
+			printk(KERN_ERR
+			       "ME4000:alloc_ai_context():Can't get memory for ai context\n");
+			return -ENOMEM;
+		}
+		memset(ai_context, 0, sizeof(me4000_ai_context_t));

kzalloc()

Quoted 42 lines
drivers/staging/me4000/me4000.c new file +42 -0
+		info->ai_context = ai_context;
+
+		spin_lock_init(&ai_context->use_lock);
+		spin_lock_init(&ai_context->int_lock);
+		ai_context->number = 0;
+		ai_context->irq = info->irq;
+		init_waitqueue_head(&ai_context->wait_queue);
+		ai_context->board_info = info;
+
+		ai_context->ctrl_reg =
+		    info->me4000_regbase + ME4000_AI_CTRL_REG;
+		ai_context->status_reg =
+		    info->me4000_regbase + ME4000_AI_STATUS_REG;
+		ai_context->channel_list_reg =
+		    info->me4000_regbase + ME4000_AI_CHANNEL_LIST_REG;
+		ai_context->data_reg =
+		    info->me4000_regbase + ME4000_AI_DATA_REG;
+		ai_context->chan_timer_reg =
+		    info->me4000_regbase + ME4000_AI_CHAN_TIMER_REG;
+		ai_context->chan_pre_timer_reg =
+		    info->me4000_regbase + ME4000_AI_CHAN_PRE_TIMER_REG;
+		ai_context->scan_timer_low_reg =
+		    info->me4000_regbase + ME4000_AI_SCAN_TIMER_LOW_REG;
+		ai_context->scan_timer_high_reg =
+		    info->me4000_regbase + ME4000_AI_SCAN_TIMER_HIGH_REG;
+		ai_context->scan_pre_timer_low_reg =
+		    info->me4000_regbase + ME4000_AI_SCAN_PRE_TIMER_LOW_REG;
+		ai_context->scan_pre_timer_high_reg =
+		    info->me4000_regbase + ME4000_AI_SCAN_PRE_TIMER_HIGH_REG;
+		ai_context->start_reg =
+		    info->me4000_regbase + ME4000_AI_START_REG;
+		ai_context->irq_status_reg =
+		    info->me4000_regbase + ME4000_IRQ_STATUS_REG;
+		ai_context->sample_counter_reg =
+		    info->me4000_regbase + ME4000_AI_SAMPLE_COUNTER_REG;
+	}
+
+	return 0;
+}
+
+static int alloc_dio_context(me4000_info_t * info)
+{

drivers/staging/me4000/me4000.c line 972

Quoted 10 lines
drivers/staging/me4000/me4000.c new file +10 -0
+	me4000_dio_context_t *dio_context;
+
+	if (info->board_p->dio.count) {
+		dio_context = kmalloc(sizeof(me4000_dio_context_t), GFP_KERNEL);
+		if (!dio_context) {
+			printk(KERN_ERR
+			       "ME4000:alloc_dio_context():Can't get memory for dio context\n");
+			return -ENOMEM;
+		}
+		memset(dio_context, 0, sizeof(me4000_dio_context_t));

etc

Quoted 26 lines
drivers/staging/me4000/me4000.c new file +26 -0
+		info->dio_context = dio_context;
+
+		spin_lock_init(&dio_context->use_lock);
+		dio_context->board_info = info;
+
+		dio_context->dio_count = info->board_p->dio.count;
+
+		dio_context->dir_reg =
+		    info->me4000_regbase + ME4000_DIO_DIR_REG;
+		dio_context->ctrl_reg =
+		    info->me4000_regbase + ME4000_DIO_CTRL_REG;
+		dio_context->port_0_reg =
+		    info->me4000_regbase + ME4000_DIO_PORT_0_REG;
+		dio_context->port_1_reg =
+		    info->me4000_regbase + ME4000_DIO_PORT_1_REG;
+		dio_context->port_2_reg =
+		    info->me4000_regbase + ME4000_DIO_PORT_2_REG;
+		dio_context->port_3_reg =
+		    info->me4000_regbase + ME4000_DIO_PORT_3_REG;
+	}
+
+	return 0;
+}
+
+static int alloc_cnt_context(me4000_info_t * info)
+{

drivers/staging/me4000/me4000.c line 1009

Quoted 10 lines
drivers/staging/me4000/me4000.c new file +10 -0
+	me4000_cnt_context_t *cnt_context;
+
+	if (info->board_p->cnt.count) {
+		cnt_context = kmalloc(sizeof(me4000_cnt_context_t), GFP_KERNEL);
+		if (!cnt_context) {
+			printk(KERN_ERR
+			       "ME4000:alloc_cnt_context():Can't get memory for cnt context\n");
+			return -ENOMEM;
+		}
+		memset(cnt_context, 0, sizeof(me4000_cnt_context_t));

etc

Quoted 21 lines
drivers/staging/me4000/me4000.c new file +21 -0
+		info->cnt_context = cnt_context;
+
+		spin_lock_init(&cnt_context->use_lock);
+		cnt_context->board_info = info;
+
+		cnt_context->ctrl_reg =
+		    info->timer_regbase + ME4000_CNT_CTRL_REG;
+		cnt_context->counter_0_reg =
+		    info->timer_regbase + ME4000_CNT_COUNTER_0_REG;
+		cnt_context->counter_1_reg =
+		    info->timer_regbase + ME4000_CNT_COUNTER_1_REG;
+		cnt_context->counter_2_reg =
+		    info->timer_regbase + ME4000_CNT_COUNTER_2_REG;
+	}
+
+	return 0;
+}
+
+static int alloc_ext_int_context(me4000_info_t * info)
+{
+	me4000_ext_int_context_t *ext_int_context;

drivers/staging/me4000/me4000.c line 1041

Quoted 10 lines
drivers/staging/me4000/me4000.c new file +10 -0
+
+	if (info->board_p->cnt.count) {
+		ext_int_context =
+		    kmalloc(sizeof(me4000_ext_int_context_t), GFP_KERNEL);
+		if (!ext_int_context) {
+			printk(KERN_ERR
+			       "ME4000:alloc_ext_int_context():Can't get memory for cnt context\n");
+			return -ENOMEM;
+		}
+		memset(ext_int_context, 0, sizeof(me4000_ext_int_context_t));

ho hum

Quoted 104 lines
drivers/staging/me4000/me4000.c new file +104 -0
+		info->ext_int_context = ext_int_context;
+
+		spin_lock_init(&ext_int_context->use_lock);
+		ext_int_context->board_info = info;
+
+		ext_int_context->fasync_ptr = NULL;
+		ext_int_context->irq = info->irq;
+
+		ext_int_context->ctrl_reg =
+		    info->me4000_regbase + ME4000_AI_CTRL_REG;
+		ext_int_context->irq_status_reg =
+		    info->me4000_regbase + ME4000_IRQ_STATUS_REG;
+	}
+
+	return 0;
+}
+
+static int me4000_probe(struct pci_dev *dev, const struct pci_device_id *id)
+{
+	int result = 0;
+	me4000_info_t *board_info;
+
+	CALL_PDEBUG("me4000_probe() is executed\n");
+
+	/* Allocate structure for board context */
+	board_info = kmalloc(sizeof(me4000_info_t), GFP_KERNEL);
+	if (!board_info) {
+		printk(KERN_ERR
+		       "ME4000:Can't get memory for board info structure\n");
+		result = -ENOMEM;
+		goto PROBE_ERROR_1;
+	}
+	memset(board_info, 0, sizeof(me4000_info_t));
+
+	/* Add to global linked list */
+	list_add_tail(&board_info->list, &me4000_board_info_list);
+
+	/* Get the PCI base registers */
+	result = get_registers(dev, board_info);
+	if (result) {
+		printk(KERN_ERR "me4000_probe():Cannot get registers\n");
+		goto PROBE_ERROR_2;
+	}
+
+	/* Enable the device */
+	result = pci_enable_device(dev);
+	if (result < 0) {
+		printk(KERN_ERR "me4000_probe():Cannot enable PCI device\n");
+		goto PROBE_ERROR_2;
+	}
+
+	/* Request the PCI register regions */
+	result = pci_request_regions(dev, ME4000_NAME);
+	if (result < 0) {
+		printk(KERN_ERR "me4000_probe():Cannot request I/O regions\n");
+		goto PROBE_ERROR_2;
+	}
+
+	/* Initialize board info */
+	result = init_board_info(dev, board_info);
+	if (result) {
+		printk(KERN_ERR "me4000_probe():Cannot init baord info\n");
+		goto PROBE_ERROR_3;
+	}
+
+	/* Download the xilinx firmware */
+	result = me4000_xilinx_download(board_info);
+	if (result) {
+		printk(KERN_ERR "me4000_probe:Can't download firmware\n");
+		goto PROBE_ERROR_3;
+	}
+
+	/* Make a hardware reset */
+	result = me4000_reset_board(board_info);
+	if (result) {
+		printk(KERN_ERR "me4000_probe:Can't reset board\n");
+		goto PROBE_ERROR_3;
+	}
+
+	/* Allocate analog output context structures */
+	result = alloc_ao_contexts(board_info);
+	if (result) {
+		printk(KERN_ERR "me4000_probe():Cannot allocate ao contexts\n");
+		goto PROBE_ERROR_3;
+	}
+
+	/* Allocate analog input context */
+	result = alloc_ai_context(board_info);
+	if (result) {
+		printk(KERN_ERR "me4000_probe():Cannot allocate ai context\n");
+		goto PROBE_ERROR_4;
+	}
+
+	/* Allocate digital I/O context */
+	result = alloc_dio_context(board_info);
+	if (result) {
+		printk(KERN_ERR "me4000_probe():Cannot allocate dio context\n");
+		goto PROBE_ERROR_5;
+	}
+
+	/* Allocate counter context */
+	result = alloc_cnt_context(board_info);
+	if (result) {
+		printk(KERN_ERR "me4000_probe():Cannot allocate cnt context\n");

drivers/staging/me4000/me4000.c line 1156

Quoted 10 lines
drivers/staging/me4000/me4000.c new file +10 -0
+		goto PROBE_ERROR_6;
+	}
+
+	/* Allocate external interrupt context */
+	result = alloc_ext_int_context(board_info);
+	if (result) {
+		printk(KERN_ERR
+		       "me4000_probe():Cannot allocate ext_int context\n");
+		goto PROBE_ERROR_7;
+	}

__func__

drivers/staging/me4000/me4000.c line 1160

Quoted 3 lines
drivers/staging/me4000/me4000.c new file +3 -0
+	return 0;
+
+      PROBE_ERROR_7:

indent

Quoted 19 lines
drivers/staging/me4000/me4000.c new file +19 -0
+	kfree(board_info->cnt_context);
+
+      PROBE_ERROR_6:
+	kfree(board_info->dio_context);
+
+      PROBE_ERROR_5:
+	kfree(board_info->ai_context);
+
+      PROBE_ERROR_4:
+	release_ao_contexts(board_info);
+
+      PROBE_ERROR_3:
+	pci_release_regions(dev);
+
+      PROBE_ERROR_2:
+	list_del(&board_info->list);
+	kfree(board_info);
+
+      PROBE_ERROR_1:

drivers/staging/me4000/me4000.c line 1189

Quoted 10 lines
drivers/staging/me4000/me4000.c new file +10 -0
+	return result;
+}
+
+static int me4000_xilinx_download(me4000_info_t * info)
+{
+	int size = 0;
+	u32 value = 0;
+	int idx = 0;
+	unsigned char *firm;
+	wait_queue_head_t queue;

this doesn't do anything

Quoted 582 lines
drivers/staging/me4000/me4000.c new file +582 -0
+
+	CALL_PDEBUG("me4000_xilinx_download() is executed\n");
+
+	init_waitqueue_head(&queue);
+
+	firm = (info->device_id == 0x4610) ? xilinx_firm_4610 : xilinx_firm;
+
+	/*
+	 * Set PLX local interrupt 2 polarity to high.
+	 * Interrupt is thrown by init pin of xilinx.
+	 */
+	outl(0x10, info->plx_regbase + PLX_INTCSR);
+
+	/* Set /CS and /WRITE of the Xilinx */
+	value = inl(info->plx_regbase + PLX_ICR);
+	value |= 0x100;
+	outl(value, info->plx_regbase + PLX_ICR);
+
+	/* Init Xilinx with CS1 */
+	inb(info->program_regbase + 0xC8);
+
+	/* Wait until /INIT pin is set */
+	udelay(20);
+	if (!inl(info->plx_regbase + PLX_INTCSR) & 0x20) {
+		printk(KERN_ERR "me4000_xilinx_download():Can't init Xilinx\n");
+		return -EIO;
+	}
+
+	/* Reset /CS and /WRITE of the Xilinx */
+	value = inl(info->plx_regbase + PLX_ICR);
+	value &= ~0x100;
+	outl(value, info->plx_regbase + PLX_ICR);
+
+	/* Download Xilinx firmware */
+	size = (firm[0] << 24) + (firm[1] << 16) + (firm[2] << 8) + firm[3];
+	udelay(10);
+
+	for (idx = 0; idx < size; idx++) {
+		outb(firm[16 + idx], info->program_regbase);
+
+		udelay(10);
+
+		/* Check if BUSY flag is low */
+		if (inl(info->plx_regbase + PLX_ICR) & 0x20) {
+			printk(KERN_ERR
+			       "me4000_xilinx_download():Xilinx is still busy (idx = %d)\n",
+			       idx);
+			return -EIO;
+		}
+	}
+
+	PDEBUG("me4000_xilinx_download():%d bytes written\n", idx);
+
+	/* If done flag is high download was successful */
+	if (inl(info->plx_regbase + PLX_ICR) & 0x4) {
+		PDEBUG("me4000_xilinx_download():Done flag is set\n");
+		PDEBUG("me4000_xilinx_download():Download was successful\n");
+	} else {
+		printk(KERN_ERR
+		       "ME4000:me4000_xilinx_download():DONE flag is not set\n");
+		printk(KERN_ERR
+		       "ME4000:me4000_xilinx_download():Download not succesful\n");
+		return -EIO;
+	}
+
+	/* Set /CS and /WRITE */
+	value = inl(info->plx_regbase + PLX_ICR);
+	value |= 0x100;
+	outl(value, info->plx_regbase + PLX_ICR);
+
+	return 0;
+}
+
+static int me4000_reset_board(me4000_info_t * info)
+{
+	unsigned long icr;
+
+	CALL_PDEBUG("me4000_reset_board() is executed\n");
+
+	/* Make a hardware reset */
+	icr = me4000_inl(info->plx_regbase + PLX_ICR);
+	icr |= 0x40000000;
+	me4000_outl(icr, info->plx_regbase + PLX_ICR);
+	icr &= ~0x40000000;
+	me4000_outl(icr, info->plx_regbase + PLX_ICR);
+
+	/* Set both stop bits in the analog input control register */
+	me4000_outl(ME4000_AI_CTRL_BIT_IMMEDIATE_STOP | ME4000_AI_CTRL_BIT_STOP,
+		    info->me4000_regbase + ME4000_AI_CTRL_REG);
+
+	/* Set both stop bits in the analog output control register */
+	me4000_outl(ME4000_AO_CTRL_BIT_IMMEDIATE_STOP | ME4000_AO_CTRL_BIT_STOP,
+		    info->me4000_regbase + ME4000_AO_00_CTRL_REG);
+	me4000_outl(ME4000_AO_CTRL_BIT_IMMEDIATE_STOP | ME4000_AO_CTRL_BIT_STOP,
+		    info->me4000_regbase + ME4000_AO_01_CTRL_REG);
+	me4000_outl(ME4000_AO_CTRL_BIT_IMMEDIATE_STOP | ME4000_AO_CTRL_BIT_STOP,
+		    info->me4000_regbase + ME4000_AO_02_CTRL_REG);
+	me4000_outl(ME4000_AO_CTRL_BIT_IMMEDIATE_STOP | ME4000_AO_CTRL_BIT_STOP,
+		    info->me4000_regbase + ME4000_AO_03_CTRL_REG);
+
+	/* 0x8000 to the DACs means an output voltage of 0V */
+	me4000_outl(0x8000, info->me4000_regbase + ME4000_AO_00_SINGLE_REG);
+	me4000_outl(0x8000, info->me4000_regbase + ME4000_AO_01_SINGLE_REG);
+	me4000_outl(0x8000, info->me4000_regbase + ME4000_AO_02_SINGLE_REG);
+	me4000_outl(0x8000, info->me4000_regbase + ME4000_AO_03_SINGLE_REG);
+
+	/* Enable interrupts on the PLX */
+	me4000_outl(0x43, info->plx_regbase + PLX_INTCSR);
+
+	/* Set the adustment register for AO demux */
+	me4000_outl(ME4000_AO_DEMUX_ADJUST_VALUE,
+		    info->me4000_regbase + ME4000_AO_DEMUX_ADJUST_REG);
+
+	/* Set digital I/O direction for port 0 to output on isolated versions */
+	if (!(me4000_inl(info->me4000_regbase + ME4000_DIO_DIR_REG) & 0x1)) {
+		me4000_outl(0x1, info->me4000_regbase + ME4000_DIO_CTRL_REG);
+	}
+
+	return 0;
+}
+
+static int me4000_open(struct inode *inode_p, struct file *file_p)
+{
+	int board, dev, mode;
+	int err = 0;
+	int i;
+	struct list_head *ptr;
+	me4000_info_t *board_info = NULL;
+	me4000_ao_context_t *ao_context = NULL;
+	me4000_ai_context_t *ai_context = NULL;
+	me4000_dio_context_t *dio_context = NULL;
+	me4000_cnt_context_t *cnt_context = NULL;
+	me4000_ext_int_context_t *ext_int_context = NULL;
+
+	CALL_PDEBUG("me4000_open() is executed\n");
+
+	/* Analog output */
+	if (MAJOR(inode_p->i_rdev) == me4000_ao_major_driver_no) {
+		board = AO_BOARD(inode_p->i_rdev);
+		dev = AO_PORT(inode_p->i_rdev);
+		mode = AO_MODE(inode_p->i_rdev);
+
+		PDEBUG("me4000_open():board = %d ao = %d mode = %d\n", board,
+		       dev, mode);
+
+		/* Search for the board context */
+		for (ptr = me4000_board_info_list.next, i = 0;
+		     ptr != &me4000_board_info_list; ptr = ptr->next, i++) {
+			board_info = list_entry(ptr, me4000_info_t, list);
+			if (i == board)
+				break;
+		}
+
+		if (ptr == &me4000_board_info_list) {
+			printk(KERN_ERR
+			       "ME4000:me4000_open():Board %d not in device list\n",
+			       board);
+			return -ENODEV;
+		}
+
+		/* Search for the dac context */
+		for (ptr = board_info->ao_context_list.next, i = 0;
+		     ptr != &board_info->ao_context_list;
+		     ptr = ptr->next, i++) {
+			ao_context = list_entry(ptr, me4000_ao_context_t, list);
+			if (i == dev)
+				break;
+		}
+
+		if (ptr == &board_info->ao_context_list) {
+			printk(KERN_ERR
+			       "ME4000:me4000_open():Device %d not in device list\n",
+			       dev);
+			return -ENODEV;
+		}
+
+		/* Check if mode is valid */
+		if (mode > 2) {
+			printk(KERN_ERR
+			       "ME4000:me4000_open():Mode is not valid\n");
+			return -ENODEV;
+		}
+
+		/* Check if mode is valid for this AO */
+		if ((mode != ME4000_AO_CONV_MODE_SINGLE)
+		    && (dev >= board_info->board_p->ao.fifo_count)) {
+			printk(KERN_ERR
+			       "ME4000:me4000_open():AO %d only in single mode available\n",
+			       dev);
+			return -ENODEV;
+		}
+
+		/* Check if already opened */
+		spin_lock(&ao_context->use_lock);
+		if (ao_context->dac_in_use) {
+			printk(KERN_ERR
+			       "ME4000:me4000_open():AO %d already in use\n",
+			       dev);
+			spin_unlock(&ao_context->use_lock);
+			return -EBUSY;
+		}
+		ao_context->dac_in_use = 1;
+		spin_unlock(&ao_context->use_lock);
+
+		ao_context->mode = mode;
+
+		/* Hold the context in private data */
+		file_p->private_data = ao_context;
+
+		/* Set file operations pointer */
+		file_p->f_op = me4000_ao_fops_array[mode];
+
+		err = me4000_ao_prepare(ao_context);
+		if (err) {
+			ao_context->dac_in_use = 0;
+			return 1;
+		}
+	}
+	/* Analog input */
+	else if (MAJOR(inode_p->i_rdev) == me4000_ai_major_driver_no) {
+		board = AI_BOARD(inode_p->i_rdev);
+		mode = AI_MODE(inode_p->i_rdev);
+
+		PDEBUG("me4000_open():ai board = %d mode = %d\n", board, mode);
+
+		/* Search for the board context */
+		for (ptr = me4000_board_info_list.next, i = 0;
+		     ptr != &me4000_board_info_list; ptr = ptr->next, i++) {
+			board_info = list_entry(ptr, me4000_info_t, list);
+			if (i == board)
+				break;
+		}
+
+		if (ptr == &me4000_board_info_list) {
+			printk(KERN_ERR
+			       "ME4000:me4000_open():Board %d not in device list\n",
+			       board);
+			return -ENODEV;
+		}
+
+		ai_context = board_info->ai_context;
+
+		/* Check if mode is valid */
+		if (mode > 5) {
+			printk(KERN_ERR
+			       "ME4000:me4000_open():Mode is not valid\n");
+			return -EINVAL;
+		}
+
+		/* Check if already opened */
+		spin_lock(&ai_context->use_lock);
+		if (ai_context->in_use) {
+			printk(KERN_ERR
+			       "ME4000:me4000_open():AI already in use\n");
+			spin_unlock(&ai_context->use_lock);
+			return -EBUSY;
+		}
+		ai_context->in_use = 1;
+		spin_unlock(&ai_context->use_lock);
+
+		ai_context->mode = mode;
+
+		/* Hold the context in private data */
+		file_p->private_data = ai_context;
+
+		/* Set file operations pointer */
+		file_p->f_op = me4000_ai_fops_array[mode];
+
+		/* Prepare analog input */
+		me4000_ai_prepare(ai_context);
+	}
+	/* Digital I/O */
+	else if (MAJOR(inode_p->i_rdev) == me4000_dio_major_driver_no) {
+		board = DIO_BOARD(inode_p->i_rdev);
+		dev = 0;
+		mode = 0;
+
+		PDEBUG("me4000_open():board = %d\n", board);
+
+		/* Search for the board context */
+		for (ptr = me4000_board_info_list.next;
+		     ptr != &me4000_board_info_list; ptr = ptr->next) {
+			board_info = list_entry(ptr, me4000_info_t, list);
+			if (board_info->board_count == board)
+				break;
+		}
+
+		if (ptr == &me4000_board_info_list) {
+			printk(KERN_ERR
+			       "ME4000:me4000_open():Board %d not in device list\n",
+			       board);
+			return -ENODEV;
+		}
+
+		/* Search for the dio context */
+		dio_context = board_info->dio_context;
+
+		/* Check if already opened */
+		spin_lock(&dio_context->use_lock);
+		if (dio_context->in_use) {
+			printk(KERN_ERR
+			       "ME4000:me4000_open():DIO already in use\n");
+			spin_unlock(&dio_context->use_lock);
+			return -EBUSY;
+		}
+		dio_context->in_use = 1;
+		spin_unlock(&dio_context->use_lock);
+
+		/* Hold the context in private data */
+		file_p->private_data = dio_context;
+
+		/* Set file operations pointer to single functions */
+		file_p->f_op = &me4000_dio_fops;
+
+		//me4000_dio_reset(dio_context);
+	}
+	/* Counters */
+	else if (MAJOR(inode_p->i_rdev) == me4000_cnt_major_driver_no) {
+		board = CNT_BOARD(inode_p->i_rdev);
+		dev = 0;
+		mode = 0;
+
+		PDEBUG("me4000_open():board = %d\n", board);
+
+		/* Search for the board context */
+		for (ptr = me4000_board_info_list.next;
+		     ptr != &me4000_board_info_list; ptr = ptr->next) {
+			board_info = list_entry(ptr, me4000_info_t, list);
+			if (board_info->board_count == board)
+				break;
+		}
+
+		if (ptr == &me4000_board_info_list) {
+			printk(KERN_ERR
+			       "ME4000:me4000_open():Board %d not in device list\n",
+			       board);
+			return -ENODEV;
+		}
+
+		/* Get the cnt context */
+		cnt_context = board_info->cnt_context;
+
+		/* Check if already opened */
+		spin_lock(&cnt_context->use_lock);
+		if (cnt_context->in_use) {
+			printk(KERN_ERR
+			       "ME4000:me4000_open():CNT already in use\n");
+			spin_unlock(&cnt_context->use_lock);
+			return -EBUSY;
+		}
+		cnt_context->in_use = 1;
+		spin_unlock(&cnt_context->use_lock);
+
+		/* Hold the context in private data */
+		file_p->private_data = cnt_context;
+
+		/* Set file operations pointer to single functions */
+		file_p->f_op = &me4000_cnt_fops;
+	}
+	/* External Interrupt */
+	else if (MAJOR(inode_p->i_rdev) == me4000_ext_int_major_driver_no) {
+		board = EXT_INT_BOARD(inode_p->i_rdev);
+		dev = 0;
+		mode = 0;
+
+		PDEBUG("me4000_open():board = %d\n", board);
+
+		/* Search for the board context */
+		for (ptr = me4000_board_info_list.next;
+		     ptr != &me4000_board_info_list; ptr = ptr->next) {
+			board_info = list_entry(ptr, me4000_info_t, list);
+			if (board_info->board_count == board)
+				break;
+		}
+
+		if (ptr == &me4000_board_info_list) {
+			printk(KERN_ERR
+			       "ME4000:me4000_open():Board %d not in device list\n",
+			       board);
+			return -ENODEV;
+		}
+
+		/* Get the external interrupt context */
+		ext_int_context = board_info->ext_int_context;
+
+		/* Check if already opened */
+		spin_lock(&cnt_context->use_lock);
+		if (ext_int_context->in_use) {
+			printk(KERN_ERR
+			       "ME4000:me4000_open():External interrupt already in use\n");
+			spin_unlock(&ext_int_context->use_lock);
+			return -EBUSY;
+		}
+		ext_int_context->in_use = 1;
+		spin_unlock(&ext_int_context->use_lock);
+
+		/* Hold the context in private data */
+		file_p->private_data = ext_int_context;
+
+		/* Set file operations pointer to single functions */
+		file_p->f_op = &me4000_ext_int_fops;
+
+		/* Request the interrupt line */
+		err =
+		    request_irq(ext_int_context->irq, me4000_ext_int_isr,
+				IRQF_DISABLED | IRQF_SHARED, ME4000_NAME,
+				ext_int_context);
+		if (err) {
+			printk(KERN_ERR
+			       "ME4000:me4000_open():Can't get interrupt line");
+			ext_int_context->in_use = 0;
+			return -ENODEV;
+		}
+
+		/* Reset the counter */
+		me4000_ext_int_disable(ext_int_context);
+	} else {
+		printk(KERN_ERR "ME4000:me4000_open():Major number unknown\n");
+		return -EINVAL;
+	}
+
+	return 0;
+}
+
+static int me4000_release(struct inode *inode_p, struct file *file_p)
+{
+	me4000_ao_context_t *ao_context;
+	me4000_ai_context_t *ai_context;
+	me4000_dio_context_t *dio_context;
+	me4000_cnt_context_t *cnt_context;
+	me4000_ext_int_context_t *ext_int_context;
+
+	CALL_PDEBUG("me4000_release() is executed\n");
+
+	if (MAJOR(inode_p->i_rdev) == me4000_ao_major_driver_no) {
+		ao_context = file_p->private_data;
+
+		/* Mark DAC as unused */
+		ao_context->dac_in_use = 0;
+	} else if (MAJOR(inode_p->i_rdev) == me4000_ai_major_driver_no) {
+		ai_context = file_p->private_data;
+
+		/* Reset the analog input */
+		me4000_ai_reset(ai_context);
+
+		/* Free the interrupt and the circular buffer */
+		if (ai_context->mode) {
+			free_irq(ai_context->irq, ai_context);
+			kfree(ai_context->circ_buf.buf);
+			ai_context->circ_buf.buf = NULL;
+			ai_context->circ_buf.head = 0;
+			ai_context->circ_buf.tail = 0;
+		}
+
+		/* Mark AI as unused */
+		ai_context->in_use = 0;
+	} else if (MAJOR(inode_p->i_rdev) == me4000_dio_major_driver_no) {
+		dio_context = file_p->private_data;
+
+		/* Mark digital I/O as unused */
+		dio_context->in_use = 0;
+	} else if (MAJOR(inode_p->i_rdev) == me4000_cnt_major_driver_no) {
+		cnt_context = file_p->private_data;
+
+		/* Mark counters as unused */
+		cnt_context->in_use = 0;
+	} else if (MAJOR(inode_p->i_rdev) == me4000_ext_int_major_driver_no) {
+		ext_int_context = file_p->private_data;
+
+		/* Disable the externel interrupt */
+		me4000_ext_int_disable(ext_int_context);
+
+		free_irq(ext_int_context->irq, ext_int_context);
+
+		/* Delete the fasync structure and free memory */
+		me4000_ext_int_fasync(0, file_p, 0);
+
+		/* Mark as unused */
+		ext_int_context->in_use = 0;
+	} else {
+		printk(KERN_ERR
+		       "ME4000:me4000_release():Major number unknown\n");
+		return -EINVAL;
+	}
+
+	return 0;
+}
+
+/*------------------------------- Analog output stuff --------------------------------------*/
+
+static int me4000_ao_prepare(me4000_ao_context_t * ao_context)
+{
+	unsigned long flags;
+
+	CALL_PDEBUG("me4000_ao_prepare() is executed\n");
+
+	if (ao_context->mode == ME4000_AO_CONV_MODE_CONTINUOUS) {
+		/* Only do anything if not already in the correct mode */
+		unsigned long mode = me4000_inl(ao_context->ctrl_reg);
+		if ((mode & ME4000_AO_CONV_MODE_CONTINUOUS)
+		    && (mode & ME4000_AO_CTRL_BIT_ENABLE_FIFO)) {
+			return 0;
+		}
+
+		/* Stop any conversion */
+		me4000_ao_immediate_stop(ao_context);
+
+		/* Set the control register to default state  */
+		spin_lock_irqsave(&ao_context->int_lock, flags);
+		me4000_outl(ME4000_AO_CONV_MODE_CONTINUOUS |
+			    ME4000_AO_CTRL_BIT_ENABLE_FIFO |
+			    ME4000_AO_CTRL_BIT_STOP |
+			    ME4000_AO_CTRL_BIT_IMMEDIATE_STOP,
+			    ao_context->ctrl_reg);
+		spin_unlock_irqrestore(&ao_context->int_lock, flags);
+
+		/* Set to fastest sample rate */
+		me4000_outl(65, ao_context->timer_reg);
+	} else if (ao_context->mode == ME4000_AO_CONV_MODE_WRAPAROUND) {
+		/* Only do anything if not already in the correct mode */
+		unsigned long mode = me4000_inl(ao_context->ctrl_reg);
+		if ((mode & ME4000_AO_CONV_MODE_WRAPAROUND)
+		    && (mode & ME4000_AO_CTRL_BIT_ENABLE_FIFO)) {
+			return 0;
+		}
+
+		/* Stop any conversion */
+		me4000_ao_immediate_stop(ao_context);
+
+		/* Set the control register to default state  */
+		spin_lock_irqsave(&ao_context->int_lock, flags);
+		me4000_outl(ME4000_AO_CONV_MODE_WRAPAROUND |
+			    ME4000_AO_CTRL_BIT_ENABLE_FIFO |
+			    ME4000_AO_CTRL_BIT_STOP |
+			    ME4000_AO_CTRL_BIT_IMMEDIATE_STOP,
+			    ao_context->ctrl_reg);
+		spin_unlock_irqrestore(&ao_context->int_lock, flags);
+
+		/* Set to fastest sample rate */
+		me4000_outl(65, ao_context->timer_reg);
+	} else if (ao_context->mode == ME4000_AO_CONV_MODE_SINGLE) {
+		/* Only do anything if not already in the correct mode */
+		unsigned long mode = me4000_inl(ao_context->ctrl_reg);
+		if (!
+		    (mode &
+		     (ME4000_AO_CONV_MODE_WRAPAROUND |
+		      ME4000_AO_CONV_MODE_CONTINUOUS))) {
+			return 0;
+		}
+
+		/* Stop any conversion */
+		me4000_ao_immediate_stop(ao_context);
+
+		/* Clear the control register */
+		spin_lock_irqsave(&ao_context->int_lock, flags);
+		me4000_outl(0x0, ao_context->ctrl_reg);
+		spin_unlock_irqrestore(&ao_context->int_lock, flags);
+
+		/* Set voltage to 0V */
+		me4000_outl(0x8000, ao_context->single_reg);
+	} else {
+		printk(KERN_ERR
+		       "ME4000:me4000_ao_prepare():Invalid mode specified\n");
+		return -EINVAL;
+	}
+
+	return 0;
+}
+
+static int me4000_ao_reset(me4000_ao_context_t * ao_context)
+{
+	u32 tmp;
+	wait_queue_head_t queue;
+	unsigned long flags;
+
+	CALL_PDEBUG("me4000_ao_reset() is executed\n");
+
+	init_waitqueue_head(&queue);
+
+	if (ao_context->mode == ME4000_AO_CONV_MODE_WRAPAROUND) {
+		/*
+		 * First stop conversion of the DAC before reconfigure.

drivers/staging/me4000/me4000.c line 1781

Quoted 10 lines
drivers/staging/me4000/me4000.c new file +10 -0
+		 * This is essantial, cause of the state machine.
+		 * If not stopped before configuring mode, it could
+		 * walk in a undefined state.
+		 */
+		tmp = me4000_inl(ao_context->ctrl_reg);
+		tmp |= ME4000_AO_CTRL_BIT_IMMEDIATE_STOP;
+		me4000_outl(tmp, ao_context->ctrl_reg);
+
+		while (inl(ao_context->status_reg) & ME4000_AO_STATUS_BIT_FSM) {
+			sleep_on_timeout(&queue, 1);

whee

Quoted 79 lines
drivers/staging/me4000/me4000.c new file +79 -0
+		}
+
+		/* Set to transparent mode */
+		me4000_ao_simultaneous_disable(ao_context);
+
+		/* Set to single mode in order to set default voltage */
+		me4000_outl(0x0, ao_context->ctrl_reg);
+
+		/* Set voltage to 0V */
+		me4000_outl(0x8000, ao_context->single_reg);
+
+		/* Set to fastest sample rate */
+		me4000_outl(65, ao_context->timer_reg);
+
+		/* Set the original mode and enable FIFO */
+		me4000_outl(ME4000_AO_CONV_MODE_WRAPAROUND |
+			    ME4000_AO_CTRL_BIT_ENABLE_FIFO |
+			    ME4000_AO_CTRL_BIT_STOP |
+			    ME4000_AO_CTRL_BIT_IMMEDIATE_STOP,
+			    ao_context->ctrl_reg);
+	} else if (ao_context->mode == ME4000_AO_CONV_MODE_CONTINUOUS) {
+		/*
+		 * First stop conversion of the DAC before reconfigure.
+		 * This is essantial, cause of the state machine.
+		 * If not stopped before configuring mode, it could
+		 * walk in a undefined state.
+		 */
+		spin_lock_irqsave(&ao_context->int_lock, flags);
+		tmp = me4000_inl(ao_context->ctrl_reg);
+		tmp |= ME4000_AO_CTRL_BIT_STOP;
+		me4000_outl(tmp, ao_context->ctrl_reg);
+		spin_unlock_irqrestore(&ao_context->int_lock, flags);
+
+		while (inl(ao_context->status_reg) & ME4000_AO_STATUS_BIT_FSM) {
+			sleep_on_timeout(&queue, 1);
+		}
+
+		/* Clear the circular buffer */
+		ao_context->circ_buf.head = 0;
+		ao_context->circ_buf.tail = 0;
+
+		/* Set to transparent mode */
+		me4000_ao_simultaneous_disable(ao_context);
+
+		/* Set to single mode in order to set default voltage */
+		spin_lock_irqsave(&ao_context->int_lock, flags);
+		tmp = me4000_inl(ao_context->ctrl_reg);
+		me4000_outl(0x0, ao_context->ctrl_reg);
+
+		/* Set voltage to 0V */
+		me4000_outl(0x8000, ao_context->single_reg);
+
+		/* Set to fastest sample rate */
+		me4000_outl(65, ao_context->timer_reg);
+
+		/* Set the original mode and enable FIFO */
+		me4000_outl(ME4000_AO_CONV_MODE_CONTINUOUS |
+			    ME4000_AO_CTRL_BIT_ENABLE_FIFO |
+			    ME4000_AO_CTRL_BIT_STOP |
+			    ME4000_AO_CTRL_BIT_IMMEDIATE_STOP,
+			    ao_context->ctrl_reg);
+		spin_unlock_irqrestore(&ao_context->int_lock, flags);
+	} else {
+		/* Set to transparent mode */
+		me4000_ao_simultaneous_disable(ao_context);
+
+		/* Set voltage to 0V */
+		me4000_outl(0x8000, ao_context->single_reg);
+	}
+
+	return 0;
+}
+
+static ssize_t me4000_ao_write_sing(struct file *filep, const char *buff,
+				    size_t cnt, loff_t * offp)
+{
+	me4000_ao_context_t *ao_context = filep->private_data;
+	u32 value;
+	const u16 *buffer = (const u16 *)buff;

drivers/staging/me4000/me4000.c line 1870

Quoted 10 lines
drivers/staging/me4000/me4000.c new file +10 -0
+
+	CALL_PDEBUG("me4000_ao_write_sing() is executed\n");
+
+	if (cnt != 2) {
+		printk(KERN_ERR
+		       "me4000_ao_write_sing():Write count is not 2\n");
+		return -EINVAL;
+	}
+
+	if (get_user(value, buffer)) {

eh?

Quoted 309 lines
drivers/staging/me4000/me4000.c new file +309 -0
+		printk(KERN_ERR
+		       "me4000_ao_write_sing():Cannot copy data from user\n");
+		return -EFAULT;
+	}
+
+	me4000_outl(value, ao_context->single_reg);
+
+	return 2;
+}
+
+static ssize_t me4000_ao_write_wrap(struct file *filep, const char *buff,
+				    size_t cnt, loff_t * offp)
+{
+	me4000_ao_context_t *ao_context = filep->private_data;
+	size_t i;
+	u32 value;
+	u32 tmp;
+	const u16 *buffer = (const u16 *)buff;
+	size_t count = cnt / 2;
+
+	CALL_PDEBUG("me4000_ao_write_wrap() is executed\n");
+
+	/* Check if a conversion is already running */
+	if (inl(ao_context->status_reg) & ME4000_AO_STATUS_BIT_FSM) {
+		printk(KERN_ERR
+		       "ME4000:me4000_ao_write_wrap():There is already a conversion running\n");
+		return -EBUSY;
+	}
+
+	if (count > ME4000_AO_FIFO_COUNT) {
+		printk(KERN_ERR
+		       "me4000_ao_write_wrap():Can't load more than %d values\n",
+		       ME4000_AO_FIFO_COUNT);
+		return -ENOSPC;
+	}
+
+	/* Reset the FIFO */
+	tmp = inl(ao_context->ctrl_reg);
+	tmp &= ~ME4000_AO_CTRL_BIT_ENABLE_FIFO;
+	outl(tmp, ao_context->ctrl_reg);
+	tmp |= ME4000_AO_CTRL_BIT_ENABLE_FIFO;
+	outl(tmp, ao_context->ctrl_reg);
+
+	for (i = 0; i < count; i++) {
+		if (get_user(value, buffer + i)) {
+			printk(KERN_ERR
+			       "me4000_ao_write_single():Cannot copy data from user\n");
+			return -EFAULT;
+		}
+		if (((ao_context->fifo_reg & 0xFF) == ME4000_AO_01_FIFO_REG)
+		    || ((ao_context->fifo_reg & 0xFF) == ME4000_AO_03_FIFO_REG))
+			value = value << 16;
+		outl(value, ao_context->fifo_reg);
+	}
+	CALL_PDEBUG("me4000_ao_write_wrap() is leaved with %d\n", i * 2);
+
+	return i * 2;
+}
+
+static ssize_t me4000_ao_write_cont(struct file *filep, const char *buff,
+				    size_t cnt, loff_t * offp)
+{
+	me4000_ao_context_t *ao_context = filep->private_data;
+	const u16 *buffer = (const u16 *)buff;
+	size_t count = cnt / 2;
+	unsigned long flags;
+	u32 tmp;
+	int c = 0;
+	int k = 0;
+	int ret = 0;
+	u16 svalue;
+	u32 lvalue;
+	int i;
+	wait_queue_head_t queue;
+
+	CALL_PDEBUG("me4000_ao_write_cont() is executed\n");
+
+	init_waitqueue_head(&queue);
+
+	/* Check count */
+	if (count <= 0) {
+		PDEBUG("me4000_ao_write_cont():Count is 0\n");
+		return 0;
+	}
+
+	if (filep->f_flags & O_APPEND) {
+		PDEBUG("me4000_ao_write_cont():Append data to data stream\n");
+		while (count > 0) {
+			if (filep->f_flags & O_NONBLOCK) {
+				if (ao_context->pipe_flag) {
+					printk(KERN_ERR
+					       "ME4000:me4000_ao_write_cont():Broken pipe in nonblocking write\n");
+					return -EPIPE;
+				}
+				c = me4000_space_to_end(ao_context->circ_buf,
+							ME4000_AO_BUFFER_COUNT);
+				if (!c) {
+					PDEBUG
+					    ("me4000_ao_write_cont():Returning from nonblocking write\n");
+					break;
+				}
+			} else {
+				wait_event_interruptible(ao_context->wait_queue,
+							 (c =
+							  me4000_space_to_end
+							  (ao_context->circ_buf,
+							   ME4000_AO_BUFFER_COUNT)));
+				if (ao_context->pipe_flag) {
+					printk(KERN_ERR
+					       "me4000_ao_write_cont():Broken pipe in blocking write\n");
+					return -EPIPE;
+				}
+				if (signal_pending(current)) {
+					printk(KERN_ERR
+					       "me4000_ao_write_cont():Wait for free buffer interrupted from signal\n");
+					return -EINTR;
+				}
+			}
+
+			PDEBUG("me4000_ao_write_cont():Space to end = %d\n", c);
+
+			/* Only able to write size of free buffer or size of count */
+			if (count < c)
+				c = count;
+
+			k = 2 * c;
+			k -= copy_from_user(ao_context->circ_buf.buf +
+					    ao_context->circ_buf.head, buffer,
+					    k);
+			c = k / 2;
+			PDEBUG
+			    ("me4000_ao_write_cont():Copy %d values from user space\n",
+			     c);
+
+			if (!c)
+				return -EFAULT;
+
+			ao_context->circ_buf.head =
+			    (ao_context->circ_buf.head +
+			     c) & (ME4000_AO_BUFFER_COUNT - 1);
+			buffer += c;
+			count -= c;
+			ret += c;
+
+			/* Values are now available so enable interrupts */
+			spin_lock_irqsave(&ao_context->int_lock, flags);
+			if (me4000_buf_count
+			    (ao_context->circ_buf, ME4000_AO_BUFFER_COUNT)) {
+				tmp = me4000_inl(ao_context->ctrl_reg);
+				tmp |= ME4000_AO_CTRL_BIT_ENABLE_IRQ;
+				me4000_outl(tmp, ao_context->ctrl_reg);
+			}
+			spin_unlock_irqrestore(&ao_context->int_lock, flags);
+		}
+
+		/* Wait until the state machine is stopped if O_SYNC is set */
+		if (filep->f_flags & O_SYNC) {
+			while (inl(ao_context->status_reg) &
+			       ME4000_AO_STATUS_BIT_FSM) {
+				interruptible_sleep_on_timeout(&queue, 1);
+				if (ao_context->pipe_flag) {
+					PDEBUG
+					    ("me4000_ao_write_cont():Broken pipe detected after sync\n");
+					return -EPIPE;
+				}
+				if (signal_pending(current)) {
+					printk(KERN_ERR
+					       "me4000_ao_write_cont():Wait on state machine after sync interrupted\n");
+					return -EINTR;
+				}
+			}
+		}
+	} else {
+		PDEBUG("me4000_ao_write_cont():Preload DAC FIFO\n");
+		if ((me4000_inl(ao_context->status_reg) &
+		     ME4000_AO_STATUS_BIT_FSM)) {
+			printk(KERN_ERR
+			       "me4000_ao_write_cont():Can't Preload DAC FIFO while conversion is running\n");
+			return -EBUSY;
+		}
+
+		/* Clear the FIFO */
+		spin_lock_irqsave(&ao_context->int_lock, flags);
+		tmp = me4000_inl(ao_context->ctrl_reg);
+		tmp &=
+		    ~(ME4000_AO_CTRL_BIT_ENABLE_FIFO |
+		      ME4000_AO_CTRL_BIT_ENABLE_IRQ);
+		me4000_outl(tmp, ao_context->ctrl_reg);
+		tmp |= ME4000_AO_CTRL_BIT_ENABLE_FIFO;
+		me4000_outl(tmp, ao_context->ctrl_reg);
+		spin_unlock_irqrestore(&ao_context->int_lock, flags);
+
+		/* Clear the circular buffer */
+		ao_context->circ_buf.head = 0;
+		ao_context->circ_buf.tail = 0;
+
+		/* Reset the broken pipe flag */
+		ao_context->pipe_flag = 0;
+
+		/* Only able to write size of fifo or count */
+		c = ME4000_AO_FIFO_COUNT;
+		if (count < c)
+			c = count;
+
+		PDEBUG
+		    ("me4000_ao_write_cont():Write %d values to DAC on 0x%lX\n",
+		     c, ao_context->fifo_reg);
+
+		/* Write values to the fifo */
+		for (i = 0; i < c; i++) {
+			if (get_user(svalue, buffer))
+				return -EFAULT;
+
+			if (((ao_context->fifo_reg & 0xFF) ==
+			     ME4000_AO_01_FIFO_REG)
+			    || ((ao_context->fifo_reg & 0xFF) ==
+				ME4000_AO_03_FIFO_REG)) {
+				lvalue = ((u32) svalue) << 16;
+			} else
+				lvalue = (u32) svalue;
+
+			outl(lvalue, ao_context->fifo_reg);
+			buffer++;
+		}
+		count -= c;
+		ret += c;
+
+		while (1) {
+			/* Get free buffer */
+			c = me4000_space_to_end(ao_context->circ_buf,
+						ME4000_AO_BUFFER_COUNT);
+
+			if (c == 0)
+				return (2 * ret);
+
+			/* Only able to write size of free buffer or size of count */
+			if (count < c)
+				c = count;
+
+			/* If count = 0 return to user */
+			if (c <= 0) {
+				PDEBUG
+				    ("me4000_ao_write_cont():Count reached 0\n");
+				break;
+			}
+
+			k = 2 * c;
+			k -= copy_from_user(ao_context->circ_buf.buf +
+					    ao_context->circ_buf.head, buffer,
+					    k);
+			c = k / 2;
+			PDEBUG
+			    ("me4000_ao_write_cont():Wrote %d values to buffer\n",
+			     c);
+
+			if (!c)
+				return -EFAULT;
+
+			ao_context->circ_buf.head =
+			    (ao_context->circ_buf.head +
+			     c) & (ME4000_AO_BUFFER_COUNT - 1);
+			buffer += c;
+			count -= c;
+			ret += c;
+
+			/* If values in the buffer are available so enable interrupts */
+			spin_lock_irqsave(&ao_context->int_lock, flags);
+			if (me4000_buf_count
+			    (ao_context->circ_buf, ME4000_AO_BUFFER_COUNT)) {
+				PDEBUG
+				    ("me4000_ao_write_cont():Enable Interrupts\n");
+				tmp = me4000_inl(ao_context->ctrl_reg);
+				tmp |= ME4000_AO_CTRL_BIT_ENABLE_IRQ;
+				me4000_outl(tmp, ao_context->ctrl_reg);
+			}
+			spin_unlock_irqrestore(&ao_context->int_lock, flags);
+		}
+	}
+
+	if (filep->f_flags & O_NONBLOCK) {
+		return (ret == 0) ? -EAGAIN : 2 * ret;
+	}
+
+	return 2 * ret;
+}
+
+static unsigned int me4000_ao_poll_cont(struct file *file_p, poll_table * wait)
+{
+	me4000_ao_context_t *ao_context;
+	unsigned long mask = 0;
+
+	CALL_PDEBUG("me4000_ao_poll_cont() is executed\n");
+
+	ao_context = file_p->private_data;
+
+	poll_wait(file_p, &ao_context->wait_queue, wait);
+
+	/* Get free buffer */
+	if (me4000_space_to_end(ao_context->circ_buf, ME4000_AO_BUFFER_COUNT))
+		mask |= POLLOUT | POLLWRNORM;
+
+	CALL_PDEBUG("me4000_ao_poll_cont():Return mask %lX\n", mask);
+
+	return mask;
+}
+
+static int me4000_ao_fsync_cont(struct file *file_p, struct dentry *dentry_p,
+				int datasync)
+{

drivers/staging/me4000/me4000.c line 2189

Quoted 10 lines
drivers/staging/me4000/me4000.c new file +10 -0
+	me4000_ao_context_t *ao_context;
+	wait_queue_head_t queue;
+
+	CALL_PDEBUG("me4000_ao_fsync_cont() is executed\n");
+
+	ao_context = file_p->private_data;
+	init_waitqueue_head(&queue);
+
+	while (inl(ao_context->status_reg) & ME4000_AO_STATUS_BIT_FSM) {
+		interruptible_sleep_on_timeout(&queue, 1);

remove all sleep_on()s

Quoted 176 lines
drivers/staging/me4000/me4000.c new file +176 -0
+		if (ao_context->pipe_flag) {
+			printk(KERN_ERR
+			       "me4000_ao_fsync_cont():Broken pipe detected\n");
+			return -EPIPE;
+		}
+
+		if (signal_pending(current)) {
+			printk(KERN_ERR
+			       "me4000_ao_fsync_cont():Wait on state machine interrupted\n");
+			return -EINTR;
+		}
+	}
+
+	return 0;
+}
+
+static int me4000_ao_ioctl_sing(struct inode *inode_p, struct file *file_p,
+				unsigned int service, unsigned long arg)
+{
+	me4000_ao_context_t *ao_context;
+
+	CALL_PDEBUG("me4000_ao_ioctl_sing() is executed\n");
+
+	ao_context = file_p->private_data;
+
+	if (_IOC_TYPE(service) != ME4000_MAGIC) {
+		return -ENOTTY;
+		PDEBUG("me4000_ao_ioctl_sing():Wrong magic number\n");
+	}
+
+	switch (service) {
+	case ME4000_AO_EX_TRIG_SETUP:
+		return me4000_ao_ex_trig_set_edge((int *)arg, ao_context);
+	case ME4000_AO_EX_TRIG_ENABLE:
+		return me4000_ao_ex_trig_enable(ao_context);
+	case ME4000_AO_EX_TRIG_DISABLE:
+		return me4000_ao_ex_trig_disable(ao_context);
+	case ME4000_AO_PRELOAD:
+		return me4000_ao_preload(ao_context);
+	case ME4000_AO_PRELOAD_UPDATE:
+		return me4000_ao_preload_update(ao_context);
+	case ME4000_GET_USER_INFO:
+		return me4000_get_user_info((me4000_user_info_t *) arg,
+					    ao_context->board_info);
+	case ME4000_AO_SIMULTANEOUS_EX_TRIG:
+		return me4000_ao_simultaneous_ex_trig(ao_context);
+	case ME4000_AO_SIMULTANEOUS_SW:
+		return me4000_ao_simultaneous_sw(ao_context);
+	case ME4000_AO_SIMULTANEOUS_DISABLE:
+		return me4000_ao_simultaneous_disable(ao_context);
+	case ME4000_AO_SIMULTANEOUS_UPDATE:
+		return
+		    me4000_ao_simultaneous_update((me4000_ao_channel_list_t *)
+						  arg, ao_context);
+	case ME4000_AO_EX_TRIG_TIMEOUT:
+		return me4000_ao_ex_trig_timeout((unsigned long *)arg,
+						 ao_context);
+	case ME4000_AO_DISABLE_DO:
+		return me4000_ao_disable_do(ao_context);
+	default:
+		printk(KERN_ERR
+		       "me4000_ao_ioctl_sing():Service number invalid\n");
+		return -ENOTTY;
+	}
+
+	return 0;
+}
+
+static int me4000_ao_ioctl_wrap(struct inode *inode_p, struct file *file_p,
+				unsigned int service, unsigned long arg)
+{
+	me4000_ao_context_t *ao_context;
+
+	CALL_PDEBUG("me4000_ao_ioctl_wrap() is executed\n");
+
+	ao_context = file_p->private_data;
+
+	if (_IOC_TYPE(service) != ME4000_MAGIC) {
+		return -ENOTTY;
+		PDEBUG("me4000_ao_ioctl_wrap():Wrong magic number\n");
+	}
+
+	switch (service) {
+	case ME4000_AO_START:
+		return me4000_ao_start((unsigned long *)arg, ao_context);
+	case ME4000_AO_STOP:
+		return me4000_ao_stop(ao_context);
+	case ME4000_AO_IMMEDIATE_STOP:
+		return me4000_ao_immediate_stop(ao_context);
+	case ME4000_AO_RESET:
+		return me4000_ao_reset(ao_context);
+	case ME4000_AO_TIMER_SET_DIVISOR:
+		return me4000_ao_timer_set_divisor((u32 *) arg, ao_context);
+	case ME4000_AO_EX_TRIG_SETUP:
+		return me4000_ao_ex_trig_set_edge((int *)arg, ao_context);
+	case ME4000_AO_EX_TRIG_ENABLE:
+		return me4000_ao_ex_trig_enable(ao_context);
+	case ME4000_AO_EX_TRIG_DISABLE:
+		return me4000_ao_ex_trig_disable(ao_context);
+	case ME4000_GET_USER_INFO:
+		return me4000_get_user_info((me4000_user_info_t *) arg,
+					    ao_context->board_info);
+	case ME4000_AO_FSM_STATE:
+		return me4000_ao_fsm_state((int *)arg, ao_context);
+	case ME4000_AO_ENABLE_DO:
+		return me4000_ao_enable_do(ao_context);
+	case ME4000_AO_DISABLE_DO:
+		return me4000_ao_disable_do(ao_context);
+	case ME4000_AO_SYNCHRONOUS_EX_TRIG:
+		return me4000_ao_synchronous_ex_trig(ao_context);
+	case ME4000_AO_SYNCHRONOUS_SW:
+		return me4000_ao_synchronous_sw(ao_context);
+	case ME4000_AO_SYNCHRONOUS_DISABLE:
+		return me4000_ao_synchronous_disable(ao_context);
+	default:
+		return -ENOTTY;
+	}
+	return 0;
+}
+
+static int me4000_ao_ioctl_cont(struct inode *inode_p, struct file *file_p,
+				unsigned int service, unsigned long arg)
+{
+	me4000_ao_context_t *ao_context;
+
+	CALL_PDEBUG("me4000_ao_ioctl_cont() is executed\n");
+
+	ao_context = file_p->private_data;
+
+	if (_IOC_TYPE(service) != ME4000_MAGIC) {
+		return -ENOTTY;
+		PDEBUG("me4000_ao_ioctl_cont():Wrong magic number\n");
+	}
+
+	switch (service) {
+	case ME4000_AO_START:
+		return me4000_ao_start((unsigned long *)arg, ao_context);
+	case ME4000_AO_STOP:
+		return me4000_ao_stop(ao_context);
+	case ME4000_AO_IMMEDIATE_STOP:
+		return me4000_ao_immediate_stop(ao_context);
+	case ME4000_AO_RESET:
+		return me4000_ao_reset(ao_context);
+	case ME4000_AO_TIMER_SET_DIVISOR:
+		return me4000_ao_timer_set_divisor((u32 *) arg, ao_context);
+	case ME4000_AO_EX_TRIG_SETUP:
+		return me4000_ao_ex_trig_set_edge((int *)arg, ao_context);
+	case ME4000_AO_EX_TRIG_ENABLE:
+		return me4000_ao_ex_trig_enable(ao_context);
+	case ME4000_AO_EX_TRIG_DISABLE:
+		return me4000_ao_ex_trig_disable(ao_context);
+	case ME4000_AO_ENABLE_DO:
+		return me4000_ao_enable_do(ao_context);
+	case ME4000_AO_DISABLE_DO:
+		return me4000_ao_disable_do(ao_context);
+	case ME4000_AO_FSM_STATE:
+		return me4000_ao_fsm_state((int *)arg, ao_context);
+	case ME4000_GET_USER_INFO:
+		return me4000_get_user_info((me4000_user_info_t *) arg,
+					    ao_context->board_info);
+	case ME4000_AO_SYNCHRONOUS_EX_TRIG:
+		return me4000_ao_synchronous_ex_trig(ao_context);
+	case ME4000_AO_SYNCHRONOUS_SW:
+		return me4000_ao_synchronous_sw(ao_context);
+	case ME4000_AO_SYNCHRONOUS_DISABLE:
+		return me4000_ao_synchronous_disable(ao_context);
+	case ME4000_AO_GET_FREE_BUFFER:
+		return me4000_ao_get_free_buffer((unsigned long *)arg,
+						 ao_context);
+	default:
+		return -ENOTTY;
+	}
+	return 0;
+}
+
+static int me4000_ao_start(unsigned long *arg, me4000_ao_context_t * ao_context)

drivers/staging/me4000/me4000.c line 2375

Quoted 10 lines
drivers/staging/me4000/me4000.c new file +10 -0
+{
+	u32 tmp;
+	wait_queue_head_t queue;
+	unsigned long ref;
+	unsigned long timeout;
+	unsigned long flags;
+
+	CALL_PDEBUG("me4000_ao_start() is executed\n");
+
+	if (get_user(timeout, arg)) {

?

Quoted 145 lines
drivers/staging/me4000/me4000.c new file +145 -0
+		printk(KERN_ERR
+		       "me4000_ao_start():Cannot copy data from user\n");
+		return -EFAULT;
+	}
+
+	init_waitqueue_head(&queue);
+
+	spin_lock_irqsave(&ao_context->int_lock, flags);
+	tmp = inl(ao_context->ctrl_reg);
+	tmp &= ~(ME4000_AO_CTRL_BIT_STOP | ME4000_AO_CTRL_BIT_IMMEDIATE_STOP);
+	me4000_outl(tmp, ao_context->ctrl_reg);
+	spin_unlock_irqrestore(&ao_context->int_lock, flags);
+
+	if ((tmp & ME4000_AO_CTRL_BIT_ENABLE_EX_TRIG)) {
+		if (timeout) {
+			ref = jiffies;
+			while (!
+			       (inl(ao_context->status_reg) &
+				ME4000_AO_STATUS_BIT_FSM)) {
+				interruptible_sleep_on_timeout(&queue, 1);
+				if (signal_pending(current)) {
+					printk(KERN_ERR
+					       "ME4000:me4000_ao_start():Wait on start of state machine interrupted\n");
+					return -EINTR;
+				}
+				if (((jiffies - ref) > (timeout * HZ / USER_HZ))) {	// 2.6 has diffrent definitions for HZ in user and kernel space
+					printk(KERN_ERR
+					       "ME4000:me4000_ao_start():Timeout reached\n");
+					return -EIO;
+				}
+			}
+		}
+	} else {
+		me4000_outl(0x8000, ao_context->single_reg);
+	}
+
+	return 0;
+}
+
+static int me4000_ao_stop(me4000_ao_context_t * ao_context)
+{
+	u32 tmp;
+	wait_queue_head_t queue;
+	unsigned long flags;
+
+	init_waitqueue_head(&queue);
+
+	CALL_PDEBUG("me4000_ao_stop() is executed\n");
+
+	/* Set the stop bit */
+	spin_lock_irqsave(&ao_context->int_lock, flags);
+	tmp = inl(ao_context->ctrl_reg);
+	tmp |= ME4000_AO_CTRL_BIT_STOP;
+	me4000_outl(tmp, ao_context->ctrl_reg);
+	spin_unlock_irqrestore(&ao_context->int_lock, flags);
+
+	while (inl(ao_context->status_reg) & ME4000_AO_STATUS_BIT_FSM) {
+		interruptible_sleep_on_timeout(&queue, 1);
+		if (signal_pending(current)) {
+			printk(KERN_ERR
+			       "me4000_ao_stop():Wait on state machine after stop interrupted\n");
+			return -EINTR;
+		}
+	}
+
+	/* Clear the stop bit */
+	//tmp &= ~ME4000_AO_CTRL_BIT_STOP;
+	//me4000_outl(tmp, ao_context->ctrl_reg);
+
+	return 0;
+}
+
+static int me4000_ao_immediate_stop(me4000_ao_context_t * ao_context)
+{
+	u32 tmp;
+	wait_queue_head_t queue;
+	unsigned long flags;
+
+	init_waitqueue_head(&queue);
+
+	CALL_PDEBUG("me4000_ao_immediate_stop() is executed\n");
+
+	spin_lock_irqsave(&ao_context->int_lock, flags);
+	tmp = inl(ao_context->ctrl_reg);
+	tmp |= ME4000_AO_CTRL_BIT_STOP | ME4000_AO_CTRL_BIT_IMMEDIATE_STOP;
+	me4000_outl(tmp, ao_context->ctrl_reg);
+	spin_unlock_irqrestore(&ao_context->int_lock, flags);
+
+	while (inl(ao_context->status_reg) & ME4000_AO_STATUS_BIT_FSM) {
+		interruptible_sleep_on_timeout(&queue, 1);
+		if (signal_pending(current)) {
+			printk(KERN_ERR
+			       "me4000_ao_immediate_stop():Wait on state machine after stop interrupted\n");
+			return -EINTR;
+		}
+	}
+
+	/* Clear the stop bits */
+	//tmp &= ~(ME4000_AO_CTRL_BIT_STOP | ME4000_AO_CTRL_BIT_IMMEDIATE_STOP);
+	//me4000_outl(tmp, ao_context->ctrl_reg);
+
+	return 0;
+}
+
+static int me4000_ao_timer_set_divisor(u32 * arg,
+				       me4000_ao_context_t * ao_context)
+{
+	u32 divisor;
+	u32 tmp;
+
+	CALL_PDEBUG("me4000_ao_timer set_divisor() is executed\n");
+
+	if (get_user(divisor, arg))
+		return -EFAULT;
+
+	/* Check if the state machine is stopped */
+	tmp = me4000_inl(ao_context->status_reg);
+	if (tmp & ME4000_AO_STATUS_BIT_FSM) {
+		printk(KERN_ERR
+		       "me4000_ao_timer_set_divisor():Can't set timer while DAC is running\n");
+		return -EBUSY;
+	}
+
+	PDEBUG("me4000_ao_timer set_divisor():Divisor from user = %d\n",
+	       divisor);
+
+	/* Check if the divisor is right. ME4000_AO_MIN_TICKS is the lowest */
+	if (divisor < ME4000_AO_MIN_TICKS) {
+		printk(KERN_ERR
+		       "ME4000:me4000_ao_timer set_divisor():Divisor to low\n");
+		return -EINVAL;
+	}
+
+	/* Fix bug in Firmware */
+	divisor -= 2;
+
+	PDEBUG("me4000_ao_timer set_divisor():Divisor to HW = %d\n", divisor);
+
+	/* Write the divisor */
+	me4000_outl(divisor, ao_context->timer_reg);
+
+	return 0;
+}
+
+static int me4000_ao_ex_trig_set_edge(int *arg,

drivers/staging/me4000/me4000.c line 2530

Quoted 10 lines
drivers/staging/me4000/me4000.c new file +10 -0
+				      me4000_ao_context_t * ao_context)
+{
+	int mode;
+	u32 tmp;
+	unsigned long flags;
+
+	CALL_PDEBUG("me4000_ao_ex_trig_set_edge() is executed\n");
+
+	if (get_user(mode, arg))
+		return -EFAULT;

?

Quoted 205 lines
drivers/staging/me4000/me4000.c new file +205 -0
+	/* Check if the state machine is stopped */
+	tmp = me4000_inl(ao_context->status_reg);
+	if (tmp & ME4000_AO_STATUS_BIT_FSM) {
+		printk(KERN_ERR
+		       "me4000_ao_ex_trig_set_edge():Can't set trigger while DAC is running\n");
+		return -EBUSY;
+	}
+
+	if (mode == ME4000_AO_TRIGGER_EXT_EDGE_RISING) {
+		spin_lock_irqsave(&ao_context->int_lock, flags);
+		tmp = me4000_inl(ao_context->ctrl_reg);
+		tmp &=
+		    ~(ME4000_AO_CTRL_BIT_EX_TRIG_EDGE |
+		      ME4000_AO_CTRL_BIT_EX_TRIG_BOTH);
+		me4000_outl(tmp, ao_context->ctrl_reg);
+		spin_unlock_irqrestore(&ao_context->int_lock, flags);
+	} else if (mode == ME4000_AO_TRIGGER_EXT_EDGE_FALLING) {
+		spin_lock_irqsave(&ao_context->int_lock, flags);
+		tmp = me4000_inl(ao_context->ctrl_reg);
+		tmp &= ~ME4000_AO_CTRL_BIT_EX_TRIG_BOTH;
+		tmp |= ME4000_AO_CTRL_BIT_EX_TRIG_EDGE;
+		me4000_outl(tmp, ao_context->ctrl_reg);
+		spin_unlock_irqrestore(&ao_context->int_lock, flags);
+	} else if (mode == ME4000_AO_TRIGGER_EXT_EDGE_BOTH) {
+		spin_lock_irqsave(&ao_context->int_lock, flags);
+		tmp = me4000_inl(ao_context->ctrl_reg);
+		tmp |=
+		    ME4000_AO_CTRL_BIT_EX_TRIG_EDGE |
+		    ME4000_AO_CTRL_BIT_EX_TRIG_BOTH;
+		me4000_outl(tmp, ao_context->ctrl_reg);
+		spin_unlock_irqrestore(&ao_context->int_lock, flags);
+	} else {
+		printk(KERN_ERR
+		       "me4000_ao_ex_trig_set_edge():Invalid trigger mode\n");
+		return -EINVAL;
+	}
+
+	return 0;
+}
+
+static int me4000_ao_ex_trig_enable(me4000_ao_context_t * ao_context)
+{
+	u32 tmp;
+	unsigned long flags;
+
+	CALL_PDEBUG("me4000_ao_ex_trig_enable() is executed\n");
+
+	/* Check if the state machine is stopped */
+	tmp = me4000_inl(ao_context->status_reg);
+	if (tmp & ME4000_AO_STATUS_BIT_FSM) {
+		printk(KERN_ERR
+		       "me4000_ao_ex_trig_enable():Can't enable trigger while DAC is running\n");
+		return -EBUSY;
+	}
+
+	spin_lock_irqsave(&ao_context->int_lock, flags);
+	tmp = me4000_inl(ao_context->ctrl_reg);
+	tmp |= ME4000_AO_CTRL_BIT_ENABLE_EX_TRIG;
+	me4000_outl(tmp, ao_context->ctrl_reg);
+	spin_unlock_irqrestore(&ao_context->int_lock, flags);
+
+	return 0;
+}
+
+static int me4000_ao_ex_trig_disable(me4000_ao_context_t * ao_context)
+{
+	u32 tmp;
+	unsigned long flags;
+
+	CALL_PDEBUG("me4000_ao_ex_trig_disable() is executed\n");
+
+	/* Check if the state machine is stopped */
+	tmp = me4000_inl(ao_context->status_reg);
+	if (tmp & ME4000_AO_STATUS_BIT_FSM) {
+		printk(KERN_ERR
+		       "me4000_ao_ex_trig_disable():Can't disable trigger while DAC is running\n");
+		return -EBUSY;
+	}
+
+	spin_lock_irqsave(&ao_context->int_lock, flags);
+	tmp = me4000_inl(ao_context->ctrl_reg);
+	tmp &= ~ME4000_AO_CTRL_BIT_ENABLE_EX_TRIG;
+	me4000_outl(tmp, ao_context->ctrl_reg);
+	spin_unlock_irqrestore(&ao_context->int_lock, flags);
+
+	return 0;
+}
+
+static int me4000_ao_simultaneous_disable(me4000_ao_context_t * ao_context)
+{
+	u32 tmp;
+
+	CALL_PDEBUG("me4000_ao_simultaneous_disable() is executed\n");
+
+	/* Check if the state machine is stopped */
+	/* Be careful here because this function is called from
+	   me4000_ao_synchronous disable */
+	tmp = me4000_inl(ao_context->status_reg);
+	if (tmp & ME4000_AO_STATUS_BIT_FSM) {
+		printk(KERN_ERR
+		       "me4000_ao_simultaneous_disable():Can't disable while DAC is running\n");
+		return -EBUSY;
+	}
+
+	spin_lock(&ao_context->board_info->preload_lock);
+	tmp = me4000_inl(ao_context->preload_reg);
+	tmp &= ~(0x1 << ao_context->index);	// Disable preload bit
+	tmp &= ~(0x1 << (ao_context->index + 16));	// Disable hw simultaneous bit
+	me4000_outl(tmp, ao_context->preload_reg);
+	spin_unlock(&ao_context->board_info->preload_lock);
+
+	return 0;
+}
+
+static int me4000_ao_simultaneous_ex_trig(me4000_ao_context_t * ao_context)
+{
+	u32 tmp;
+
+	CALL_PDEBUG("me4000_ao_simultaneous_ex_trig() is executed\n");
+
+	spin_lock(&ao_context->board_info->preload_lock);
+	tmp = me4000_inl(ao_context->preload_reg);
+	tmp |= (0x1 << ao_context->index);	// Enable preload bit
+	tmp |= (0x1 << (ao_context->index + 16));	// Enable hw simultaneous bit
+	me4000_outl(tmp, ao_context->preload_reg);
+	spin_unlock(&ao_context->board_info->preload_lock);
+
+	return 0;
+}
+
+static int me4000_ao_simultaneous_sw(me4000_ao_context_t * ao_context)
+{
+	u32 tmp;
+
+	CALL_PDEBUG("me4000_ao_simultaneous_sw() is executed\n");
+
+	spin_lock(&ao_context->board_info->preload_lock);
+	tmp = me4000_inl(ao_context->preload_reg);
+	tmp |= (0x1 << ao_context->index);	// Enable preload bit
+	tmp &= ~(0x1 << (ao_context->index + 16));	// Disable hw simultaneous bit
+	me4000_outl(tmp, ao_context->preload_reg);
+	spin_unlock(&ao_context->board_info->preload_lock);
+
+	return 0;
+}
+
+static int me4000_ao_preload(me4000_ao_context_t * ao_context)
+{
+	CALL_PDEBUG("me4000_ao_preload() is executed\n");
+	return me4000_ao_simultaneous_sw(ao_context);
+}
+
+static int me4000_ao_preload_update(me4000_ao_context_t * ao_context)
+{
+	u32 tmp;
+	u32 ctrl;
+	struct list_head *entry;
+
+	CALL_PDEBUG("me4000_ao_preload_update() is executed\n");
+
+	spin_lock(&ao_context->board_info->preload_lock);
+	tmp = me4000_inl(ao_context->preload_reg);
+	list_for_each(entry, &ao_context->board_info->ao_context_list) {
+		/* The channels we update must be in the following state :
+		   - Mode A
+		   - Hardware trigger is disabled
+		   - Corresponding simultaneous bit is reset
+		 */
+		ctrl = me4000_inl(ao_context->ctrl_reg);
+		if (!
+		    (ctrl &
+		     (ME4000_AO_CTRL_BIT_MODE_0 | ME4000_AO_CTRL_BIT_MODE_1 |
+		      ME4000_AO_CTRL_BIT_ENABLE_EX_TRIG))) {
+			if (!
+			    (tmp &
+			     (0x1 <<
+			      (((me4000_ao_context_t *) entry)->index + 16)))) {
+				tmp &=
+				    ~(0x1 <<
+				      (((me4000_ao_context_t *) entry)->index));
+			}
+		}
+	}
+	me4000_outl(tmp, ao_context->preload_reg);
+	spin_unlock(&ao_context->board_info->preload_lock);
+
+	return 0;
+}
+
+static int me4000_ao_simultaneous_update(me4000_ao_channel_list_t * arg,
+					 me4000_ao_context_t * ao_context)
+{
+	int err;
+	int i;
+	u32 tmp;
+	me4000_ao_channel_list_t channels;
+
+	CALL_PDEBUG("me4000_ao_simultaneous_update() is executed\n");
+
+	/* Copy data from user */
+	err = copy_from_user(&channels, arg, sizeof(me4000_ao_channel_list_t));
+	if (err) {
+		printk(KERN_ERR
+		       "ME4000:me4000_ao_simultaneous_update():Can't copy command\n");
+		return -EFAULT;

drivers/staging/me4000/me4000.c line 2746

Quoted 10 lines
drivers/staging/me4000/me4000.c new file +10 -0
+	}
+
+	channels.list =
+	    kmalloc(sizeof(unsigned long) * channels.count, GFP_KERNEL);
+	if (!channels.list) {
+		printk(KERN_ERR
+		       "ME4000:me4000_ao_simultaneous_update():Can't get buffer\n");
+		return -ENOMEM;
+	}
+	memset(channels.list, 0, sizeof(unsigned long) * channels.count);

kzalloc

Quoted 131 lines
drivers/staging/me4000/me4000.c new file +131 -0
+	/* Copy channel list from user */
+	err =
+	    copy_from_user(channels.list, arg->list,
+			   sizeof(unsigned long) * channels.count);
+	if (err) {
+		printk(KERN_ERR
+		       "ME4000:me4000_ao_simultaneous_update():Can't copy list\n");
+		kfree(channels.list);
+		return -EFAULT;
+	}
+
+	spin_lock(&ao_context->board_info->preload_lock);
+	tmp = me4000_inl(ao_context->preload_reg);
+	for (i = 0; i < channels.count; i++) {
+		if (channels.list[i] >
+		    ao_context->board_info->board_p->ao.count) {
+			spin_unlock(&ao_context->board_info->preload_lock);
+			kfree(channels.list);
+			printk(KERN_ERR
+			       "ME4000:me4000_ao_simultaneous_update():Invalid board number specified\n");
+			return -EFAULT;
+		}
+		tmp &= ~(0x1 << channels.list[i]);	// Clear the preload bit
+		tmp &= ~(0x1 << (channels.list[i] + 16));	// Clear the hw simultaneous bit
+	}
+	me4000_outl(tmp, ao_context->preload_reg);
+	spin_unlock(&ao_context->board_info->preload_lock);
+	kfree(channels.list);
+
+	return 0;
+}
+
+static int me4000_ao_synchronous_ex_trig(me4000_ao_context_t * ao_context)
+{
+	u32 tmp;
+	unsigned long flags;
+
+	CALL_PDEBUG("me4000_ao_synchronous_ex_trig() is executed\n");
+
+	/* Check if the state machine is stopped */
+	tmp = me4000_inl(ao_context->status_reg);
+	if (tmp & ME4000_AO_STATUS_BIT_FSM) {
+		printk(KERN_ERR
+		       "me4000_ao_synchronous_ex_trig(): DAC is running\n");
+		return -EBUSY;
+	}
+
+	spin_lock(&ao_context->board_info->preload_lock);
+	tmp = me4000_inl(ao_context->preload_reg);
+	tmp &= ~(0x1 << ao_context->index);	// Disable synchronous sw bit
+	tmp |= 0x1 << (ao_context->index + 16);	// Enable synchronous hw bit
+	me4000_outl(tmp, ao_context->preload_reg);
+	spin_unlock(&ao_context->board_info->preload_lock);
+
+	/* Make runnable */
+	spin_lock_irqsave(&ao_context->int_lock, flags);
+	tmp = me4000_inl(ao_context->ctrl_reg);
+	if (tmp & (ME4000_AO_CTRL_BIT_MODE_0 | ME4000_AO_CTRL_BIT_MODE_1)) {
+		tmp &=
+		    ~(ME4000_AO_CTRL_BIT_STOP |
+		      ME4000_AO_CTRL_BIT_IMMEDIATE_STOP);
+		me4000_outl(tmp, ao_context->ctrl_reg);
+	}
+	spin_unlock_irqrestore(&ao_context->int_lock, flags);
+
+	return 0;
+}
+
+static int me4000_ao_synchronous_sw(me4000_ao_context_t * ao_context)
+{
+	u32 tmp;
+	unsigned long flags;
+
+	CALL_PDEBUG("me4000_ao_synchronous_sw() is executed\n");
+
+	/* Check if the state machine is stopped */
+	tmp = me4000_inl(ao_context->status_reg);
+	if (tmp & ME4000_AO_STATUS_BIT_FSM) {
+		printk(KERN_ERR "me4000_ao_synchronous_sw(): DAC is running\n");
+		return -EBUSY;
+	}
+
+	spin_lock(&ao_context->board_info->preload_lock);
+	tmp = me4000_inl(ao_context->preload_reg);
+	tmp |= 0x1 << ao_context->index;	// Enable synchronous sw bit
+	tmp &= ~(0x1 << (ao_context->index + 16));	// Disable synchronous hw bit
+	me4000_outl(tmp, ao_context->preload_reg);
+	spin_unlock(&ao_context->board_info->preload_lock);
+
+	/* Make runnable */
+	spin_lock_irqsave(&ao_context->int_lock, flags);
+	tmp = me4000_inl(ao_context->ctrl_reg);
+	if (tmp & (ME4000_AO_CTRL_BIT_MODE_0 | ME4000_AO_CTRL_BIT_MODE_1)) {
+		tmp &=
+		    ~(ME4000_AO_CTRL_BIT_STOP |
+		      ME4000_AO_CTRL_BIT_IMMEDIATE_STOP);
+		me4000_outl(tmp, ao_context->ctrl_reg);
+	}
+	spin_unlock_irqrestore(&ao_context->int_lock, flags);
+
+	return 0;
+}
+
+static int me4000_ao_synchronous_disable(me4000_ao_context_t * ao_context)
+{
+	return me4000_ao_simultaneous_disable(ao_context);
+}
+
+static int me4000_ao_get_free_buffer(unsigned long *arg,
+				     me4000_ao_context_t * ao_context)
+{
+	unsigned long c;
+	int err;
+
+	c = me4000_buf_space(ao_context->circ_buf, ME4000_AO_BUFFER_COUNT);
+
+	err = copy_to_user(arg, &c, sizeof(unsigned long));
+	if (err) {
+		printk(KERN_ERR
+		       "ME4000:me4000_ao_get_free_buffer():Can't copy to user space\n");
+		return -EFAULT;
+	}
+
+	return 0;
+}
+
+static int me4000_ao_ex_trig_timeout(unsigned long *arg,
+				     me4000_ao_context_t * ao_context)
+{
+	u32 tmp;
+	wait_queue_head_t queue;

drivers/staging/me4000/me4000.c line 2888

Quoted 10 lines
drivers/staging/me4000/me4000.c new file +10 -0
+	unsigned long ref;
+	unsigned long timeout;
+
+	CALL_PDEBUG("me4000_ao_ex_trig_timeout() is executed\n");
+
+	if (get_user(timeout, arg)) {
+		printk(KERN_ERR
+		       "me4000_ao_ex_trig_timeout():Cannot copy data from user\n");
+		return -EFAULT;
+	}

erm. Exactly what is the userspace interface which this driver is implementing?

Quoted 1 line

+#define ME4000_BOARD_VERSIONS (sizeof(me4000_boards) / sizeof(me4000_board_t) - 1)

Kill this altogether, use open-coded ARRAY_SIZE

<can't take any more, stops there>

author
#8 lore raw

PATCH 10/23 Staging: add the go7007 video driver

In reply to Greg KH

From: Greg Kroah-Hartman <[email protected]>

Todo:
- checkpatch.pl cleanups
- sparse cleanups
- lots of little modules, should be merged together and added to the build.
- testing?
- handle churn in v4l layer.

Many thanks to Ross Cohen <[email protected]> for cleanup patches on this driver.

---
 drivers/staging/Kconfig                 |    2 +
 drivers/staging/Makefile                |    1 +
 drivers/staging/go7007/Kconfig          |   25 +
 drivers/staging/go7007/Makefile         |   18 +
 drivers/staging/go7007/README           |   11 +
 drivers/staging/go7007/go7007-driver.c  |  688 +++++++++++++
 drivers/staging/go7007/go7007-fw.c      | 1639 +++++++++++++++++++++++++++++++
 drivers/staging/go7007/go7007-i2c.c     |  309 ++++++
 drivers/staging/go7007/go7007-priv.h    |  279 ++++++
 drivers/staging/go7007/go7007-usb.c     | 1229 +++++++++++++++++++++++
 drivers/staging/go7007/go7007-v4l2.c    | 1503 ++++++++++++++++++++++++++++
 drivers/staging/go7007/go7007.h         |  114 +++
 drivers/staging/go7007/saa7134-go7007.c |  484 +++++++++
 drivers/staging/go7007/snd-go7007.c     |  305 ++++++
 drivers/staging/go7007/wis-i2c.h        |   55 +
 drivers/staging/go7007/wis-ov7640.c     |  131 +++
 drivers/staging/go7007/wis-saa7113.c    |  363 +++++++
 drivers/staging/go7007/wis-saa7115.c    |  492 +++++++++
 drivers/staging/go7007/wis-sony-tuner.c |  741 ++++++++++++++
 drivers/staging/go7007/wis-tw2804.c     |  381 +++++++
 drivers/staging/go7007/wis-tw9903.c     |  363 +++++++
 drivers/staging/go7007/wis-uda1342.c    |  136 +++
 22 files changed, 9269 insertions(+), 0 deletions(-)
 create mode 100644 drivers/staging/go7007/Kconfig
 create mode 100644 drivers/staging/go7007/Makefile
 create mode 100644 drivers/staging/go7007/README
 create mode 100644 drivers/staging/go7007/go7007-driver.c
 create mode 100644 drivers/staging/go7007/go7007-fw.c
 create mode 100644 drivers/staging/go7007/go7007-i2c.c
 create mode 100644 drivers/staging/go7007/go7007-priv.h
 create mode 100644 drivers/staging/go7007/go7007-usb.c
 create mode 100644 drivers/staging/go7007/go7007-v4l2.c
 create mode 100644 drivers/staging/go7007/go7007.h
 create mode 100644 drivers/staging/go7007/saa7134-go7007.c
 create mode 100644 drivers/staging/go7007/snd-go7007.c
 create mode 100644 drivers/staging/go7007/wis-i2c.h
 create mode 100644 drivers/staging/go7007/wis-ov7640.c
 create mode 100644 drivers/staging/go7007/wis-saa7113.c
 create mode 100644 drivers/staging/go7007/wis-saa7115.c
 create mode 100644 drivers/staging/go7007/wis-sony-tuner.c
 create mode 100644 drivers/staging/go7007/wis-tw2804.c
 create mode 100644 drivers/staging/go7007/wis-tw9903.c
 create mode 100644 drivers/staging/go7007/wis-uda1342.c
drivers/staging/Kconfig +2 -0
index 56c73bc..f16bc9c 100644
@@ -31,4 +31,6 @@ source "drivers/staging/sxg/Kconfig"
 
 source "drivers/staging/me4000/Kconfig"
 
+source "drivers/staging/go7007/Kconfig"
+
 endif # STAGING
drivers/staging/Makefile +1 -0
index 97df19b..aa61662 100644
@@ -4,3 +4,4 @@ obj-$(CONFIG_ET131X)		+= et131x/
 obj-$(CONFIG_SLICOSS)		+= slicoss/
 obj-$(CONFIG_SXG)		+= sxg/
 obj-$(CONFIG_ME4000)		+= me4000/
+obj-$(CONFIG_VIDEO_GO7007)	+= go7007/
drivers/staging/go7007/Kconfig new file +25 -0
new file mode 100644
index 0000000..57a121c
@@ -0,0 +1,25 @@
+config VIDEO_GO7007
+	tristate "Go 7007 support"
+	depends on VIDEO_DEV && PCI && I2C && INPUT
+	select VIDEOBUF_DMA_SG
+	select VIDEO_IR
+	select VIDEO_TUNER
+	select VIDEO_TVEEPROM
+	select CRC32
+	default N
+	---help---
+	  This is a video4linux driver for some wierd device...
+
+	  To compile this driver as a module, choose M here: the
+	  module will be called go7007
+
+config VIDEO_GO7007_USB
+	tristate "Go 7007 USB support"
+	depends on VIDEO_GO7007 && USB
+	default N
+	---help---
+	  This is a video4linux driver for some wierd device...
+
+	  To compile this driver as a module, choose M here: the
+	  module will be called go7007-usb
+
drivers/staging/go7007/Makefile new file +18 -0
new file mode 100644
index 0000000..9b9310c
@@ -0,0 +1,18 @@
+#obj-m += go7007.o go7007-usb.o snd-go7007.o wis-saa7115.o wis-tw9903.o \
+		wis-uda1342.o wis-sony-tuner.o wis-saa7113.o wis-ov7640.o \
+		wis-tw2804.o
+
+
+obj-$(CONFIG_VIDEO_GO7007) += go7007.o
+obj-$(CONFIG_VIDEO_GO7007_USB) += go7007-usb.o
+
+go7007-objs += go7007-v4l2.o go7007-driver.o go7007-i2c.o go7007-fw.o snd-go7007.o
+
+
+#ifneq ($(SAA7134_BUILD),)
+#obj-m += saa7134-go7007.o
+#endif
+
+EXTRA_CFLAGS += -Idrivers/staging/saa7134
+EXTRA_CFLAGS += -Idrivers/media/dvb/frontends
+EXTRA_CFLAGS += -Idrivers/media/dvb/dvb-core
drivers/staging/go7007/README new file +11 -0
new file mode 100644
index 0000000..48f4476
@@ -0,0 +1,11 @@
+Todo:
+	- checkpatch.pl cleanups
+	- sparse cleanups
+	- lots of little modules, should be merged together
+	  and added to the build.
+	- testing?
+	- handle churn in v4l layer.
+
+Please send patchs to Greg Kroah-Hartman <[email protected]> and Cc: Ross
+Cohen <[email protected]> as well.
+
drivers/staging/go7007/go7007-driver.c new file +688 -0

688 lines not on this page · raw message

drivers/staging/go7007/go7007-fw.c new file +1639 -0

1,639 lines not on this page · raw message

drivers/staging/go7007/go7007-i2c.c new file +309 -0

309 lines not on this page · raw message

drivers/staging/go7007/go7007-priv.h new file +279 -0

279 lines not on this page · raw message

drivers/staging/go7007/go7007-usb.c new file +1229 -0

21 lines not on this page · raw message

drivers/staging/go7007/go7007-v4l2.c new file +1503 -0

1,503 lines not on this page · raw message

drivers/staging/go7007/go7007.h new file +114 -0

114 lines not on this page · raw message

drivers/staging/go7007/saa7134-go7007.c new file +484 -0

484 lines not on this page · raw message

drivers/staging/go7007/snd-go7007.c new file +305 -0

305 lines not on this page · raw message

drivers/staging/go7007/wis-i2c.h new file +55 -0

55 lines not on this page · raw message

drivers/staging/go7007/wis-ov7640.c new file +131 -0

131 lines not on this page · raw message

drivers/staging/go7007/wis-saa7113.c new file +363 -0

363 lines not on this page · raw message

drivers/staging/go7007/wis-saa7115.c new file +492 -0

492 lines not on this page · raw message

drivers/staging/go7007/wis-sony-tuner.c new file +741 -0

741 lines not on this page · raw message

drivers/staging/go7007/wis-tw2804.c new file +381 -0

381 lines not on this page · raw message

drivers/staging/go7007/wis-tw9903.c new file +363 -0

363 lines not on this page · raw message

drivers/staging/go7007/wis-uda1342.c new file +136 -0

136 lines not on this page · raw message

The rest of this diff is not shown. View the raw message.

Signature · 1 line
1.6.0.2

Part of the diff is not shown here. View the raw message.

author
#9 lore raw

PATCH 11/23 Staging: USB/IP: add common functions needed

In reply to Greg KH

From: Takahiro Hirofuchi <[email protected]>

This adds the common functions needed by both the host and client side of the USB/IP code.

Brian Merrell cleaned up a lot of this code and submitted it for inclusion. Greg also did a lot of cleanup.

---
 drivers/staging/Kconfig              |    2 +
 drivers/staging/Makefile             |    1 +
 drivers/staging/usbip/Kconfig        |   14 +
 drivers/staging/usbip/Makefile       |    6 +
 drivers/staging/usbip/README         |    6 +
 drivers/staging/usbip/usbip_common.c |  997 ++++++++++++++++++++++++++++++++++
 drivers/staging/usbip/usbip_common.h |  406 ++++++++++++++
 drivers/staging/usbip/usbip_event.c  |  141 +++++
 8 files changed, 1573 insertions(+), 0 deletions(-)
 create mode 100644 drivers/staging/usbip/Kconfig
 create mode 100644 drivers/staging/usbip/Makefile
 create mode 100644 drivers/staging/usbip/README
 create mode 100644 drivers/staging/usbip/usbip_common.c
 create mode 100644 drivers/staging/usbip/usbip_common.h
 create mode 100644 drivers/staging/usbip/usbip_event.c
drivers/staging/Kconfig +2 -0
index f16bc9c..4dbf795 100644
@@ -33,4 +33,6 @@ source "drivers/staging/me4000/Kconfig"
 
 source "drivers/staging/go7007/Kconfig"
 
+source "drivers/staging/usbip/Kconfig"
+
 endif # STAGING
drivers/staging/Makefile +1 -0
index aa61662..be42c0d 100644
@@ -5,3 +5,4 @@ obj-$(CONFIG_SLICOSS)		+= slicoss/
 obj-$(CONFIG_SXG)		+= sxg/
 obj-$(CONFIG_ME4000)		+= me4000/
 obj-$(CONFIG_VIDEO_GO7007)	+= go7007/
+obj-$(CONFIG_USB_IP_COMMON)	+= usbip/
drivers/staging/usbip/Kconfig new file +14 -0
new file mode 100644
index 0000000..37efb5e
@@ -0,0 +1,14 @@
+config USB_IP_COMMON
+	tristate "USB IP support (EXPERIMENTAL)"
+	depends on USB && EXPERIMENTAL
+	default N
+	---help---
+	  This enables pushing USB packets over IP to allow remote
+	  machines access to USB devices directly.  For more details,
+	  and links to the userspace utility programs to let this work
+	  properly, see http://usbip.naist.jp/
+
+	  To compile this driver as a module, choose M here: the
+	  module will be called usbip_common_mod.
+
+	  If unsure, say N.
drivers/staging/usbip/Makefile new file +6 -0
new file mode 100644
index 0000000..ce925ca
@@ -0,0 +1,6 @@
+obj-$(CONFIG_USB_IP_COMMON) += usbip_common_mod.o
+usbip_common_mod-objs := usbip_common.o usbip_event.o
+
+ifeq ($(CONFIG_USB_DEBUG),y)
+	EXTRA_CFLAGS += -DDEBUG
+endif
drivers/staging/usbip/README new file +6 -0
new file mode 100644
index 0000000..c11be57
@@ -0,0 +1,6 @@
+TODO:
+	- more discussion about the protocol
+	- testing
+	- review of the userspace interface
+
+Please send patches for this code to Greg Kroah-Hartman <[email protected]>
drivers/staging/usbip/usbip_common.c new file +997 -0

997 lines not on this page · raw message

drivers/staging/usbip/usbip_common.h new file +406 -0

406 lines not on this page · raw message

drivers/staging/usbip/usbip_event.c new file +141 -0

141 lines not on this page · raw message

Signature · 1 line
1.6.0.2
author
#10 lore raw

PATCH 12/23 Staging: USB/IP: add client driver

In reply to Greg KH

From: Takahiro Hirofuchi <[email protected]>

This adds the USB IP client driver

Brian Merrell cleaned up a lot of this code and submitted it for inclusion. Greg also did a lot of cleanup.

---
 drivers/staging/usbip/Kconfig      |   11 +
 drivers/staging/usbip/Makefile     |    3 +
 drivers/staging/usbip/vhci.h       |  142 ++++
 drivers/staging/usbip/vhci_hcd.c   | 1275 ++++++++++++++++++++++++++++++++++++
 drivers/staging/usbip/vhci_rx.c    |  251 +++++++
 drivers/staging/usbip/vhci_sysfs.c |  250 +++++++
 drivers/staging/usbip/vhci_tx.c    |  239 +++++++
 7 files changed, 2171 insertions(+), 0 deletions(-)
 create mode 100644 drivers/staging/usbip/vhci.h
 create mode 100644 drivers/staging/usbip/vhci_hcd.c
 create mode 100644 drivers/staging/usbip/vhci_rx.c
 create mode 100644 drivers/staging/usbip/vhci_sysfs.c
 create mode 100644 drivers/staging/usbip/vhci_tx.c
drivers/staging/usbip/Kconfig +11 -0
index 37efb5e..c4d68e1 100644
@@ -12,3 +12,14 @@ config USB_IP_COMMON
 	  module will be called usbip_common_mod.
 
 	  If unsure, say N.
+
+config USB_IP_VHCI_HCD
+	tristate "USB IP client driver"
+	depends on USB_IP_COMMON
+	default N
+	---help---
+	 This enables the USB IP host controller driver which will
+	 run on the client machine.
+
+	 To compile this driver as a module, choose M here: the
+	 module will be called vhci_hcd.
drivers/staging/usbip/Makefile +3 -0
index ce925ca..6ef4c39 100644
@@ -1,6 +1,9 @@
 obj-$(CONFIG_USB_IP_COMMON) += usbip_common_mod.o
 usbip_common_mod-objs := usbip_common.o usbip_event.o
 
+obj-$(CONFIG_USB_IP_VHCI_HCD) += vhci-hcd.o
+vhci-hcd-objs := vhci_sysfs.o vhci_tx.o vhci_rx.o vhci_hcd.o
+
 ifeq ($(CONFIG_USB_DEBUG),y)
 	EXTRA_CFLAGS += -DDEBUG
 endif
drivers/staging/usbip/vhci.h new file +142 -0

142 lines not on this page · raw message

drivers/staging/usbip/vhci_hcd.c new file +1275 -0

1,275 lines not on this page · raw message

drivers/staging/usbip/vhci_rx.c new file +251 -0

251 lines not on this page · raw message

drivers/staging/usbip/vhci_sysfs.c new file +250 -0

250 lines not on this page · raw message

drivers/staging/usbip/vhci_tx.c new file +239 -0

239 lines not on this page · raw message

Signature · 1 line
1.6.0.2
author
#11 lore raw

PATCH 13/23 Staging: USB/IP: add host driver

In reply to Greg KH

From: Takahiro Hirofuchi <[email protected]>

This adds the USB IP client driver

Brian Merrell cleaned up a lot of this code and submitted it for inclusion. Greg also did a lot of cleanup.

---
 drivers/staging/usbip/Kconfig     |   11 +
 drivers/staging/usbip/Makefile    |    3 +
 drivers/staging/usbip/stub.h      |   95 ++++++
 drivers/staging/usbip/stub_dev.c  |  483 +++++++++++++++++++++++++++++
 drivers/staging/usbip/stub_main.c |  300 ++++++++++++++++++
 drivers/staging/usbip/stub_rx.c   |  615 +++++++++++++++++++++++++++++++++++++
 drivers/staging/usbip/stub_tx.c   |  371 ++++++++++++++++++++++
 7 files changed, 1878 insertions(+), 0 deletions(-)
 create mode 100644 drivers/staging/usbip/stub.h
 create mode 100644 drivers/staging/usbip/stub_dev.c
 create mode 100644 drivers/staging/usbip/stub_main.c
 create mode 100644 drivers/staging/usbip/stub_rx.c
 create mode 100644 drivers/staging/usbip/stub_tx.c
drivers/staging/usbip/Kconfig +11 -0
index c4d68e1..7426235 100644
@@ -23,3 +23,14 @@ config USB_IP_VHCI_HCD
 
 	 To compile this driver as a module, choose M here: the
 	 module will be called vhci_hcd.
+
+config USB_IP_HOST
+	tristate "USB IP host driver"
+	depends on USB_IP_COMMON
+	default N
+	---help---
+	 This enables the USB IP device driver which will run on the
+	 host machine.
+
+	 To compile this driver as a module, choose M here: the
+	 module will be called usbip.
drivers/staging/usbip/Makefile +3 -0
index 6ef4c39..179f421 100644
@@ -4,6 +4,9 @@ usbip_common_mod-objs := usbip_common.o usbip_event.o
 obj-$(CONFIG_USB_IP_VHCI_HCD) += vhci-hcd.o
 vhci-hcd-objs := vhci_sysfs.o vhci_tx.o vhci_rx.o vhci_hcd.o
 
+obj-$(CONFIG_USB_IP_HOST) += usbip.o
+usbip-objs := stub_dev.o stub_main.o stub_rx.o stub_tx.o
+
 ifeq ($(CONFIG_USB_DEBUG),y)
 	EXTRA_CFLAGS += -DDEBUG
 endif
drivers/staging/usbip/stub.h new file +95 -0

95 lines not on this page · raw message

drivers/staging/usbip/stub_dev.c new file +483 -0

483 lines not on this page · raw message

drivers/staging/usbip/stub_main.c new file +300 -0

300 lines not on this page · raw message

drivers/staging/usbip/stub_rx.c new file +615 -0

615 lines not on this page · raw message

drivers/staging/usbip/stub_tx.c new file +371 -0

371 lines not on this page · raw message

Signature · 1 line
1.6.0.2
author
#12 lore raw

PATCH 14/23 Staging: add w35und wifi driver

In reply to Greg KH

From: Pavel Machek <[email protected]>

This is driver for w35und usb wifi -- also in kohjinsha subnotebook. It should work well enough to associate and ping, but it obviously needs to be rewritten two more times...

OTOH worst horrors (like embedded wifi stack) should have been fixed already...

---
 drivers/staging/Kconfig                   |    2 +
 drivers/staging/Makefile                  |    1 +
 drivers/staging/winbond/Kconfig           |    7 +
 drivers/staging/winbond/Makefile          |   18 +
 drivers/staging/winbond/README            |   10 +
 drivers/staging/winbond/adapter.h         |   23 +
 drivers/staging/winbond/bss_f.h           |   59 +
 drivers/staging/winbond/bssdscpt.h        |  156 ++
 drivers/staging/winbond/ds_tkip.h         |   33 +
 drivers/staging/winbond/gl_80211.h        |  125 ++
 drivers/staging/winbond/ioctls.h          |  678 ++++++++
 drivers/staging/winbond/linux/common.h    |  143 ++
 drivers/staging/winbond/linux/sysdef.h    |   73 +
 drivers/staging/winbond/linux/wb35reg.c   |  747 ++++++++
 drivers/staging/winbond/linux/wb35reg_f.h |   56 +
 drivers/staging/winbond/linux/wb35reg_s.h |  170 ++
 drivers/staging/winbond/linux/wb35rx.c    |  337 ++++
 drivers/staging/winbond/linux/wb35rx_f.h  |   17 +
 drivers/staging/winbond/linux/wb35rx_s.h  |   48 +
 drivers/staging/winbond/linux/wb35tx.c    |  313 ++++
 drivers/staging/winbond/linux/wb35tx_f.h  |   20 +
 drivers/staging/winbond/linux/wb35tx_s.h  |   47 +
 drivers/staging/winbond/linux/wbusb.c     |  404 +++++
 drivers/staging/winbond/linux/wbusb_f.h   |   34 +
 drivers/staging/winbond/linux/wbusb_s.h   |   42 +
 drivers/staging/winbond/localpara.h       |  275 +++
 drivers/staging/winbond/mac_structures.h  |  670 +++++++
 drivers/staging/winbond/mds.c             |  630 +++++++
 drivers/staging/winbond/mds_f.h           |   33 +
 drivers/staging/winbond/mds_s.h           |  183 ++
 drivers/staging/winbond/mlme_mib.h        |   84 +
 drivers/staging/winbond/mlme_s.h          |  195 +++
 drivers/staging/winbond/mlmetxrx.c        |  150 ++
 drivers/staging/winbond/mlmetxrx_f.h      |   52 +
 drivers/staging/winbond/mto.c             | 1229 +++++++++++++
 drivers/staging/winbond/mto.h             |  265 +++
 drivers/staging/winbond/mto_f.h           |    7 +
 drivers/staging/winbond/os_common.h       |    2 +
 drivers/staging/winbond/phy_calibration.c | 1759 +++++++++++++++++++
 drivers/staging/winbond/phy_calibration.h |  101 ++
 drivers/staging/winbond/reg.c             | 2683 +++++++++++++++++++++++++++++
 drivers/staging/winbond/rxisr.c           |   30 +
 drivers/staging/winbond/scan_s.h          |  115 ++
 drivers/staging/winbond/sme_api.c         |   13 +
 drivers/staging/winbond/sme_api.h         |  265 +++
 drivers/staging/winbond/sme_s.h           |  228 +++
 drivers/staging/winbond/wb35_ver.h        |   30 +
 drivers/staging/winbond/wbhal.c           |  878 ++++++++++
 drivers/staging/winbond/wbhal_f.h         |  122 ++
 drivers/staging/winbond/wbhal_s.h         |  615 +++++++
 drivers/staging/winbond/wblinux.c         |  277 +++
 drivers/staging/winbond/wblinux_f.h       |   23 +
 drivers/staging/winbond/wblinux_s.h       |   45 +
 53 files changed, 14522 insertions(+), 0 deletions(-)
 create mode 100644 drivers/staging/winbond/Kconfig
 create mode 100644 drivers/staging/winbond/Makefile
 create mode 100644 drivers/staging/winbond/README
 create mode 100644 drivers/staging/winbond/adapter.h
 create mode 100644 drivers/staging/winbond/bss_f.h
 create mode 100644 drivers/staging/winbond/bssdscpt.h
 create mode 100644 drivers/staging/winbond/ds_tkip.h
 create mode 100644 drivers/staging/winbond/gl_80211.h
 create mode 100644 drivers/staging/winbond/ioctls.h
 create mode 100644 drivers/staging/winbond/linux/common.h
 create mode 100644 drivers/staging/winbond/linux/sysdef.h
 create mode 100644 drivers/staging/winbond/linux/wb35reg.c
 create mode 100644 drivers/staging/winbond/linux/wb35reg_f.h
 create mode 100644 drivers/staging/winbond/linux/wb35reg_s.h
 create mode 100644 drivers/staging/winbond/linux/wb35rx.c
 create mode 100644 drivers/staging/winbond/linux/wb35rx_f.h
 create mode 100644 drivers/staging/winbond/linux/wb35rx_s.h
 create mode 100644 drivers/staging/winbond/linux/wb35tx.c
 create mode 100644 drivers/staging/winbond/linux/wb35tx_f.h
 create mode 100644 drivers/staging/winbond/linux/wb35tx_s.h
 create mode 100644 drivers/staging/winbond/linux/wbusb.c
 create mode 100644 drivers/staging/winbond/linux/wbusb_f.h
 create mode 100644 drivers/staging/winbond/linux/wbusb_s.h
 create mode 100644 drivers/staging/winbond/localpara.h
 create mode 100644 drivers/staging/winbond/mac_structures.h
 create mode 100644 drivers/staging/winbond/mds.c
 create mode 100644 drivers/staging/winbond/mds_f.h
 create mode 100644 drivers/staging/winbond/mds_s.h
 create mode 100644 drivers/staging/winbond/mlme_mib.h
 create mode 100644 drivers/staging/winbond/mlme_s.h
 create mode 100644 drivers/staging/winbond/mlmetxrx.c
 create mode 100644 drivers/staging/winbond/mlmetxrx_f.h
 create mode 100644 drivers/staging/winbond/mto.c
 create mode 100644 drivers/staging/winbond/mto.h
 create mode 100644 drivers/staging/winbond/mto_f.h
 create mode 100644 drivers/staging/winbond/os_common.h
 create mode 100644 drivers/staging/winbond/phy_calibration.c
 create mode 100644 drivers/staging/winbond/phy_calibration.h
 create mode 100644 drivers/staging/winbond/reg.c
 create mode 100644 drivers/staging/winbond/rxisr.c
 create mode 100644 drivers/staging/winbond/scan_s.h
 create mode 100644 drivers/staging/winbond/sme_api.c
 create mode 100644 drivers/staging/winbond/sme_api.h
 create mode 100644 drivers/staging/winbond/sme_s.h
 create mode 100644 drivers/staging/winbond/wb35_ver.h
 create mode 100644 drivers/staging/winbond/wbhal.c
 create mode 100644 drivers/staging/winbond/wbhal_f.h
 create mode 100644 drivers/staging/winbond/wbhal_s.h
 create mode 100644 drivers/staging/winbond/wblinux.c
 create mode 100644 drivers/staging/winbond/wblinux_f.h
 create mode 100644 drivers/staging/winbond/wblinux_s.h
drivers/staging/Kconfig +2 -0
index 4dbf795..fdbdf84 100644
@@ -35,4 +35,6 @@ source "drivers/staging/go7007/Kconfig"
 
 source "drivers/staging/usbip/Kconfig"
 
+source "drivers/staging/winbond/Kconfig"
+
 endif # STAGING
drivers/staging/Makefile +1 -0
index be42c0d..9b576c9 100644
@@ -6,3 +6,4 @@ obj-$(CONFIG_SXG)		+= sxg/
 obj-$(CONFIG_ME4000)		+= me4000/
 obj-$(CONFIG_VIDEO_GO7007)	+= go7007/
 obj-$(CONFIG_USB_IP_COMMON)	+= usbip/
+obj-$(CONFIG_W35UND)		+= winbond/
drivers/staging/winbond/Kconfig new file +7 -0
new file mode 100644
index 0000000..10d72be
@@ -0,0 +1,7 @@
+config W35UND
+	tristate "Winbond driver"
+	depends on MAC80211 && WLAN_80211 && EXPERIMENTAL && !4KSTACKS
+	default n
+	---help---
+	  This is highly experimental driver for winbond wifi card on some Kohjinsha notebooks
+	  Check http://code.google.com/p/winbondport/ for new version
drivers/staging/winbond/Makefile new file +18 -0
new file mode 100644
index 0000000..29c98bf
@@ -0,0 +1,18 @@
+	DRIVER_DIR=./linux
+
+w35und-objs := $(DRIVER_DIR)/wbusb.o $(DRIVER_DIR)/wb35reg.o $(DRIVER_DIR)/wb35rx.o $(DRIVER_DIR)/wb35tx.o \
+	mds.o \
+	mlmetxrx.o \
+	mto.o	\
+	phy_calibration.o	\
+	reg.o			\
+	rxisr.o			\
+	sme_api.o		\
+	wbhal.o			\
+	wblinux.o		\
+
+
+obj-$(CONFIG_W35UND) += w35und.o
+
+
+
drivers/staging/winbond/README new file +10 -0
new file mode 100644
index 0000000..707b6b3
@@ -0,0 +1,10 @@
+TODO:
+	- sparse cleanups
+	- checkpatch cleanups
+	- kerneldoc cleanups
+	- remove typedefs
+	- remove unused ioctls
+	- use cfg80211 for regulatory stuff
+
+Please send patches to Greg Kroah-Hartman <[email protected]> and
+Pavel Machek <[email protected]>
drivers/staging/winbond/adapter.h new file +23 -0
new file mode 100644
index 0000000..609701d
@@ -0,0 +1,23 @@
+//
+// ADAPTER.H -
+// Windows NDIS global variable 'Adapter' typedef
+//
+#define MAX_ANSI_STRING		40
+typedef struct WB32_ADAPTER
+{
+	u32 AdapterIndex; // 20060703.4 Add for using pAdapterContext global Adapter point
+
+	WB_LOCALDESCRIPT	sLocalPara;		// Myself connected parameters
+	PWB_BSSDESCRIPTION	asBSSDescriptElement;
+
+	MLME_FRAME		sMlmeFrame;		// connect to peerSTA parameters
+
+	MTO_PARAMETERS		sMtoPara; // MTO_struct ...
+	hw_data_t			sHwData; //For HAL
+	MDS					Mds;
+
+	WBLINUX		WbLinux;
+        struct iw_statistics iw_stats;
+
+	u8	LinkName[MAX_ANSI_STRING];
+} WB32_ADAPTER, ADAPTER, *PWB32_ADAPTER, *PADAPTER;
drivers/staging/winbond/bss_f.h new file +59 -0

59 lines not on this page · raw message

drivers/staging/winbond/bssdscpt.h new file +156 -0

156 lines not on this page · raw message

drivers/staging/winbond/ds_tkip.h new file +33 -0
new file mode 100644
index 0000000..29e5055
@@ -0,0 +1,33 @@
+// Rotation functions on 32 bit values
+#define ROL32( A, n ) \
+    ( ((A) << (n)) | ( ((A)>>(32-(n)))  & ( (1UL << (n)) - 1 ) ) )
+
+#define ROR32( A, n )   ROL32( (A), 32-(n) )
+
+
+typedef struct tkip
+{
+    u32	K0, K1;		// Key
+	union
+	{
+		struct // Current state
+		{
+			u32	L;
+			u32	R;
+		};
+		u8	LR[8];
+	};
+	union
+	{
+		u32	M;		// Message accumulator (single word)
+		u8	Mb[4];
+	};
+	s32		bytes_in_M;	// # bytes in M
+} tkip_t;
+
+//void _append_data( PUCHAR pData, u16 size, tkip_t *p );
+void Mds_MicGet(  void* Adapter,  void* pRxLayer1,  PUCHAR pKey,  PUCHAR pMic );
+void Mds_MicFill(  void* Adapter,  void* pDes,  PUCHAR XmitBufAddress );
+
+
+
drivers/staging/winbond/gl_80211.h new file +125 -0

125 lines not on this page · raw message

drivers/staging/winbond/ioctls.h new file +678 -0

678 lines not on this page · raw message

drivers/staging/winbond/linux/common.h new file +143 -0

143 lines not on this page · raw message

drivers/staging/winbond/linux/sysdef.h new file +73 -0

73 lines not on this page · raw message

drivers/staging/winbond/linux/wb35reg.c new file +747 -0

747 lines not on this page · raw message

drivers/staging/winbond/linux/wb35reg_f.h new file +56 -0

56 lines not on this page · raw message

drivers/staging/winbond/linux/wb35reg_s.h new file +170 -0

170 lines not on this page · raw message

drivers/staging/winbond/linux/wb35rx.c new file +337 -0

337 lines not on this page · raw message

drivers/staging/winbond/linux/wb35rx_f.h new file +17 -0
new file mode 100644
index 0000000..daa3e73
@@ -0,0 +1,17 @@
+//====================================
+// Interface function declare
+//====================================
+void		Wb35Rx_reset_descriptor(  phw_data_t pHwData );
+unsigned char		Wb35Rx_initial(  phw_data_t pHwData );
+void		Wb35Rx_destroy(  phw_data_t pHwData );
+void		Wb35Rx_stop(  phw_data_t pHwData );
+u16		Wb35Rx_indicate(  phw_data_t pHwData );
+void		Wb35Rx_adjust(  PDESCRIPTOR pRxDes );
+void		Wb35Rx_start(  phw_data_t pHwData );
+
+void		Wb35Rx(  phw_data_t pHwData );
+void		Wb35Rx_Complete(  PURB pUrb );
+
+
+
+
drivers/staging/winbond/linux/wb35rx_s.h new file +48 -0

48 lines not on this page · raw message

drivers/staging/winbond/linux/wb35tx.c new file +313 -0

290 lines not on this page · raw message

drivers/staging/winbond/linux/wb35tx_f.h new file +20 -0
new file mode 100644
index 0000000..7705a84

Lines of this file are not shown. View the raw message.

drivers/staging/winbond/linux/wb35tx_s.h new file +47 -0

47 lines not on this page · raw message

drivers/staging/winbond/linux/wbusb.c new file +404 -0

404 lines not on this page · raw message

drivers/staging/winbond/linux/wbusb_f.h new file +34 -0
new file mode 100644
index 0000000..cae29e1

Lines of this file are not shown. View the raw message.

drivers/staging/winbond/linux/wbusb_s.h new file +42 -0

42 lines not on this page · raw message

drivers/staging/winbond/localpara.h new file +275 -0

275 lines not on this page · raw message

drivers/staging/winbond/mac_structures.h new file +670 -0

670 lines not on this page · raw message

drivers/staging/winbond/mds.c new file +630 -0

630 lines not on this page · raw message

drivers/staging/winbond/mds_f.h new file +33 -0
new file mode 100644
index 0000000..651188b

Lines of this file are not shown. View the raw message.

drivers/staging/winbond/mds_s.h new file +183 -0

183 lines not on this page · raw message

drivers/staging/winbond/mlme_mib.h new file +84 -0

84 lines not on this page · raw message

drivers/staging/winbond/mlme_s.h new file +195 -0

195 lines not on this page · raw message

drivers/staging/winbond/mlmetxrx.c new file +150 -0

150 lines not on this page · raw message

drivers/staging/winbond/mlmetxrx_f.h new file +52 -0

52 lines not on this page · raw message

drivers/staging/winbond/mto.c new file +1229 -0

1,229 lines not on this page · raw message

drivers/staging/winbond/mto.h new file +265 -0

265 lines not on this page · raw message

drivers/staging/winbond/mto_f.h new file +7 -0
new file mode 100644
index 0000000..30b3df2

Lines of this file are not shown. View the raw message.

drivers/staging/winbond/os_common.h new file +2 -0
new file mode 100644
index 0000000..e24ff41

Lines of this file are not shown. View the raw message.

drivers/staging/winbond/phy_calibration.c new file +1759 -0

1,759 lines not on this page · raw message

drivers/staging/winbond/phy_calibration.h new file +101 -0

101 lines not on this page · raw message

drivers/staging/winbond/reg.c new file +2683 -0

2,683 lines not on this page · raw message

drivers/staging/winbond/rxisr.c new file +30 -0
new file mode 100644
index 0000000..18e942c

Lines of this file are not shown. View the raw message.

drivers/staging/winbond/scan_s.h new file +115 -0

115 lines not on this page · raw message

drivers/staging/winbond/sme_api.c new file +13 -0
new file mode 100644
index 0000000..40e93b7

Lines of this file are not shown. View the raw message.

drivers/staging/winbond/sme_api.h new file +265 -0

265 lines not on this page · raw message

drivers/staging/winbond/sme_s.h new file +228 -0

228 lines not on this page · raw message

drivers/staging/winbond/wb35_ver.h new file +30 -0
new file mode 100644
index 0000000..2433bc0

Lines of this file are not shown. View the raw message.

drivers/staging/winbond/wbhal.c new file +878 -0

878 lines not on this page · raw message

drivers/staging/winbond/wbhal_f.h new file +122 -0

122 lines not on this page · raw message

drivers/staging/winbond/wbhal_s.h new file +615 -0

615 lines not on this page · raw message

drivers/staging/winbond/wblinux.c new file +277 -0

277 lines not on this page · raw message

drivers/staging/winbond/wblinux_f.h new file +23 -0
new file mode 100644
index 0000000..68240c5

Lines of this file are not shown. View the raw message.

drivers/staging/winbond/wblinux_s.h new file +45 -0

45 lines not on this page · raw message

The rest of this diff is not shown. View the raw message.

Signature · 1 line
1.6.0.2

Part of the diff is not shown here. View the raw message.

#13 lore raw

Re: [PATCH 14/23] Staging: add w35und wifi driver

Quoted 7 lines · Greg KH

From: Pavel Machek <[email protected]>

This is driver for w35und usb wifi -- also in kohjinsha

drivers/staging/winbond/Kconfig line 7

Quoted 7 lines
drivers/staging/winbond/Kconfig new file +7 -0
@@ -0,0 +1,7 @@
+config W35UND
+	tristate "Winbond driver"
+	depends on MAC80211 && WLAN_80211 && EXPERIMENTAL && !4KSTACKS
+	default n
+	---help---
+	  This is highly experimental driver for winbond wifi card on some Kohjinsha notebooks
+	  Check http://code.google.com/p/winbondport/ for new version

W35UND should depend on USB

---
 drivers/staging/winbond/Kconfig |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/winbond/Kconfig +1 -1
@@ -1,6 +1,6 @@
 config W35UND
 	tristate "Winbond driver"
-	depends on MAC80211 && WLAN_80211 && EXPERIMENTAL && !4KSTACKS
+	depends on MAC80211 && WLAN_80211 && USB && EXPERIMENTAL && !4KSTACKS
 	default n
 	---help---
 	  This is highly experimental driver for winbond wifi card on some Kohjinsha notebooks

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds

author
#14 lore raw

PATCH 16/23 Staging: add echo cancelation module

In reply to Greg KH

From: David Rowe <[email protected]>

This is used by mISDN and Zaptel drivers.

From: Steve Underwood <[email protected]>
From: David Rowe <[email protected]>

---
 drivers/staging/Kconfig               |    2 +
 drivers/staging/Makefile              |    1 +
 drivers/staging/echo/Kconfig          |    9 +
 drivers/staging/echo/Makefile         |    1 +
 drivers/staging/echo/TODO             |   10 +
 drivers/staging/echo/bit_operations.h |  253 +++++++++++++
 drivers/staging/echo/echo.c           |  632 +++++++++++++++++++++++++++++++++
 drivers/staging/echo/echo.h           |  220 ++++++++++++
 drivers/staging/echo/fir.h            |  369 +++++++++++++++++++
 drivers/staging/echo/mmx.h            |  288 +++++++++++++++
 10 files changed, 1785 insertions(+), 0 deletions(-)
 create mode 100644 drivers/staging/echo/Kconfig
 create mode 100644 drivers/staging/echo/Makefile
 create mode 100644 drivers/staging/echo/TODO
 create mode 100644 drivers/staging/echo/bit_operations.h
 create mode 100644 drivers/staging/echo/echo.c
 create mode 100644 drivers/staging/echo/echo.h
 create mode 100644 drivers/staging/echo/fir.h
 create mode 100644 drivers/staging/echo/mmx.h
drivers/staging/Kconfig +2 -0
index 762b471..25338b7 100644
@@ -39,4 +39,6 @@ source "drivers/staging/winbond/Kconfig"
 
 source "drivers/staging/wlan-ng/Kconfig"
 
+source "drivers/staging/echo/Kconfig"
+
 endif # STAGING
drivers/staging/Makefile +1 -0
index 5741984..93decb8 100644
@@ -8,3 +8,4 @@ obj-$(CONFIG_VIDEO_GO7007)	+= go7007/
 obj-$(CONFIG_USB_IP_COMMON)	+= usbip/
 obj-$(CONFIG_W35UND)		+= winbond/
 obj-$(CONFIG_PRISM2_USB)	+= wlan-ng/
+obj-$(CONFIG_ECHO)		+= echo/
drivers/staging/echo/Kconfig new file +9 -0
new file mode 100644
index 0000000..f1d41ea
@@ -0,0 +1,9 @@
+config ECHO
+	tristate "Line Echo Canceller support"
+	default n
+	---help---
+	  This driver provides line echo cancelling support for mISDN and
+	  Zaptel drivers.
+
+	  To compile this driver as a module, choose M here. The module
+	  will be called echo.
drivers/staging/echo/Makefile new file +1 -0
new file mode 100644
index 0000000..7d4caac
@@ -0,0 +1 @@
+obj-$(CONFIG_ECHO) += echo.o
drivers/staging/echo/TODO new file +10 -0
new file mode 100644
index 0000000..1ca09af
@@ -0,0 +1,10 @@
+TODO:
+	- checkpatch.pl cleanups
+	- Lindent
+	- typedef removals
+	- handle bit_operations.h (merge in or make part of common code?)
+	- remove proc interface, only use echo.h interface (proc interface is
+	  racy and not correct.)
+
+Please send patches to Greg Kroah-Hartman <[email protected]> and Cc: Steve
+Underwood <[email protected]> and David Rowe <[email protected]>
drivers/staging/echo/bit_operations.h new file +253 -0

253 lines not on this page · raw message

drivers/staging/echo/echo.c new file +632 -0

632 lines not on this page · raw message

drivers/staging/echo/echo.h new file +220 -0

220 lines not on this page · raw message

drivers/staging/echo/fir.h new file +369 -0

369 lines not on this page · raw message

drivers/staging/echo/mmx.h new file +288 -0

288 lines not on this page · raw message

Signature · 1 line
1.6.0.2
#15 lore raw

Re: [PATCH 16/23] Staging: add echo cancelation module

Quoted 1 line · Greg KH

+#ifdef __BLACKFIN_ASM__

shouldnt this be CONFIG_BLACKFIN or just __bfin__ ? unless i missed some magic, that define doesnt get defined anywhere ... -mike

author
#16 lore raw

Re: [PATCH 16/23] Staging: add echo cancelation module

Quoted 5 lines · Mike Frysinger
Quoted 1 line · Greg KH

+#ifdef __BLACKFIN_ASM__

shouldnt this be CONFIG_BLACKFIN or just __bfin__ ? unless i missed some magic, that define doesnt get defined anywhere ...

Probably, this code still needs to be cleaned up, hence the placement in the staging tree :)

Patches gladly accepted to fix stuff like this, and anything else people want to help out with, are always greatly appreciated.

thanks,

greg k-h

#17 lore raw

Re: [PATCH 16/23] Staging: add echo cancelation module

In reply to Greg KH

While there are a number of small issues in this code, I personally would like to first and foremost get a usable interface so I could get a working echo canceller module into dahdi:
http://svn.digium.com/svn/dahdi/linux/trunk/
http://svn.digium.com/svn/dahdi/linux/trunk/drivers/dahdi/

(Don't preach me that it should be included in mainline. Or if you do, do it in a different thread, please)

1. echo.h (The interface) needlessly includes the definition of definition of echo_can_state_t. Anywhere in the interface it is used as a pointer, including a _create and _destory function.

2. Furthermore, anybody that includes fir.h must also define malloc first. See echo.c . fir.h is included for the definition of echo_can_state_t .

3. In that specific environment (dahdi/zaptel) echo_can is not a very unique prefix. Thus in my provisional change I added oslec_ as a prefix.

I'm not sure how much (3) counts here.

My current working tree is in not in the best place: the debian (non-existing) package dahdi-linux . See

http://svn.debian.org/viewsvn/pkg-voip?rev=6284&view=rev

I hope that once I get a clear enough interface I can kick out the oslec subdirectory and move the EC module upstream.

Also:

drivers/staging/echo/TODO line 7

Quoted 10 lines · Greg KH
drivers/staging/echo/TODO new file +3 -0
new file mode 100644
index 0000000..1ca09af
@@ -0,0 +1,10 @@
+TODO:
 
+	- remove proc interface, only use echo.h interface (proc interface is
+	  racy and not correct.)

Already done, right? I don't see any _wrapper.c around.

Signature · 4 lines
               Tzafrir Cohen
icq#16849755              jabber:[email protected]
+972-50-7952406           mailto:[email protected]
http://www.xorcom.com  iax:[email protected]/tzafrir
author
#18 lore raw

Re: [PATCH 16/23] Staging: add echo cancelation module

Quoted 5 lines · Tzafrir Cohen

While there are a number of small issues in this code, I personally would like to first and foremost get a usable interface so I could get a working echo canceller module into dahdi:
http://svn.digium.com/svn/dahdi/linux/trunk/
http://svn.digium.com/svn/dahdi/linux/trunk/drivers/dahdi/

Ok, that's great. I'm not saying that the current interface for this driver is correct, that is why it is in the staging tree :)

It will change, don't worry.

But, what should it change into?

Quoted 3 lines

1. echo.h (The interface) needlessly includes the definition of definition of echo_can_state_t. Anywhere in the interface it is used as a pointer, including a _create and _destory function.

Simple to fix up.

Quoted 3 lines

2. Furthermore, anybody that includes fir.h must also define malloc first. See echo.c . fir.h is included for the definition of echo_can_state_t .

That will be resolved as well.

Quoted 2 lines

3. In that specific environment (dahdi/zaptel) echo_can is not a very unique prefix. Thus in my provisional change I added oslec_ as a prefix.

Ok, that seems very reasonable. The whole module should probably have that added as a prefix as well.

Quoted 1 line

I'm not sure how much (3) counts here.

Lots :)

Quoted 7 lines

My current working tree is in not in the best place: the debian (non-existing) package dahdi-linux . See

http://svn.debian.org/viewsvn/pkg-voip?rev=6284&view=rev

I hope that once I get a clear enough interface I can kick out the oslec subdirectory and move the EC module upstream.

Care to send me patches to help resolve these issues to make it easier for you?

Quoted 10 lines · Greg KH
Quoted 8 lines
drivers/staging/echo/TODO new file +1 -0
new file mode 100644
index 0000000..1ca09af
@@ -0,0 +1,10 @@
+TODO:
Quoted 4 lines

drivers/staging/echo/TODO line 7

Quoted 2 lines
drivers/staging/echo/TODO new file +2 -0
+	- remove proc interface, only use echo.h interface (proc interface is
+	  racy and not correct.)

Already done, right? I don't see any _wrapper.c around.

Ah, good point, forgot that was already removed.

thanks,

greg k-h

author
#19 lore raw

Re: [PATCH 16/23] Staging: add echo cancelation module

In reply to Tzafrir Cohen
Quoted 8 lines · Tzafrir Cohen

While there are a number of small issues in this code, I personally would like to first and foremost get a usable interface so I could get a working echo canceller module into dahdi:
http://svn.digium.com/svn/dahdi/linux/trunk/
http://svn.digium.com/svn/dahdi/linux/trunk/drivers/dahdi/

(Don't preach me that it should be included in mainline. Or if you do, do it in a different thread, please)

Ok, different thread :)

What is needed in order for you to include this in mainline?

Can it be placed in drivers/staging for now?

thanks,

greg k-h

author
#20 lore raw

PATCH 17/23 Staging: Fix gcc warnings in sxg

In reply to Greg KH

From: J.R. Mauro <[email protected]>

Fix for compiler warning about format specifier in prints in drivers/staging/sxg/sxg.c
Prints were using %x to print unsigned long data.

---
 drivers/staging/sxg/sxg.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)
drivers/staging/sxg/sxg.c +4 -4
index a91c9f3..0117d51 100644
@@ -453,7 +453,7 @@ static int sxg_allocate_resources(p_adapter_t adapter)
 	// fails.  If we hit a minimum, fail.
 
 	for (;;) {
-		DBG_ERROR("%s Allocate XmtRings size[%x]\n", __FUNCTION__,
+		DBG_ERROR("%s Allocate XmtRings size[%lx]\n", __FUNCTION__,
 			  (sizeof(SXG_XMT_RING) * 1));
 
 		// Start with big items first - receive and transmit rings.  At the moment
@@ -470,7 +470,7 @@ static int sxg_allocate_resources(p_adapter_t adapter)
 		}
 		memset(adapter->XmtRings, 0, sizeof(SXG_XMT_RING) * 1);
 
-		DBG_ERROR("%s Allocate RcvRings size[%x]\n", __FUNCTION__,
+		DBG_ERROR("%s Allocate RcvRings size[%lx]\n", __FUNCTION__,
 			  (sizeof(SXG_RCV_RING) * 1));
 		adapter->RcvRings =
 		    pci_alloc_consistent(adapter->pcidev,
@@ -531,7 +531,7 @@ static int sxg_allocate_resources(p_adapter_t adapter)
 		return (STATUS_RESOURCES);
 	}
 
-	DBG_ERROR("%s Allocate EventRings size[%x]\n", __FUNCTION__,
+	DBG_ERROR("%s Allocate EventRings size[%lx]\n", __FUNCTION__,
 		  (sizeof(SXG_EVENT_RING) * RssIds));
 
 	// Allocate event queues.
@@ -562,7 +562,7 @@ static int sxg_allocate_resources(p_adapter_t adapter)
 	}
 	memset(adapter->Isr, 0, sizeof(u32) * IsrCount);
 
-	DBG_ERROR("%s Allocate shared XMT ring zero index location size[%x]\n",
+	DBG_ERROR("%s Allocate shared XMT ring zero index location size[%lx]\n",
 		  __FUNCTION__, sizeof(u32));
 
 	// Allocate shared XMT ring zero index location
Signature · 1 line
1.6.0.2
author
#21 lore raw

PATCH 18/23 Staging: go7007 v4l fixes

In reply to Greg KH

From: Ross Cohen <[email protected]>

Fix up some of the v4l issues that were recently changed to make the go7007 driver a bit cleaner.

From: Ross Cohen <[email protected]>

---
 drivers/staging/go7007/go7007-driver.c  |    2 +-
 drivers/staging/go7007/go7007-v4l2.c    |   12 ++++--------
 drivers/staging/go7007/snd-go7007.c     |    4 ++--
 drivers/staging/go7007/wis-ov7640.c     |    3 +--
 drivers/staging/go7007/wis-saa7113.c    |   25 ++++++++++---------------
 drivers/staging/go7007/wis-saa7115.c    |   29 ++++++++++++++---------------
 drivers/staging/go7007/wis-sony-tuner.c |    3 ++-
 drivers/staging/go7007/wis-tw2804.c     |   29 ++++++++++++++---------------
 drivers/staging/go7007/wis-tw9903.c     |   21 ++++++++++-----------
 drivers/staging/go7007/wis-uda1342.c    |    2 +-
 10 files changed, 59 insertions(+), 71 deletions(-)
drivers/staging/go7007/go7007-driver.c +1 -1
index 5a336ff..81ae4b0 100644
@@ -31,7 +31,7 @@
 #include <linux/semaphore.h>
 #include <linux/uaccess.h>
 #include <asm/system.h>
-#include <linux/videodev.h>
+#include <linux/videodev2.h>
 #include <media/tuner.h>
 #include <media/v4l2-common.h>
 
drivers/staging/go7007/go7007-v4l2.c +4 -8
index d54d019..94e1141 100644
@@ -26,8 +26,7 @@
 #include <linux/time.h>
 #include <linux/vmalloc.h>
 #include <linux/pagemap.h>
-#include <linux/videodev.h>
-#include <linux/video_decoder.h>
+#include <linux/videodev2.h>
 #include <media/v4l2-common.h>
 #include <media/v4l2-ioctl.h>
 #include <linux/i2c.h>
@@ -835,7 +834,6 @@ static int go7007_do_ioctl(struct inode *inode, struct file *file,
 	case VIDIOC_S_STD:
 	{
 		v4l2_std_id *std = arg;
-		int norm;
 
 		if (go->streaming)
 			return -EBUSY;
@@ -856,20 +854,17 @@ static int go7007_do_ioctl(struct inode *inode, struct file *file,
 		if (*std & V4L2_STD_NTSC) {
 			go->standard = GO7007_STD_NTSC;
 			go->sensor_framerate = 30000;
-			norm = VIDEO_MODE_NTSC;
 		} else if (*std & V4L2_STD_PAL) {
 			go->standard = GO7007_STD_PAL;
 			go->sensor_framerate = 25025;
-			norm = VIDEO_MODE_PAL;
 		} else if (*std & V4L2_STD_SECAM) {
 			go->standard = GO7007_STD_PAL;
 			go->sensor_framerate = 25025;
-			norm = VIDEO_MODE_SECAM;
 		} else
 			return -EINVAL;
 		if (go->i2c_adapter_online)
 			i2c_clients_command(&go->i2c_adapter,
-						DECODER_SET_NORM, &norm);
+					    VIDIOC_S_STD, std);
 		set_capture_size(go, NULL, 0);
 		return 0;
 	}
@@ -933,7 +928,7 @@ static int go7007_do_ioctl(struct inode *inode, struct file *file,
 			return -EBUSY;
 		go->input = *input;
 		if (go->i2c_adapter_online) {
-			i2c_clients_command(&go->i2c_adapter, DECODER_SET_INPUT,
+			i2c_clients_command(&go->i2c_adapter, VIDIOC_S_INPUT,
 				&go->board_info->inputs[*input].video_input);
 			i2c_clients_command(&go->i2c_adapter, VIDIOC_S_AUDIO,
 				&go->board_info->inputs[*input].audio_input);
@@ -1459,6 +1454,7 @@ static struct file_operations go7007_fops = {
 
 static struct video_device go7007_template = {
 	.name		= "go7007",
+	.vfl_type	= VID_TYPE_CAPTURE,
 	.fops		= &go7007_fops,
 	.minor		= -1,
 	.release	= go7007_vfl_release,
drivers/staging/go7007/snd-go7007.c +2 -2
index f5cac08..382740c 100644
@@ -44,8 +44,8 @@ module_param_array(index, int, NULL, 0444);
 module_param_array(id, charp, NULL, 0444);
 module_param_array(enable, bool, NULL, 0444);
 MODULE_PARM_DESC(index, "Index value for the go7007 audio driver");
-MODULE_PARM_DESC(index, "ID string for the go7007 audio driver");
-MODULE_PARM_DESC(index, "Enable for the go7007 audio driver");
+MODULE_PARM_DESC(id, "ID string for the go7007 audio driver");
+MODULE_PARM_DESC(enable, "Enable for the go7007 audio driver");
 
 struct go7007_snd {
 	struct snd_card *card;
drivers/staging/go7007/wis-ov7640.c +1 -2
index 815615a..f5f11e9 100644
@@ -19,8 +19,7 @@
 #include <linux/init.h>
 #include <linux/version.h>
 #include <linux/i2c.h>
-#include <linux/videodev.h>
-#include <linux/video_decoder.h>
+#include <linux/videodev2.h>
 
 #include "wis-i2c.h"
 
drivers/staging/go7007/wis-saa7113.c +10 -15
index 4b14ca8..c1aff1b 100644
@@ -19,8 +19,7 @@
 #include <linux/init.h>
 #include <linux/version.h>
 #include <linux/i2c.h>
-#include <linux/videodev.h>
-#include <linux/video_decoder.h>
+#include <linux/videodev2.h>
 #include <linux/ioctl.h>
 
 #include "wis-i2c.h"
@@ -124,7 +123,7 @@ static int wis_saa7113_command(struct i2c_client *client,
 	struct wis_saa7113 *dec = i2c_get_clientdata(client);
 
 	switch (cmd) {
-	case DECODER_SET_INPUT:
+	case VIDIOC_S_INPUT:
 	{
 		int *input = arg;
 
@@ -133,23 +132,19 @@ static int wis_saa7113_command(struct i2c_client *client,
 				*input < 6 ? 0x40 : 0x80);
 		break;
 	}
-	case DECODER_SET_NORM:
+	case VIDIOC_S_STD:
 	{
-		int *input = arg;
+		v4l2_std_id *input = arg;
 		dec->norm = *input;
-		switch (dec->norm) {
-		case VIDEO_MODE_PAL:
-			write_reg(client, 0x0e, 0x01);
-			write_reg(client, 0x10, 0x48);
-			break;
-		case VIDEO_MODE_NTSC:
+		if (dec->norm & V4L2_STD_NTSC) {
 			write_reg(client, 0x0e, 0x01);
 			write_reg(client, 0x10, 0x40);
-			break;
-		case VIDEO_MODE_SECAM:
+		} else if (dec->norm & V4L2_STD_PAL) {
+			write_reg(client, 0x0e, 0x01);
+			write_reg(client, 0x10, 0x48);
+		} else if (dec->norm * V4L2_STD_SECAM) {
 			write_reg(client, 0x0e, 0x50);
 			write_reg(client, 0x10, 0x48);
-			break;
 		}
 		break;
 	}
@@ -295,7 +290,7 @@ static int wis_saa7113_detect(struct i2c_adapter *adapter, int addr, int kind)
 		kfree(client);
 		return -ENOMEM;
 	}
-	dec->norm = VIDEO_MODE_NTSC;
+	dec->norm = V4L2_STD_NTSC;
 	dec->brightness = 128;
 	dec->contrast = 71;
 	dec->saturation = 64;
drivers/staging/go7007/wis-saa7115.c +14 -15
index bd40bf4..5c94c88 100644
@@ -19,8 +19,7 @@
 #include <linux/init.h>
 #include <linux/version.h>
 #include <linux/i2c.h>
-#include <linux/videodev.h>
-#include <linux/video_decoder.h>
+#include <linux/videodev2.h>
 #include <linux/ioctl.h>
 
 #include "wis-i2c.h"
@@ -204,7 +203,7 @@ static int wis_saa7115_command(struct i2c_client *client,
 	struct wis_saa7115 *dec = i2c_get_clientdata(client);
 
 	switch (cmd) {
-	case DECODER_SET_INPUT:
+	case VIDIOC_S_INPUT:
 	{
 		int *input = arg;
 
@@ -222,7 +221,7 @@ static int wis_saa7115_command(struct i2c_client *client,
 		int h_scaling_increment = (704 / h_integer_scaler) *
 					1024 / res->width;
 		/* Fine-grained scaler only */
-		int v_scaling_increment = (dec->norm == VIDEO_MODE_NTSC ?
+		int v_scaling_increment = (dec->norm & V4L2_STD_NTSC ?
 				240 : 288) * 1024 / res->height;
 		u8 regs[] = {
 			0x88,	0xc0,
@@ -262,20 +261,20 @@ static int wis_saa7115_command(struct i2c_client *client,
 		write_regs(client, regs);
 		break;
 	}
-	case DECODER_SET_NORM:
+	case VIDIOC_S_STD:
 	{
-		int *input = arg;
+		v4l2_std_id *input = arg;
 		u8 regs[] = {
 			0x88,	0xc0,
-			0x98,	*input == VIDEO_MODE_NTSC ? 0x12 : 0x16,
-			0x9a,	*input == VIDEO_MODE_NTSC ? 0xf2 : 0x20,
-			0x9b,	*input == VIDEO_MODE_NTSC ? 0x00 : 0x01,
-			0xc8,	*input == VIDEO_MODE_NTSC ? 0x12 : 0x16,
-			0xca,	*input == VIDEO_MODE_NTSC ? 0xf2 : 0x20,
-			0xcb,	*input == VIDEO_MODE_NTSC ? 0x00 : 0x01,
+			0x98,	*input & V4L2_STD_NTSC ? 0x12 : 0x16,
+			0x9a,	*input & V4L2_STD_NTSC ? 0xf2 : 0x20,
+			0x9b,	*input & V4L2_STD_NTSC ? 0x00 : 0x01,
+			0xc8,	*input & V4L2_STD_NTSC ? 0x12 : 0x16,
+			0xca,	*input & V4L2_STD_NTSC ? 0xf2 : 0x20,
+			0xcb,	*input & V4L2_STD_NTSC ? 0x00 : 0x01,
 			0x88,	0xf0,
-			0x30,	*input == VIDEO_MODE_NTSC ? 0x66 : 0x00,
-			0x31,	*input == VIDEO_MODE_NTSC ? 0x90 : 0xe0,
+			0x30,	*input & V4L2_STD_NTSC ? 0x66 : 0x00,
+			0x31,	*input & V4L2_STD_NTSC ? 0x90 : 0xe0,
 			0,	0,
 		};
 		write_regs(client, regs);
@@ -424,7 +423,7 @@ static int wis_saa7115_detect(struct i2c_adapter *adapter, int addr, int kind)
 		kfree(client);
 		return -ENOMEM;
 	}
-	dec->norm = VIDEO_MODE_NTSC;
+	dec->norm = V4L2_STD_NTSC;
 	dec->brightness = 128;
 	dec->contrast = 64;
 	dec->saturation = 64;
drivers/staging/go7007/wis-sony-tuner.c +2 -1
index 82e66d6..5997fb4 100644
@@ -19,9 +19,10 @@
 #include <linux/init.h>
 #include <linux/version.h>
 #include <linux/i2c.h>
-#include <linux/videodev.h>
+#include <linux/videodev2.h>
 #include <media/tuner.h>
 #include <media/v4l2-common.h>
+#include <media/v4l2-ioctl.h>
 
 #include "wis-i2c.h"
 
drivers/staging/go7007/wis-tw2804.c +14 -15
index 69ed7bf..27fe4d0 100644
@@ -19,8 +19,7 @@
 #include <linux/init.h>
 #include <linux/version.h>
 #include <linux/i2c.h>
-#include <linux/videodev.h>
-#include <linux/video_decoder.h>
+#include <linux/videodev2.h>
 #include <linux/ioctl.h>
 
 #include "wis-i2c.h"
@@ -159,20 +158,20 @@ static int wis_tw2804_command(struct i2c_client *client,
 	}
 
 	switch (cmd) {
-	case DECODER_SET_NORM:
+	case VIDIOC_S_STD:
 	{
-		int *input = arg;
+		v4l2_std_id *input = arg;
 		u8 regs[] = {
-			0x01, *input == VIDEO_MODE_NTSC ? 0xc4 : 0x84,
-			0x09, *input == VIDEO_MODE_NTSC ? 0x07 : 0x04,
-			0x0a, *input == VIDEO_MODE_NTSC ? 0xf0 : 0x20,
-			0x0b, *input == VIDEO_MODE_NTSC ? 0x07 : 0x04,
-			0x0c, *input == VIDEO_MODE_NTSC ? 0xf0 : 0x20,
-			0x0d, *input == VIDEO_MODE_NTSC ? 0x40 : 0x4a,
-			0x16, *input == VIDEO_MODE_NTSC ? 0x00 : 0x40,
-			0x17, *input == VIDEO_MODE_NTSC ? 0x00 : 0x40,
-			0x20, *input == VIDEO_MODE_NTSC ? 0x07 : 0x0f,
-			0x21, *input == VIDEO_MODE_NTSC ? 0x07 : 0x0f,
+			0x01, *input & V4L2_STD_NTSC ? 0xc4 : 0x84,
+			0x09, *input & V4L2_STD_NTSC ? 0x07 : 0x04,
+			0x0a, *input & V4L2_STD_NTSC ? 0xf0 : 0x20,
+			0x0b, *input & V4L2_STD_NTSC ? 0x07 : 0x04,
+			0x0c, *input & V4L2_STD_NTSC ? 0xf0 : 0x20,
+			0x0d, *input & V4L2_STD_NTSC ? 0x40 : 0x4a,
+			0x16, *input & V4L2_STD_NTSC ? 0x00 : 0x40,
+			0x17, *input & V4L2_STD_NTSC ? 0x00 : 0x40,
+			0x20, *input & V4L2_STD_NTSC ? 0x07 : 0x0f,
+			0x21, *input & V4L2_STD_NTSC ? 0x07 : 0x0f,
 			0xff,	0xff,
 		};
 		write_regs(client, regs, dec->channel);
@@ -322,7 +321,7 @@ static int wis_tw2804_detect(struct i2c_adapter *adapter, int addr, int kind)
 		return -ENOMEM;
 	}
 	dec->channel = -1;
-	dec->norm = VIDEO_MODE_NTSC;
+	dec->norm = V4L2_STD_NTSC;
 	dec->brightness = 128;
 	dec->contrast = 128;
 	dec->saturation = 128;
drivers/staging/go7007/wis-tw9903.c +10 -11
index 1cdf01a..d8e4196 100644
@@ -19,8 +19,7 @@
 #include <linux/init.h>
 #include <linux/version.h>
 #include <linux/i2c.h>
-#include <linux/videodev.h>
-#include <linux/video_decoder.h>
+#include <linux/videodev2.h>
 #include <linux/ioctl.h>
 
 #include "wis-i2c.h"
@@ -106,7 +105,7 @@ static int wis_tw9903_command(struct i2c_client *client,
 	struct wis_tw9903 *dec = i2c_get_clientdata(client);
 
 	switch (cmd) {
-	case DECODER_SET_INPUT:
+	case VIDIOC_S_INPUT:
 	{
 		int *input = arg;
 
@@ -119,7 +118,7 @@ static int wis_tw9903_command(struct i2c_client *client,
 		struct video_decoder_resolution *res = arg;
 		/*int hscale = 256 * 720 / res->width;*/
 		int hscale = 256 * 720 / (res->width - (res->width > 704 ? 0 : 8));
-		int vscale = 256 * (dec->norm == VIDEO_MODE_NTSC ?  240 : 288)
+		int vscale = 256 * (dec->norm & V4L2_STD_NTSC ?  240 : 288)
 				/ res->height;
 		u8 regs[] = {
 			0x0d, vscale & 0xff,
@@ -134,14 +133,14 @@ static int wis_tw9903_command(struct i2c_client *client,
 		break;
 	}
 #endif
-	case DECODER_SET_NORM:
+	case VIDIOC_S_STD:
 	{
-		int *input = arg;
+		v4l2_std_id *input = arg;
 		u8 regs[] = {
-			0x05, *input == VIDEO_MODE_NTSC ? 0x80 : 0x00,
-			0x07, *input == VIDEO_MODE_NTSC ? 0x02 : 0x12,
-			0x08, *input == VIDEO_MODE_NTSC ? 0x14 : 0x18,
-			0x09, *input == VIDEO_MODE_NTSC ? 0xf0 : 0x20,
+			0x05, *input & V4L2_STD_NTSC ? 0x80 : 0x00,
+			0x07, *input & V4L2_STD_NTSC ? 0x02 : 0x12,
+			0x08, *input & V4L2_STD_NTSC ? 0x14 : 0x18,
+			0x09, *input & V4L2_STD_NTSC ? 0xf0 : 0x20,
 			0,	0,
 		};
 		write_regs(client, regs);
@@ -297,7 +296,7 @@ static int wis_tw9903_detect(struct i2c_adapter *adapter, int addr, int kind)
 		kfree(client);
 		return -ENOMEM;
 	}
-	dec->norm = VIDEO_MODE_NTSC;
+	dec->norm = V4L2_STD_NTSC;
 	dec->brightness = 0;
 	dec->contrast = 0x60;
 	dec->hue = 0;
drivers/staging/go7007/wis-uda1342.c +1 -1
index 28c10bf..a0894e3 100644
@@ -19,7 +19,7 @@
 #include <linux/init.h>
 #include <linux/version.h>
 #include <linux/i2c.h>
-#include <linux/videodev.h>
+#include <linux/videodev2.h>
 #include <media/tvaudio.h>
 #include <media/v4l2-common.h>
 
Signature · 1 line
1.6.0.2
author
#22 lore raw

PATCH 19/23 Staging: SLICOSS: lots of checkpatch fixes

In reply to Greg KH

From: Lior Dotan <[email protected]>

Major cleanups of checkpatch warnings from the slicoss driver.

From: Lior Dotan <[email protected]>

---
 drivers/staging/slicoss/gbdownload.h       |   10 +-
 drivers/staging/slicoss/gbrcvucode.h       |    7 +-
 drivers/staging/slicoss/oasisdbgdownload.h |   10 +-
 drivers/staging/slicoss/oasisdownload.h    |   10 +-
 drivers/staging/slicoss/oasisrcvucode.h    |    6 +-
 drivers/staging/slicoss/slic.h             |  485 +++++-----
 drivers/staging/slicoss/slic_os.h          |   85 +--
 drivers/staging/slicoss/slicbuild.h        |    1 -
 drivers/staging/slicoss/slicdbg.h          |    3 +-
 drivers/staging/slicoss/slicdump.h         |   89 +-
 drivers/staging/slicoss/slichw.h           |  653 +++++++-------
 drivers/staging/slicoss/slicinc.h          |  262 +++---
 drivers/staging/slicoss/slicoss.c          | 1351 +++++++++++++---------------
 13 files changed, 1353 insertions(+), 1619 deletions(-)
drivers/staging/slicoss/gbdownload.h +5 -5
index 0350fb9..794432b 100644
@@ -1,14 +1,14 @@
-#define MOJAVE_UCODE_VERS_STRING	"$Revision: 1.2 $"
-#define MOJAVE_UCODE_VERS_DATE  	"$Date: 2006/03/27 15:12:22 $"
+#define MOJAVE_UCODE_VERS_STRING	"1.2"
+#define MOJAVE_UCODE_VERS_DATE  	"2006/03/27 15:12:22"
 #define MOJAVE_UCODE_HOSTIF_ID  	3
 
-static LONG	MNumSections = 0x2;
-static ULONG	MSectionSize[] =
+static s32 MNumSections = 0x2;
+static u32 MSectionSize[] =
 {
 	0x00008000, 0x00010000,
 };
 
-static ULONG	MSectionStart[] =
+static u32 MSectionStart[] =
 {
 	0x00000000, 0x00008000,
 };
drivers/staging/slicoss/gbrcvucode.h +3 -4
index dc00834..4fa5a4c 100644
@@ -1,7 +1,6 @@
 /*
  * Copyright (c) 1997-2002 Alacritech, Inc. All rights reserved
  *
- * $Id: gbrcvucode.h,v 1.2 2006/03/27 15:12:15 mook Exp $
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -32,10 +31,10 @@
  * official policies, either expressed or implied, of Alacritech, Inc.
  *
  **************************************************************************/
-#define GB_RCVUCODE_VERS_STRING	"$Revision: 1.2 $"
-#define GB_RCVUCODE_VERS_DATE  	"$Date: 2006/03/27 15:12:15 $"
+#define GB_RCVUCODE_VERS_STRING	"1.2"
+#define GB_RCVUCODE_VERS_DATE  	"2006/03/27 15:12:15"
 
-static ULONG GBRcvUCodeLen = 512;
+static u32 GBRcvUCodeLen = 512;
 
 static u8 GBRcvUCode[2560] =
 {
drivers/staging/slicoss/oasisdbgdownload.h +5 -5
index cae5d55..519e007 100644
@@ -1,14 +1,14 @@
-#define OASIS_UCODE_VERS_STRING	"$Revision: 1.2 $"
-#define OASIS_UCODE_VERS_DATE  	"$Date: 2006/03/27 15:11:22 $"
+#define OASIS_UCODE_VERS_STRING	"1.2"
+#define OASIS_UCODE_VERS_DATE  	"2006/03/27 15:11:22"
 #define OASIS_UCODE_HOSTIF_ID  	3
 
-static LONG	ONumSections = 0x2;
-static ULONG	OSectionSize[] =
+static s32 ONumSections = 0x2;
+static u32 OSectionSize[] =
 {
 	0x00004000, 0x00010000,
 };
 
-static ULONG	OSectionStart[] =
+static u32 OSectionStart[] =
 {
 	0x00000000, 0x00008000,
 };
drivers/staging/slicoss/oasisdownload.h +5 -5
index 89a440c..6438c23 100644
@@ -1,13 +1,13 @@
-#define OASIS_UCODE_VERS_STRING	"$Revision: 1.2 $"
-#define OASIS_UCODE_VERS_DATE  	"$Date: 2006/03/27 15:10:37 $"
+#define OASIS_UCODE_VERS_STRING	"1.2"
+#define OASIS_UCODE_VERS_DATE  	"2006/03/27 15:10:37"
 #define OASIS_UCODE_HOSTIF_ID  	3
 
-static LONG ONumSections = 0x2;
-static ULONG OSectionSize[] = {
+static s32 ONumSections = 0x2;
+static u32 OSectionSize[] = {
 	0x00004000, 0x00010000,
 };
 
-static ULONG OSectionStart[] = {
+static u32 OSectionStart[] = {
 	0x00000000, 0x00008000,
 };
 
drivers/staging/slicoss/oasisrcvucode.h +3 -3
index ef91632..5b3531f 100644
@@ -1,7 +1,7 @@
-#define OASIS_RCVUCODE_VERS_STRING	"$Revision: 1.2 $"
-#define OASIS_RCVUCODE_VERS_DATE  	"$Date: 2006/03/27 15:10:28 $"
+#define OASIS_RCVUCODE_VERS_STRING	"1.2"
+#define OASIS_RCVUCODE_VERS_DATE  	"2006/03/27 15:10:28"
 
-static ULONG OasisRcvUCodeLen = 512;
+static u32 OasisRcvUCodeLen = 512;
 
 static u8 OasisRcvUCode[2560] =
 {
drivers/staging/slicoss/slic.h +240 -245

657 lines not on this page · raw message

drivers/staging/slicoss/slic_os.h +2 -83

118 lines not on this page · raw message

drivers/staging/slicoss/slicbuild.h +0 -1
index ddf1665..ae05e04 100644
@@ -2,7 +2,6 @@
  *
  * Copyright (c) 2000-2002 Alacritech, Inc.  All rights reserved.
  *
- * $Id: slicbuild.h,v 1.2 2006/03/27 15:10:10 mook Exp $
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
drivers/staging/slicoss/slicdbg.h +1 -2
index c1be56f..c54e44f 100644
@@ -2,7 +2,6 @@
  *
  * Copyright (c) 2000-2002 Alacritech, Inc.  All rights reserved.
  *
- * $Id: slicdbg.h,v 1.2 2006/03/27 15:10:04 mook Exp $
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -66,7 +65,7 @@
 #ifdef CONFIG_X86_64
 #define VALID_ADDRESS(p)  (1)
 #else
-#define VALID_ADDRESS(p)  (((ulong32)(p) & 0x80000000) || ((ulong32)(p) == 0))
+#define VALID_ADDRESS(p)  (((u32)(p) & 0x80000000) || ((u32)(p) == 0))
 #endif
 #ifndef ASSERT
 #define ASSERT(a)                                                             \
drivers/staging/slicoss/slicdump.h +44 -45

128 lines not on this page · raw message

drivers/staging/slicoss/slichw.h +324 -329

905 lines not on this page · raw message

drivers/staging/slicoss/slicinc.h +116 -146

287 lines not on this page · raw message

drivers/staging/slicoss/slicoss.c +605 -746

797 lines not on this page · raw message

The rest of this diff is not shown. View the raw message.

Signature · 1 line
1.6.0.2

Part of the diff is not shown here. View the raw message.

author
#23 lore raw

PATCH 20/23 Staging: SLICOSS: Fix warnings due to static usage

In reply to Greg KH

From: Lior Dotan <[email protected]>

Fix a few warning messages that crept in due to conversion of all the functions to static

---
 drivers/staging/slicoss/slicinc.h |    6 ------
 drivers/staging/slicoss/slicoss.c |    3 ++-
 2 files changed, 2 insertions(+), 7 deletions(-)
drivers/staging/slicoss/slicinc.h +0 -6
index 610c1ab..71288c4 100644
@@ -61,7 +61,6 @@ static void slic_xmit_fail(struct adapter    *adapter,
 			void *cmd,
 			u32           skbtype,
 			u32           status);
-static void slic_xmit_timeout(struct net_device *dev);
 static void slic_config_pci(struct pci_dev *pcidev);
 static struct sk_buff *slic_rcvqueue_getnext(struct adapter *adapter);
 
@@ -90,8 +89,6 @@ static void  slic_cmdq_free(struct adapter *adapter);
 static void  slic_cmdq_reset(struct adapter *adapter);
 static void  slic_cmdq_addcmdpage(struct adapter *adapter, u32 *page);
 static void  slic_cmdq_getdone(struct adapter *adapter);
-static void  slic_cmdq_putdone(struct adapter *adapter,
-						struct slic_hostcmd *cmd);
 static void  slic_cmdq_putdone_irq(struct adapter *adapter,
 						struct slic_hostcmd *cmd);
 static struct slic_hostcmd *slic_cmdq_getfree(struct adapter *adapter);
@@ -103,7 +100,6 @@ static void  slic_rcvqueue_free(struct adapter *adapter);
 static void slic_rcv_handle_error(struct adapter *adapter,
 					struct slic_rcvbuf *rcvbuf);
 static void slic_adapter_set_hwaddr(struct adapter *adapter);
-static void slic_card_halt(struct sliccard *card, struct adapter *adapter);
 static int slic_card_init(struct sliccard *card, struct adapter *adapter);
 static void slic_intagg_set(struct adapter *adapter, u32 value);
 static int  slic_card_download(struct adapter *adapter);
@@ -120,7 +116,6 @@ static void slic_unmap_mmio_space(struct adapter *adapter);
 static void slic_card_cleanup(struct sliccard *card);
 static void slic_init_cleanup(struct adapter *adapter);
 static void slic_soft_reset(struct adapter *adapter);
-static void slic_card_reset(struct adapter *adapter);
 static bool slic_mac_filter(struct adapter *adapter,
 			struct ether_header *ether_frame);
 static void slic_mac_address_config(struct adapter *adapter);
@@ -133,7 +128,6 @@ static void slic_config_set(struct adapter *adapter, bool linkchange);
 static void slic_config_clear(struct adapter *adapter);
 static void slic_config_get(struct adapter *adapter, u32 config,
 			u32 configh);
-static void slic_timer_get_stats(ulong device);
 static void slic_timer_load_check(ulong context);
 static void slic_timer_ping(ulong dev);
 static void slic_assert_fail(void);
drivers/staging/slicoss/slicoss.c +2 -1
index eb61565..f242477 100644
@@ -3128,6 +3128,7 @@ static int slic_mac_set_address(struct net_device *dev, void *ptr)
  * 50 seconds or whatever STATS_TIMER_INTERVAL is set to.
  *
  */
+#if SLIC_GET_STATS_TIMER_ENABLED
 static void slic_timer_get_stats(ulong dev)
 {
 	struct adapter *adapter;
@@ -3163,7 +3164,7 @@ static void slic_timer_get_stats(ulong dev)
 	    SLIC_SECS_TO_JIFFS(STATS_TIMER_INTERVAL);
 	add_timer(&adapter->statstimer);
 }
-
+#endif
 static void slic_timer_load_check(ulong cardaddr)
 {
 	struct sliccard *card = (struct sliccard *)cardaddr;
Signature · 1 line
1.6.0.2
author
#24 lore raw

PATCH 21/23 Staging: SLICOSS: Fix remaining type names

In reply to Greg KH

From: Lior Dotan <[email protected]>

Fix the remaining variables that still had '_t' as a postfix and also a couple of checkpatch warnings.

---
 drivers/staging/slicoss/slic_os.h  |    6 ++++--
 drivers/staging/slicoss/slicdump.h |    2 +-
 drivers/staging/slicoss/slichw.h   |    6 +++---
 drivers/staging/slicoss/slicoss.c  |   30 +++++++++++++++---------------
 4 files changed, 23 insertions(+), 21 deletions(-)
drivers/staging/slicoss/slic_os.h +4 -2
index b0d2883..46c6784 100644
@@ -53,7 +53,8 @@
 	{                                                           \
 		adapter->card->reg_type[adapter->card->debug_ix] = 0;   \
 		adapter->card->reg_offset[adapter->card->debug_ix] = \
-			((unsigned char *)(&reg)) - ((unsigned char *)adapter->slic_regs); \
+		((unsigned char *)(&reg)) - \
+		((unsigned char *)adapter->slic_regs); \
 		adapter->card->reg_value[adapter->card->debug_ix++] = value;  \
 		if (adapter->card->debug_ix == 32) \
 			adapter->card->debug_ix = 0;                      \
@@ -63,7 +64,8 @@
 	{                                                           \
 		adapter->card->reg_type[adapter->card->debug_ix] = 1;        \
 		adapter->card->reg_offset[adapter->card->debug_ix] = \
-			((unsigned char *)(&reg)) - ((unsigned char *)adapter->slic_regs); \
+		((unsigned char *)(&reg)) - \
+		((unsigned char *)adapter->slic_regs); \
 		adapter->card->reg_value[adapter->card->debug_ix] = value;   \
 		adapter->card->reg_valueh[adapter->card->debug_ix++] = valh;  \
 		if (adapter->card->debug_ix == 32) \
drivers/staging/slicoss/slicdump.h +1 -1
index ca0a221..92a9b44 100644
@@ -228,7 +228,7 @@ struct CORE_Q {
 #define DRIVER_NAME_SIZE    32
 
 struct sliccore_hdr {
-    unsigned char   driver_version[DRIVER_NAME_SIZE];    /* Driver version string */
+    unsigned char driver_version[DRIVER_NAME_SIZE]; /* Driver version string */
     u32   RcvRegOff;          /* Offset of receive registers */
     u32   RcvRegsize;         /* size of receive registers */
     u32   XmtRegOff;          /* Offset of transmit registers */
drivers/staging/slicoss/slichw.h +3 -3
index 4c5c15d..d03e90b 100644
@@ -702,7 +702,7 @@ struct vendor4_fru {
     unsigned char        pad[3];
 };
 
-union oemfru_t {
+union oemfru {
     struct vendor1_fru   vendor1_fru;
     struct vendor2_fru   vendor2_fru;
     struct vendor3_fru   vendor3_fru;
@@ -764,7 +764,7 @@ struct slic_eeprom {
 	unsigned char	FruFormat;	/* Alacritech FRU format type */
 	struct atk_fru   AtkFru;	/* Alacritech FRU information */
 	unsigned char	OemFruFormat;	/* optional OEM FRU format type */
-	union oemfru_t    OemFru;         /* optional OEM FRU information */
+	union oemfru    OemFru;         /* optional OEM FRU information */
 	unsigned char	Pad[4];	/* Pad to 128 bytes - includes 2 cksum bytes
 				 *(if OEM FRU info exists) and two unusable
 				 * bytes at the end */
@@ -809,7 +809,7 @@ struct oslic_eeprom {
 	unsigned char	FruFormat;	/* 35 Alacritech FRU format type */
 	struct atk_fru	AtkFru;	/* Alacritech FRU information */
 	unsigned char	OemFruFormat;	/* optional OEM FRU format type */
-	union oemfru_t    OemFru;         /* optional OEM FRU information */
+	union oemfru    OemFru;         /* optional OEM FRU information */
 	unsigned char	Pad[4];	/* Pad to 128 bytes - includes 2 checksum bytes
 				 * (if OEM FRU info exists) and two unusable
 				 * bytes at the end
drivers/staging/slicoss/slicoss.c +15 -15
index f242477..c129e83 100644
@@ -1015,7 +1015,7 @@ static int slic_xmit_start(struct sk_buff *skb, struct net_device *dev)
 
 #ifdef DEBUG_DUMP
 	if (adapter->kill_card) {
-		p_slic_host64_cmd_t ihcmd;
+		struct slic_host64_cmd ihcmd;
 
 		ihcmd = &hcmd->cmd64;
 
@@ -2455,7 +2455,7 @@ static int slic_card_init(struct sliccard *card, struct adapter *adapter)
 	unsigned char fruformat;
 	unsigned char oemfruformat;
 	struct atk_fru *patkfru;
-	union oemfru_t *poemfru;
+	union oemfru *poemfru;
 
 	DBG_MSG
 	    ("slicoss: %s ENTER card[%p] adapter[%p] card->state[%x] \
@@ -2692,7 +2692,7 @@ static int slic_card_init(struct sliccard *card, struct adapter *adapter)
 	 *  Allocate COMMAND BUFFER
 	 */
 	if (!card->cmdbuffer) {
-		card->cmdbuffer = kmalloc(sizeof(dump_cmd_t), GFP_ATOMIC);
+		card->cmdbuffer = kmalloc(sizeof(struct dump_cmd), GFP_ATOMIC);
 
 		ASSERT(card->cmdbuffer);
 		if (card->cmdbuffer == NULL)
@@ -2702,7 +2702,7 @@ static int slic_card_init(struct sliccard *card, struct adapter *adapter)
 	 *  Smear the shared memory structure and then obtain
 	 *  the PHYSICAL address of this structure
 	 */
-	memset(card->cmdbuffer, 0, sizeof(dump_cmd_t));
+	memset(card->cmdbuffer, 0, sizeof(struct dump_cmd));
 	card->cmdbuffer_phys = virt_to_bus(card->cmdbuffer);
 	card->cmdbuffer_physh = SLIC_GET_ADDR_HIGH(card->cmdbuffer_phys);
 	card->cmdbuffer_physl = SLIC_GET_ADDR_LOW(card->cmdbuffer_phys);
@@ -4417,7 +4417,7 @@ static int slic_debug_card_show(struct seq_file *seq, void *v)
 #ifdef MOOKTODO
 	int i;
 	struct sliccard *card = seq->private;
-	pslic_config_t config = &card->config;
+	struct slic_config *config = &card->config;
 	unsigned char *fru = (unsigned char *)(&card->config.atk_fru);
 	unsigned char *oemfru = (unsigned char *)(&card->config.OemFru);
 #endif
@@ -5311,7 +5311,7 @@ static u32 slic_dump_card(struct sliccard *card, bool resume)
 	u32 queue;
 	u32 len, offset;
 	u32 sram_size, dram_size, regs;
-	sliccore_hdr_t corehdr;
+	struct sliccore_hdr corehdr;
 	u32 file_offset;
 	char *namestr;
 	u32 i;
@@ -5344,7 +5344,7 @@ static u32 slic_dump_card(struct sliccard *card, bool resume)
 	}
 	corehdr.driver_version[i] = 0;
 
-	file_offset = sizeof(sliccore_hdr_t);
+	file_offset = sizeof(struct sliccore_hdr);
 
 	/*
 	 * Issue the following debug commands to the SLIC:
@@ -5651,10 +5651,10 @@ done:
 	 */
 	file_offset = 0;
 	DBG_MSG("[slicmon] Write CoreHeader len[%x] offset[%x]\n",
-		(uint) sizeof(sliccore_hdr_t), file_offset);
+		(uint) sizeof(struct sliccore_hdr), file_offset);
 
 	result =
-	    slic_dump_write(card, &corehdr, sizeof(sliccore_hdr_t),
+	    slic_dump_write(card, &corehdr, sizeof(struct sliccore_hdr),
 			    file_offset);
 	DBG_MSG("[slicmon] corehdr  xoff[%x] xsz[%x]\n"
 		"    roff[%x] rsz[%x] fileoff[%x] filesz[%x]\n"
@@ -5663,7 +5663,7 @@ done:
 		corehdr.XmtRegsize, corehdr.RcvRegOff, corehdr.RcvRegsize,
 		corehdr.FileRegOff, corehdr.FileRegsize, corehdr.SramOff,
 		corehdr.Sramsize, corehdr.DramOff, corehdr.Dramsize,
-		(uint) sizeof(sliccore_hdr_t));
+		(uint) sizeof(struct sliccore_hdr));
 	for (i = 0; i < max_queues; i++) {
 		DBG_MSG("[slicmon]  QUEUE 0x%x  offset[%x] size[%x]\n",
 			(uint) i, corehdr.queues[i].queueOff,
@@ -5706,7 +5706,7 @@ static u32 slic_dump_resume(struct sliccard *card, unsigned char proc)
 
 static u32 slic_dump_reg(struct sliccard *card, unsigned char proc)
 {
-	pdump_cmd_t dump = (pdump_cmd_t) card->cmdbuffer;
+	struct dump_cmd *dump = (struct dump_cmd *)card->cmdbuffer;
 
 	dump->cmd = COMMAND_BYTE(CMD_DUMP, 0, proc);
 	dump->desc = DESC_REG;
@@ -5723,7 +5723,7 @@ static u32 slic_dump_reg(struct sliccard *card, unsigned char proc)
 static u32 slic_dump_data(struct sliccard *card,
 		       u32 addr, ushort count, unsigned char desc)
 {
-	pdump_cmd_t dump = (pdump_cmd_t) card->cmdbuffer;
+	struct dump_cmd *dump = (struct dump_cmd *)card->cmdbuffer;
 
 	dump->cmd = COMMAND_BYTE(CMD_DUMP, 0, PROC_RECEIVE);
 	dump->desc = desc;
@@ -5740,7 +5740,7 @@ static u32 slic_dump_data(struct sliccard *card,
 static u32 slic_dump_queue(struct sliccard *card,
 			u32 addr, u32 buf_physh, u32 queue)
 {
-	pdump_cmd_t dump = (pdump_cmd_t) card->cmdbuffer;
+	struct dump_cmd *dump = (struct dump_cmd *)card->cmdbuffer;
 
 	dump->cmd = COMMAND_BYTE(CMD_DUMP, 0, PROC_RECEIVE);
 	dump->desc = DESC_QUEUE;
@@ -5756,7 +5756,7 @@ static u32 slic_dump_queue(struct sliccard *card,
 static u32 slic_dump_load_queue(struct sliccard *card, u32 data,
 				u32 queue)
 {
-	pdump_cmd_t load = (pdump_cmd_t) card->cmdbuffer;
+	struct dump_cmd *load = (struct dump_cmd *) card->cmdbuffer;
 
 	load->cmd = COMMAND_BYTE(CMD_LOAD, 0, PROC_RECEIVE);
 	load->desc = DESC_QUEUE;
@@ -5771,7 +5771,7 @@ static u32 slic_dump_load_queue(struct sliccard *card, u32 data,
 static u32 slic_dump_cam(struct sliccard *card,
 		      u32 addr, u32 count, unsigned char desc)
 {
-	pdump_cmd_t dump = (pdump_cmd_t) card->cmdbuffer;
+	struct dump_cmd *dump = (struct dump_cmd *)card->cmdbuffer;
 
 	dump->cmd = COMMAND_BYTE(CMD_CAM_OPS, 0, PROC_NONE);
 	dump->desc = desc;
Signature · 1 line
1.6.0.2
author
#25 lore raw

PATCH 22/23 Staging: SLICOSS: Call pci_release_regions at driver exit

In reply to Greg KH

From: Lior Dotan <[email protected]>

slic_entry_probe() calls pci_request_regions() but there's no matching pci_release_regions() at driver's exit or if slic_entry_probe() fails.

---
 drivers/staging/slicoss/slicoss.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
drivers/staging/slicoss/slicoss.c +2 -0
index c129e83..b61ac4b 100644
@@ -520,6 +520,7 @@ err_out_free_mmio_region:
 	release_mem_region(mmio_start, mmio_len);
 
 err_out_exit_slic_probe:
+	pci_release_regions(pcidev);
 	DBG_ERROR("%s EXIT jiffies[%lx] cpu %d\n", __func__, jiffies,
 		  smp_processor_id());
 
@@ -649,6 +650,7 @@ static void __devexit slic_entry_remove(struct pci_dev *pcidev)
 	}
 	DBG_MSG("slicoss: %s deallocate device\n", __func__);
 	kfree(dev);
+	pci_release_regions(pcidev);
 	DBG_MSG("slicoss: %s EXIT\n", __func__);
 }
 
Signature · 1 line
1.6.0.2
author
#26 lore raw

PATCH 23/23 Staging: Lindent sxg.c

In reply to Greg KH

From: J.R. Mauro <[email protected]>

Lindent drivers/staging/sxg/sxg.c

Signed-off by: J.R. Mauro <[email protected]>

---
 drivers/staging/sxg/sxg.c |  146 +++++++++++++++++++++++++--------------------
 1 files changed, 81 insertions(+), 65 deletions(-)
drivers/staging/sxg/sxg.c +81 -65
index 0117d51..6ccbee8 100644
@@ -80,9 +80,15 @@
 #include "sxgphycode.h"
 #include "saharadbgdownload.h"
 
-static int sxg_allocate_buffer_memory(p_adapter_t adapter, u32 Size, SXG_BUFFER_TYPE BufferType);
-static void sxg_allocate_rcvblock_complete(p_adapter_t adapter, void * RcvBlock, dma_addr_t PhysicalAddress, u32 Length);
-static void sxg_allocate_sgl_buffer_complete(p_adapter_t adapter, PSXG_SCATTER_GATHER SxgSgl, dma_addr_t PhysicalAddress, u32 Length);
+static int sxg_allocate_buffer_memory(p_adapter_t adapter, u32 Size,
+				      SXG_BUFFER_TYPE BufferType);
+static void sxg_allocate_rcvblock_complete(p_adapter_t adapter, void *RcvBlock,
+					   dma_addr_t PhysicalAddress,
+					   u32 Length);
+static void sxg_allocate_sgl_buffer_complete(p_adapter_t adapter,
+					     PSXG_SCATTER_GATHER SxgSgl,
+					     dma_addr_t PhysicalAddress,
+					     u32 Length);
 
 static void sxg_mcast_init_crc32(void);
 
@@ -100,13 +106,13 @@ static void sxg_complete_slow_send(p_adapter_t adapter);
 static struct sk_buff *sxg_slow_receive(p_adapter_t adapter, PSXG_EVENT Event);
 static void sxg_process_rcv_error(p_adapter_t adapter, u32 ErrorStatus);
 static bool sxg_mac_filter(p_adapter_t adapter,
-		       p_ether_header EtherHdr, ushort length);
+			   p_ether_header EtherHdr, ushort length);
 
 #if SLIC_GET_STATS_ENABLED
 static struct net_device_stats *sxg_get_stats(p_net_device dev);
 #endif
 
-static int sxg_mac_set_address(p_net_device dev, void * ptr);
+static int sxg_mac_set_address(p_net_device dev, void *ptr);
 
 static void sxg_adapter_set_hwaddr(p_adapter_t adapter);
 
@@ -115,20 +121,19 @@ static void sxg_mcast_set_mask(p_adapter_t adapter);
 
 static int sxg_initialize_adapter(p_adapter_t adapter);
 static void sxg_stock_rcv_buffers(p_adapter_t adapter);
-static void sxg_complete_descriptor_blocks(p_adapter_t adapter, unsigned char Index);
+static void sxg_complete_descriptor_blocks(p_adapter_t adapter,
+					   unsigned char Index);
 static int sxg_initialize_link(p_adapter_t adapter);
 static int sxg_phy_init(p_adapter_t adapter);
 static void sxg_link_event(p_adapter_t adapter);
 static SXG_LINK_STATE sxg_get_link_state(p_adapter_t adapter);
 static void sxg_link_state(p_adapter_t adapter, SXG_LINK_STATE LinkState);
 static int sxg_write_mdio_reg(p_adapter_t adapter,
-		       u32 DevAddr, u32 RegAddr, u32 Value);
+			      u32 DevAddr, u32 RegAddr, u32 Value);
 static int sxg_read_mdio_reg(p_adapter_t adapter,
-		      u32 DevAddr, u32 RegAddr, u32 * pValue);
+			     u32 DevAddr, u32 RegAddr, u32 *pValue);
 static void sxg_mcast_set_list(p_net_device dev);
 
-
-
 #define XXXTODO 0
 
 static unsigned int sxg_first_init = 1;
@@ -164,6 +169,7 @@ static struct pci_device_id sxg_pci_tbl[] __devinitdata = {
 	{PCI_DEVICE(SXG_VENDOR_ID, SXG_DEVICE_ID)},
 	{0,}
 };
+
 MODULE_DEVICE_TABLE(pci, sxg_pci_tbl);
 
 /***********************************************************************
@@ -242,7 +248,7 @@ static bool sxg_download_microcode(p_adapter_t adapter, SXG_UCODE_SEL UcodeSel)
 	PSXG_HW_REGS HwRegs = adapter->HwRegs;
 	u32 Section;
 	u32 ThisSectionSize;
-	u32 * Instruction = NULL;
+	u32 *Instruction = NULL;
 	u32 BaseAddress, AddressOffset, Address;
 //      u32                         Failure;
 	u32 ValueRead;
@@ -606,7 +612,7 @@ static void sxg_config_pci(struct pci_dev *pcidev)
 				     PCI_COMMAND_MASTER |	// Bus master enable
 				     PCI_COMMAND_INVALIDATE |	// Memory write and invalidate
 				     PCI_COMMAND_PARITY |	// Parity error response
-				     PCI_COMMAND_SERR |		// System ERR
+				     PCI_COMMAND_SERR |	// System ERR
 				     PCI_COMMAND_FAST_BACK);	// Fast back-to-back
 	if (pci_command != new_command) {
 		DBG_ERROR("%s -- Updating PCI COMMAND register %4.4x->%4.4x.\n",
@@ -695,17 +701,19 @@ static int sxg_entry_probe(struct pci_dev *pcidev,
 		  mmio_start, mmio_len);
 
 	memmapped_ioaddr = ioremap(mmio_start, mmio_len);
-	DBG_ERROR("sxg: %s MEMMAPPED_IOADDR [%p]\n", __FUNCTION__, memmapped_ioaddr);
+	DBG_ERROR("sxg: %s MEMMAPPED_IOADDR [%p]\n", __FUNCTION__,
+		  memmapped_ioaddr);
 	if (!memmapped_ioaddr) {
 		DBG_ERROR("%s cannot remap MMIO region %lx @ %lx\n",
 			  __FUNCTION__, mmio_len, mmio_start);
 		goto err_out_free_mmio_region;
 	}
 
-	DBG_ERROR("sxg: %s found Alacritech SXG PCI, MMIO at %p, start[%lx] len[%lx], IRQ %d.\n",
+	DBG_ERROR
+	    ("sxg: %s found Alacritech SXG PCI, MMIO at %p, start[%lx] len[%lx], IRQ %d.\n",
 	     __func__, memmapped_ioaddr, mmio_start, mmio_len, pcidev->irq);
 
-	adapter->HwRegs = (void *) memmapped_ioaddr;
+	adapter->HwRegs = (void *)memmapped_ioaddr;
 	adapter->base_addr = memmapped_ioaddr;
 
 	mmio_start = pci_resource_start(pcidev, 2);
@@ -715,7 +723,8 @@ static int sxg_entry_probe(struct pci_dev *pcidev,
 		  mmio_start, mmio_len);
 
 	memmapped_ioaddr = ioremap(mmio_start, mmio_len);
-	DBG_ERROR("sxg: %s MEMMAPPED_IOADDR [%p]\n", __func__, memmapped_ioaddr);
+	DBG_ERROR("sxg: %s MEMMAPPED_IOADDR [%p]\n", __func__,
+		  memmapped_ioaddr);
 	if (!memmapped_ioaddr) {
 		DBG_ERROR("%s cannot remap MMIO region %lx @ %lx\n",
 			  __FUNCTION__, mmio_len, mmio_start);
@@ -845,7 +854,6 @@ static int sxg_entry_probe(struct pci_dev *pcidev,
 	return -ENODEV;
 }
 
-
 /***********************************************************************
  * LINE BASE Interrupt routines..
  ***********************************************************************/
@@ -957,7 +965,8 @@ static irqreturn_t sxg_isr(int irq, void *dev_id)
 			PSXG_EVENT_RING EventRing = &adapter->EventRings[i];
 			PSXG_EVENT Event =
 			    &EventRing->Ring[adapter->NextEvent[i]];
-			unsigned char Cpu = adapter->RssSystemInfo->RssIdToCpu[i];
+			unsigned char Cpu =
+			    adapter->RssSystemInfo->RssIdToCpu[i];
 			if (Event->Status & EVENT_STATUS_VALID) {
 				adapter->IsrDpcsPending++;
 				CpuMask |= (1 << Cpu);
@@ -1078,7 +1087,8 @@ static int sxg_process_isr(p_adapter_t adapter, u32 MessageId)
 		if (Isr & SXG_ISR_DEAD) {
 			// Set aside the crash info and set the adapter state to RESET
 			adapter->CrashCpu =
-			    (unsigned char) ((Isr & SXG_ISR_CPU) >> SXG_ISR_CPU_SHIFT);
+			    (unsigned char)((Isr & SXG_ISR_CPU) >>
+					    SXG_ISR_CPU_SHIFT);
 			adapter->CrashLocation = (ushort) (Isr & SXG_ISR_CRASH);
 			adapter->Dead = TRUE;
 			DBG_ERROR("%s: ISR_DEAD %x, CPU: %d\n", __FUNCTION__,
@@ -1286,7 +1296,7 @@ static void sxg_complete_slow_send(p_adapter_t adapter)
 {
 	PSXG_XMT_RING XmtRing = &adapter->XmtRings[0];
 	PSXG_RING_INFO XmtRingInfo = &adapter->XmtRingZeroInfo;
-	u32 * ContextType;
+	u32 *ContextType;
 	PSXG_CMD XmtCmd;
 
 	// NOTE - This lock is dropped and regrabbed in this loop.
@@ -1380,11 +1390,9 @@ static struct sk_buff *sxg_slow_receive(p_adapter_t adapter, PSXG_EVENT Event)
 		SXG_TRACE(TRACE_SXG, SxgTraceBuffer, TRACE_NOISY, "RcvError",
 			  Event, Event->Status, Event->HostHandle, 0);
 		// XXXTODO - Remove this print later
-		DBG_ERROR("SXG: Receive error %x\n",
-			  *(u32 *)
+		DBG_ERROR("SXG: Receive error %x\n", *(u32 *)
 			  SXG_RECEIVE_DATA_LOCATION(RcvDataBufferHdr));
-		sxg_process_rcv_error(adapter,
-				      *(u32 *)
+		sxg_process_rcv_error(adapter, *(u32 *)
 				      SXG_RECEIVE_DATA_LOCATION
 				      (RcvDataBufferHdr));
 		goto drop;
@@ -1406,8 +1414,7 @@ static struct sk_buff *sxg_slow_receive(p_adapter_t adapter, PSXG_EVENT Event)
 	//
 	// Dumb-nic frame.  See if it passes our mac filter and update stats
 	//
-	if (!sxg_mac_filter(adapter,
-			    (p_ether_header)
+	if (!sxg_mac_filter(adapter, (p_ether_header)
 			    SXG_RECEIVE_DATA_LOCATION(RcvDataBufferHdr),
 			    Event->Length)) {
 		SXG_TRACE(TRACE_SXG, SxgTraceBuffer, TRACE_NOISY, "RcvFiltr",
@@ -1527,7 +1534,8 @@ static void sxg_process_rcv_error(p_adapter_t adapter, u32 ErrorStatus)
  * Return Value:
  * 	TRUE if the frame is to be allowed
  */
-static bool sxg_mac_filter(p_adapter_t adapter, p_ether_header EtherHdr, ushort length)
+static bool sxg_mac_filter(p_adapter_t adapter, p_ether_header EtherHdr,
+			   ushort length)
 {
 	bool EqualAddr;
 
@@ -1600,7 +1608,8 @@ static int sxg_register_interrupt(p_adapter_t adapter)
 		    ("sxg: %s AllocAdaptRsrcs adapter[%p] dev->irq[%x] %x\n",
 		     __FUNCTION__, adapter, adapter->netdev->irq, NR_IRQS);
 
-		spin_unlock_irqrestore(&sxg_global.driver_lock, sxg_global.flags);
+		spin_unlock_irqrestore(&sxg_global.driver_lock,
+				       sxg_global.flags);
 
 		retval = request_irq(adapter->netdev->irq,
 				     &sxg_isr,
@@ -1729,7 +1738,6 @@ static int sxg_entry_open(p_net_device dev)
 		sxg_global.num_sxg_ports_active++;
 		adapter->activated = 1;
 	}
-
 	// Initialize the adapter
 	DBG_ERROR("sxg: %s ENTER sxg_initialize_adapter\n", __FUNCTION__);
 	status = sxg_initialize_adapter(adapter);
@@ -1786,7 +1794,7 @@ static void __devexit sxg_entry_remove(struct pci_dev *pcidev)
 	release_mem_region(mmio_start, mmio_len);
 
 	DBG_ERROR("sxg: %s iounmap dev->base_addr[%x]\n", __FUNCTION__,
-		  (unsigned int) dev->base_addr);
+		  (unsigned int)dev->base_addr);
 	iounmap((char *)dev->base_addr);
 
 	DBG_ERROR("sxg: %s deallocate device\n", __FUNCTION__);
@@ -1929,7 +1937,7 @@ static int sxg_transmit_packet(p_adapter_t adapter, struct sk_buff *skb)
 {
 	PSCATTER_GATHER_LIST pSgl;
 	PSXG_SCATTER_GATHER SxgSgl;
-	void * SglBuffer;
+	void *SglBuffer;
 	u32 SglBufferLength;
 
 	// The vast majority of work is done in the shared
@@ -2038,7 +2046,9 @@ static void sxg_dumb_sgl(PSCATTER_GATHER_LIST pSgl, PSXG_SCATTER_GATHER SxgSgl)
 #endif
 	// Fill in the command
 	// Copy out the first SGE to the command and adjust for offset
-	phys_addr = pci_map_single(adapter->pcidev, skb->data, skb->len, PCI_DMA_TODEVICE);
+	phys_addr =
+	    pci_map_single(adapter->pcidev, skb->data, skb->len,
+			   PCI_DMA_TODEVICE);
 	XmtCmd->Buffer.FirstSgeAddress = SXG_GET_ADDR_HIGH(phys_addr);
 	XmtCmd->Buffer.FirstSgeAddress = XmtCmd->Buffer.FirstSgeAddress << 32;
 	XmtCmd->Buffer.FirstSgeAddress =
@@ -2422,7 +2432,8 @@ static SXG_LINK_STATE sxg_get_link_state(p_adapter_t adapter)
 	return (SXG_LINK_DOWN);
 }
 
-static void sxg_indicate_link_state(p_adapter_t adapter, SXG_LINK_STATE LinkState)
+static void sxg_indicate_link_state(p_adapter_t adapter,
+				    SXG_LINK_STATE LinkState)
 {
 	if (adapter->LinkState == SXG_LINK_UP) {
 		DBG_ERROR("%s: LINK now UP, call netif_start_queue\n",
@@ -2487,11 +2498,11 @@ static void sxg_link_state(p_adapter_t adapter, SXG_LINK_STATE LinkState)
  *	status
  */
 static int sxg_write_mdio_reg(p_adapter_t adapter,
-		   u32 DevAddr, u32 RegAddr, u32 Value)
+			      u32 DevAddr, u32 RegAddr, u32 Value)
 {
 	PSXG_HW_REGS HwRegs = adapter->HwRegs;
 	u32 AddrOp;		// Address operation (written to MIIM field reg)
-	u32 WriteOp;	// Write operation (written to MIIM field reg)
+	u32 WriteOp;		// Write operation (written to MIIM field reg)
 	u32 Cmd;		// Command (written to MIIM command reg)
 	u32 ValueRead;
 	u32 Timeout;
@@ -2577,7 +2588,7 @@ static int sxg_write_mdio_reg(p_adapter_t adapter,
  *	status
  */
 static int sxg_read_mdio_reg(p_adapter_t adapter,
-		  u32 DevAddr, u32 RegAddr, u32 * pValue)
+			     u32 DevAddr, u32 RegAddr, u32 *pValue)
 {
 	PSXG_HW_REGS HwRegs = adapter->HwRegs;
 	u32 AddrOp;		// Address operation (written to MIIM field reg)
@@ -2698,7 +2709,7 @@ static int sxg_mcast_add_list(p_adapter_t adapter, char *address)
  * we must then transpose the value and return bits 30-23.
  *
  */
-static u32 sxg_crc_table[256]; /* Table of CRC's for all possible byte values */
+static u32 sxg_crc_table[256];	/* Table of CRC's for all possible byte values */
 static u32 sxg_crc_init;	/* Is table initialized                        */
 
 /*
@@ -2706,7 +2717,7 @@ static u32 sxg_crc_init;	/* Is table initialized                        */
  */
 static void sxg_mcast_init_crc32(void)
 {
-	u32 c;		/*  CRC shit reg                 */
+	u32 c;			/*  CRC shit reg                 */
 	u32 e = 0;		/*  Poly X-or pattern            */
 	int i;			/*  counter                      */
 	int k;			/*  byte being shifted into crc  */
@@ -2783,7 +2794,7 @@ static void sxg_mcast_set_list(p_net_device dev)
 	ASSERT(adapter);
 
 	for (i = 1; i <= mc_count; i++) {
-		addresses = (char *) & mc_list->dmi_addr;
+		addresses = (char *)&mc_list->dmi_addr;
 		if (mc_list->dmi_addrlen == 6) {
 			status = sxg_mcast_add_list(adapter, addresses);
 			if (status != STATUS_SUCCESS) {
@@ -2833,7 +2844,7 @@ static void sxg_mcast_set_mask(p_adapter_t adapter)
 	PSXG_UCODE_REGS sxg_regs = adapter->UcodeRegs;
 
 	DBG_ERROR("%s ENTER (%s) macopts[%x] mask[%llx]\n", __FUNCTION__,
-		  adapter->netdev->name, (unsigned int) adapter->MacFilter,
+		  adapter->netdev->name, (unsigned int)adapter->MacFilter,
 		  adapter->MulticastMask);
 
 	if (adapter->MacFilter & (MAC_ALLMCAST | MAC_PROMISC)) {
@@ -2857,12 +2868,10 @@ static void sxg_mcast_set_mask(p_adapter_t adapter)
 			   ((adapter->MulticastMask >> 32) & 0xFFFFFFFF)));
 
 		WRITE_REG(sxg_regs->McastLow,
-			  (u32) (adapter->MulticastMask & 0xFFFFFFFF),
-			  FLUSH);
+			  (u32) (adapter->MulticastMask & 0xFFFFFFFF), FLUSH);
 		WRITE_REG(sxg_regs->McastHigh,
 			  (u32) ((adapter->
-				      MulticastMask >> 32) & 0xFFFFFFFF),
-			  FLUSH);
+				  MulticastMask >> 32) & 0xFFFFFFFF), FLUSH);
 	}
 }
 
@@ -2991,9 +3000,9 @@ void SxgFreeResources(p_adapter_t adapter)
  *	None.
  */
 static void sxg_allocate_complete(p_adapter_t adapter,
-		      void *VirtualAddress,
-		      dma_addr_t PhysicalAddress,
-		      u32 Length, SXG_BUFFER_TYPE Context)
+				  void *VirtualAddress,
+				  dma_addr_t PhysicalAddress,
+				  u32 Length, SXG_BUFFER_TYPE Context)
 {
 	SXG_TRACE(TRACE_SXG, SxgTraceBuffer, TRACE_NOISY, "AllocCmp",
 		  adapter, VirtualAddress, Length, Context);
@@ -3008,8 +3017,7 @@ static void sxg_allocate_complete(p_adapter_t adapter,
 					       PhysicalAddress, Length);
 		break;
 	case SXG_BUFFER_TYPE_SGL:
-		sxg_allocate_sgl_buffer_complete(adapter,
-						 (PSXG_SCATTER_GATHER)
+		sxg_allocate_sgl_buffer_complete(adapter, (PSXG_SCATTER_GATHER)
 						 VirtualAddress,
 						 PhysicalAddress, Length);
 		break;
@@ -3031,10 +3039,10 @@ static void sxg_allocate_complete(p_adapter_t adapter,
  *	int
  */
 static int sxg_allocate_buffer_memory(p_adapter_t adapter,
-			   u32 Size, SXG_BUFFER_TYPE BufferType)
+				      u32 Size, SXG_BUFFER_TYPE BufferType)
 {
 	int status;
-	void * Buffer;
+	void *Buffer;
 	dma_addr_t pBuffer;
 
 	SXG_TRACE(TRACE_SXG, SxgTraceBuffer, TRACE_NOISY, "AllocMem",
@@ -3083,8 +3091,9 @@ static int sxg_allocate_buffer_memory(p_adapter_t adapter,
  *
  */
 static void sxg_allocate_rcvblock_complete(p_adapter_t adapter,
-			       void * RcvBlock,
-			       dma_addr_t PhysicalAddress, u32 Length)
+					   void *RcvBlock,
+					   dma_addr_t PhysicalAddress,
+					   u32 Length)
 {
 	u32 i;
 	u32 BufferSize = adapter->ReceiveBufferSize;
@@ -3160,9 +3169,10 @@ static void sxg_allocate_rcvblock_complete(p_adapter_t adapter,
 	}
 
 	// Locate the descriptor block and put it on a separate free queue
-	RcvDescriptorBlock = (PSXG_RCV_DESCRIPTOR_BLOCK) ((unsigned char *)RcvBlock +
-							  SXG_RCV_DESCRIPTOR_BLOCK_OFFSET
-							  (BufferSize));
+	RcvDescriptorBlock =
+	    (PSXG_RCV_DESCRIPTOR_BLOCK) ((unsigned char *)RcvBlock +
+					 SXG_RCV_DESCRIPTOR_BLOCK_OFFSET
+					 (BufferSize));
 	RcvDescriptorBlockHdr =
 	    (PSXG_RCV_DESCRIPTOR_BLOCK_HDR) ((unsigned char *)RcvBlock +
 					     SXG_RCV_DESCRIPTOR_BLOCK_HDR_OFFSET
@@ -3210,8 +3220,9 @@ static void sxg_allocate_rcvblock_complete(p_adapter_t adapter,
  *
  */
 static void sxg_allocate_sgl_buffer_complete(p_adapter_t adapter,
-				 PSXG_SCATTER_GATHER SxgSgl,
-				 dma_addr_t PhysicalAddress, u32 Length)
+					     PSXG_SCATTER_GATHER SxgSgl,
+					     dma_addr_t PhysicalAddress,
+					     u32 Length)
 {
 	SXG_TRACE(TRACE_SXG, SxgTraceBuffer, TRACE_NOISY, "AlSglCmp",
 		  adapter, SxgSgl, Length, 0);
@@ -3228,7 +3239,8 @@ static void sxg_allocate_sgl_buffer_complete(p_adapter_t adapter,
 		  adapter, SxgSgl, Length, 0);
 }
 
-static unsigned char temp_mac_address[6] = { 0x00, 0xab, 0xcd, 0xef, 0x12, 0x69 };
+static unsigned char temp_mac_address[6] =
+    { 0x00, 0xab, 0xcd, 0xef, 0x12, 0x69 };
 
 static void sxg_adapter_set_hwaddr(p_adapter_t adapter)
 {
@@ -3255,7 +3267,7 @@ static void sxg_adapter_set_hwaddr(p_adapter_t adapter)
 
 }
 
-static int sxg_mac_set_address(p_net_device dev, void * ptr)
+static int sxg_mac_set_address(p_net_device dev, void *ptr)
 {
 #if XXXTODO
 	p_adapter_t adapter = (p_adapter_t) netdev_priv(dev);
@@ -3400,7 +3412,8 @@ static int sxg_initialize_adapter(p_adapter_t adapter)
  *	status
  */
 static int sxg_fill_descriptor_block(p_adapter_t adapter,
-			  PSXG_RCV_DESCRIPTOR_BLOCK_HDR RcvDescriptorBlockHdr)
+				     PSXG_RCV_DESCRIPTOR_BLOCK_HDR
+				     RcvDescriptorBlockHdr)
 {
 	u32 i;
 	PSXG_RING_INFO RcvRingInfo = &adapter->RcvRingZeroInfo;
@@ -3436,7 +3449,8 @@ static int sxg_fill_descriptor_block(p_adapter_t adapter,
 		ASSERT(RcvDataBufferHdr);
 		SXG_REINIATIALIZE_PACKET(RcvDataBufferHdr->SxgDumbRcvPacket);
 		RcvDataBufferHdr->State = SXG_BUFFER_ONCARD;
-		RcvDescriptorBlock->Descriptors[i].VirtualAddress = (void *)RcvDataBufferHdr;
+		RcvDescriptorBlock->Descriptors[i].VirtualAddress =
+		    (void *)RcvDataBufferHdr;
 		RcvDescriptorBlock->Descriptors[i].PhysicalAddress =
 		    RcvDataBufferHdr->PhysicalAddress;
 	}
@@ -3497,7 +3511,9 @@ static void sxg_stock_rcv_buffers(p_adapter_t adapter)
 		RcvDescriptorBlockHdr = NULL;
 		if (adapter->FreeRcvBlockCount) {
 			_ple = RemoveHeadList(&adapter->FreeRcvBlocks);
-			RcvDescriptorBlockHdr = container_of(_ple, SXG_RCV_DESCRIPTOR_BLOCK_HDR, FreeList);
+			RcvDescriptorBlockHdr =
+			    container_of(_ple, SXG_RCV_DESCRIPTOR_BLOCK_HDR,
+					 FreeList);
 			adapter->FreeRcvBlockCount--;
 			RcvDescriptorBlockHdr->State = SXG_BUFFER_BUSY;
 		}
@@ -3533,7 +3549,8 @@ static void sxg_stock_rcv_buffers(p_adapter_t adapter)
  * Return
  *	None
  */
-static void sxg_complete_descriptor_blocks(p_adapter_t adapter, unsigned char Index)
+static void sxg_complete_descriptor_blocks(p_adapter_t adapter,
+					   unsigned char Index)
 {
 	PSXG_RCV_RING RingZero = &adapter->RcvRings[0];
 	PSXG_RING_INFO RcvRingInfo = &adapter->RcvRingZeroInfo;
@@ -3576,7 +3593,6 @@ static void sxg_complete_descriptor_blocks(p_adapter_t adapter, unsigned char In
 		  adapter, Index, RcvRingInfo->Head, RcvRingInfo->Tail);
 }
 
-
 static struct pci_driver sxg_driver = {
 	.name = DRV_NAME,
 	.id_table = sxg_pci_tbl,
Signature · 1 line
1.6.0.2
author
#27 lore raw
In reply to Greg KH
Quoted 2 lines · Greg KH

Here is a tree of patches against your 2.6 git tree that adds the drivers/staging/ directory and related infrastructure.

I've now added 2 more patches to this tree, fixing a build error if you did not build any staging drivers into your tree (the normal mode of building), and added an additional wireless driver that came from the Fedora kernel trees.

The updated diffstat and shortlog are below.

Please pull from:
master.kernel.org:/pub/scm/linux/kernel/git/gregkh/staging-2.6.git/

I'll post the 2 additional patches to linux-kernel for those who wish to see them.

thanks,

greg k-h

 Documentation/sysctl/kernel.txt             |    1 +
 MAINTAINERS                                 |    7 +
 drivers/Kconfig                             |    2 +
 drivers/Makefile                            |    1 +
 drivers/staging/Kconfig                     |   46 +
 drivers/staging/Makefile                    |   15 +
 drivers/staging/at76_usb/Kconfig            |    8 +
 drivers/staging/at76_usb/Makefile           |    1 +
 drivers/staging/at76_usb/TODO               |    2 +
 drivers/staging/at76_usb/at76_usb.c         | 5559 +++++++++++++++
 drivers/staging/at76_usb/at76_usb.h         |  619 ++
 drivers/staging/echo/Kconfig                |    9 +
 drivers/staging/echo/Makefile               |    1 +
 drivers/staging/echo/TODO                   |   10 +
 drivers/staging/echo/bit_operations.h       |  253 +
 drivers/staging/echo/echo.c                 |  632 ++
 drivers/staging/echo/echo.h                 |  220 +
 drivers/staging/echo/fir.h                  |  369 +
 drivers/staging/echo/mmx.h                  |  288 +
 drivers/staging/et131x/Kconfig              |   18 +
 drivers/staging/et131x/Makefile             |   18 +
 drivers/staging/et131x/README               |   25 +
 drivers/staging/et131x/et1310_address_map.h | 2399 +++++++
 drivers/staging/et131x/et1310_eeprom.c      |  480 ++
 drivers/staging/et131x/et1310_eeprom.h      |   89 +
 drivers/staging/et131x/et1310_jagcore.c     |  220 +
 drivers/staging/et131x/et1310_jagcore.h     |  112 +
 drivers/staging/et131x/et1310_mac.c         |  792 +++
 drivers/staging/et131x/et1310_mac.h         |   93 +
 drivers/staging/et131x/et1310_phy.c         | 1281 ++++
 drivers/staging/et131x/et1310_phy.h         |  910 +++
 drivers/staging/et131x/et1310_pm.c          |  207 +
 drivers/staging/et131x/et1310_pm.h          |  125 +
 drivers/staging/et131x/et1310_rx.c          | 1391 ++++
 drivers/staging/et131x/et1310_rx.h          |  373 +
 drivers/staging/et131x/et1310_tx.c          | 1525 ++++
 drivers/staging/et131x/et1310_tx.h          |  242 +
 drivers/staging/et131x/et131x_adapter.h     |  347 +
 drivers/staging/et131x/et131x_config.c      |  325 +
 drivers/staging/et131x/et131x_config.h      |   67 +
 drivers/staging/et131x/et131x_debug.c       |  218 +
 drivers/staging/et131x/et131x_debug.h       |  201 +
 drivers/staging/et131x/et131x_defs.h        |  128 +
 drivers/staging/et131x/et131x_initpci.c     | 1046 +++
 drivers/staging/et131x/et131x_initpci.h     |   73 +
 drivers/staging/et131x/et131x_isr.c         |  488 ++
 drivers/staging/et131x/et131x_isr.h         |   65 +
 drivers/staging/et131x/et131x_netdev.c      |  856 +++
 drivers/staging/et131x/et131x_netdev.h      |   64 +
 drivers/staging/et131x/et131x_version.h     |   81 +
 drivers/staging/go7007/Kconfig              |   25 +
 drivers/staging/go7007/Makefile             |   18 +
 drivers/staging/go7007/README               |   11 +
 drivers/staging/go7007/go7007-driver.c      |  688 ++
 drivers/staging/go7007/go7007-fw.c          | 1639 +++++
 drivers/staging/go7007/go7007-i2c.c         |  309 +
 drivers/staging/go7007/go7007-priv.h        |  279 +
 drivers/staging/go7007/go7007-usb.c         | 1229 ++++
 drivers/staging/go7007/go7007-v4l2.c        | 1499 ++++
 drivers/staging/go7007/go7007.h             |  114 +
 drivers/staging/go7007/saa7134-go7007.c     |  484 ++
 drivers/staging/go7007/snd-go7007.c         |  305 +
 drivers/staging/go7007/wis-i2c.h            |   55 +
 drivers/staging/go7007/wis-ov7640.c         |  130 +
 drivers/staging/go7007/wis-saa7113.c        |  358 +
 drivers/staging/go7007/wis-saa7115.c        |  491 ++
 drivers/staging/go7007/wis-sony-tuner.c     |  742 ++
 drivers/staging/go7007/wis-tw2804.c         |  380 +
 drivers/staging/go7007/wis-tw9903.c         |  362 +
 drivers/staging/go7007/wis-uda1342.c        |  136 +
 drivers/staging/me4000/Kconfig              |   10 +
 drivers/staging/me4000/Makefile             |    1 +
 drivers/staging/me4000/README               |   13 +
 drivers/staging/me4000/me4000.c             | 6133 ++++++++++++++++
 drivers/staging/me4000/me4000.h             |  954 +++
 drivers/staging/me4000/me4000_firmware.h    |10033 +++++++++++++++++++++++++++
 drivers/staging/me4000/me4610_firmware.h    | 5409 +++++++++++++++
 drivers/staging/slicoss/Kconfig             |   14 +
 drivers/staging/slicoss/Makefile            |    1 +
 drivers/staging/slicoss/README              |   19 +
 drivers/staging/slicoss/gbdownload.h        | 8215 ++++++++++++++++++++++
 drivers/staging/slicoss/gbrcvucode.h        |  238 +
 drivers/staging/slicoss/oasisdbgdownload.h  | 6850 ++++++++++++++++++
 drivers/staging/slicoss/oasisdownload.h     | 6848 ++++++++++++++++++
 drivers/staging/slicoss/oasisrcvucode.h     |  205 +
 drivers/staging/slicoss/slic.h              |  598 ++
 drivers/staging/slicoss/slic_os.h           |   84 +
 drivers/staging/slicoss/slicbuild.h         |   96 +
 drivers/staging/slicoss/slicdbg.h           |  100 +
 drivers/staging/slicoss/slicdump.h          |  278 +
 drivers/staging/slicoss/slichw.h            |  845 +++
 drivers/staging/slicoss/slicinc.h           |  185 +
 drivers/staging/slicoss/slicoss.c           | 5936 ++++++++++++++++
 drivers/staging/staging.c                   |   19 +
 drivers/staging/sxg/Kconfig                 |   10 +
 drivers/staging/sxg/Makefile                |    1 +
 drivers/staging/sxg/README                  |   13 +
 drivers/staging/sxg/saharadbgdownload.h     | 4854 +++++++++++++
 drivers/staging/sxg/sxg.c                   | 3624 ++++++++++
 drivers/staging/sxg/sxg.h                   |  773 +++
 drivers/staging/sxg/sxg_os.h                |  154 +
 drivers/staging/sxg/sxgdbg.h                |  190 +
 drivers/staging/sxg/sxghif.h                |  861 +++
 drivers/staging/sxg/sxghw.h                 |  734 ++
 drivers/staging/sxg/sxgphycode.h            |  349 +
 drivers/staging/usbip/Kconfig               |   36 +
 drivers/staging/usbip/Makefile              |   12 +
 drivers/staging/usbip/README                |    6 +
 drivers/staging/usbip/stub.h                |   95 +
 drivers/staging/usbip/stub_dev.c            |  483 ++
 drivers/staging/usbip/stub_main.c           |  300 +
 drivers/staging/usbip/stub_rx.c             |  615 ++
 drivers/staging/usbip/stub_tx.c             |  371 +
 drivers/staging/usbip/usbip_common.c        |  997 +++
 drivers/staging/usbip/usbip_common.h        |  406 ++
 drivers/staging/usbip/usbip_event.c         |  141 +
 drivers/staging/usbip/vhci.h                |  142 +
 drivers/staging/usbip/vhci_hcd.c            | 1275 ++++
 drivers/staging/usbip/vhci_rx.c             |  251 +
 drivers/staging/usbip/vhci_sysfs.c          |  250 +
 drivers/staging/usbip/vhci_tx.c             |  239 +
 drivers/staging/winbond/Kconfig             |    7 +
 drivers/staging/winbond/Makefile            |   18 +
 drivers/staging/winbond/README              |   10 +
 drivers/staging/winbond/adapter.h           |   23 +
 drivers/staging/winbond/bss_f.h             |   59 +
 drivers/staging/winbond/bssdscpt.h          |  156 +
 drivers/staging/winbond/ds_tkip.h           |   33 +
 drivers/staging/winbond/gl_80211.h          |  125 +
 drivers/staging/winbond/ioctls.h            |  678 ++
 drivers/staging/winbond/linux/common.h      |  143 +
 drivers/staging/winbond/linux/sysdef.h      |   73 +
 drivers/staging/winbond/linux/wb35reg.c     |  747 ++
 drivers/staging/winbond/linux/wb35reg_f.h   |   56 +
 drivers/staging/winbond/linux/wb35reg_s.h   |  170 +
 drivers/staging/winbond/linux/wb35rx.c      |  337 +
 drivers/staging/winbond/linux/wb35rx_f.h    |   17 +
 drivers/staging/winbond/linux/wb35rx_s.h    |   48 +
 drivers/staging/winbond/linux/wb35tx.c      |  313 +
 drivers/staging/winbond/linux/wb35tx_f.h    |   20 +
 drivers/staging/winbond/linux/wb35tx_s.h    |   47 +
 drivers/staging/winbond/linux/wbusb.c       |  404 ++
 drivers/staging/winbond/linux/wbusb_f.h     |   34 +
 drivers/staging/winbond/linux/wbusb_s.h     |   42 +
 drivers/staging/winbond/localpara.h         |  275 +
 drivers/staging/winbond/mac_structures.h    |  670 ++
 drivers/staging/winbond/mds.c               |  630 ++
 drivers/staging/winbond/mds_f.h             |   33 +
 drivers/staging/winbond/mds_s.h             |  183 +
 drivers/staging/winbond/mlme_mib.h          |   84 +
 drivers/staging/winbond/mlme_s.h            |  195 +
 drivers/staging/winbond/mlmetxrx.c          |  150 +
 drivers/staging/winbond/mlmetxrx_f.h        |   52 +
 drivers/staging/winbond/mto.c               | 1229 ++++
 drivers/staging/winbond/mto.h               |  265 +
 drivers/staging/winbond/mto_f.h             |    7 +
 drivers/staging/winbond/os_common.h         |    2 +
 drivers/staging/winbond/phy_calibration.c   | 1759 +++++
 drivers/staging/winbond/phy_calibration.h   |  101 +
 drivers/staging/winbond/reg.c               | 2683 +++++++
 drivers/staging/winbond/rxisr.c             |   30 +
 drivers/staging/winbond/scan_s.h            |  115 +
 drivers/staging/winbond/sme_api.c           |   13 +
 drivers/staging/winbond/sme_api.h           |  265 +
 drivers/staging/winbond/sme_s.h             |  228 +
 drivers/staging/winbond/wb35_ver.h          |   30 +
 drivers/staging/winbond/wbhal.c             |  878 +++
 drivers/staging/winbond/wbhal_f.h           |  122 +
 drivers/staging/winbond/wbhal_s.h           |  615 ++
 drivers/staging/winbond/wblinux.c           |  277 +
 drivers/staging/winbond/wblinux_f.h         |   23 +
 drivers/staging/winbond/wblinux_s.h         |   45 +
 drivers/staging/wlan-ng/Kconfig             |   10 +
 drivers/staging/wlan-ng/Makefile            |    9 +
 drivers/staging/wlan-ng/README              |    8 +
 drivers/staging/wlan-ng/hfa384x.c           | 4018 +++++++++++
 drivers/staging/wlan-ng/hfa384x.h           | 3067 ++++++++
 drivers/staging/wlan-ng/hfa384x_usb.c       | 5027 ++++++++++++++
 drivers/staging/wlan-ng/p80211conv.c        |  683 ++
 drivers/staging/wlan-ng/p80211conv.h        |  186 +
 drivers/staging/wlan-ng/p80211hdr.h         |  299 +
 drivers/staging/wlan-ng/p80211ioctl.h       |  123 +
 drivers/staging/wlan-ng/p80211meta.h        |  169 +
 drivers/staging/wlan-ng/p80211metadef.h     | 2524 +++++++
 drivers/staging/wlan-ng/p80211metamib.h     |  105 +
 drivers/staging/wlan-ng/p80211metamsg.h     |  105 +
 drivers/staging/wlan-ng/p80211metastruct.h  |  644 ++
 drivers/staging/wlan-ng/p80211mgmt.h        |  575 ++
 drivers/staging/wlan-ng/p80211mod.c         |  216 +
 drivers/staging/wlan-ng/p80211msg.h         |  102 +
 drivers/staging/wlan-ng/p80211netdev.c      | 1502 ++++
 drivers/staging/wlan-ng/p80211netdev.h      |  336 +
 drivers/staging/wlan-ng/p80211req.c         |  329 +
 drivers/staging/wlan-ng/p80211req.h         |   68 +
 drivers/staging/wlan-ng/p80211types.h       |  675 ++
 drivers/staging/wlan-ng/p80211wep.c         |  317 +
 drivers/staging/wlan-ng/p80211wext.c        | 2048 ++++++
 drivers/staging/wlan-ng/prism2_cs.c         | 1487 ++++
 drivers/staging/wlan-ng/prism2_pci.c        |  332 +
 drivers/staging/wlan-ng/prism2_plx.c        |  472 ++
 drivers/staging/wlan-ng/prism2_usb.c        |  361 +
 drivers/staging/wlan-ng/prism2mgmt.c        | 2956 ++++++++
 drivers/staging/wlan-ng/prism2mgmt.h        |  182 +
 drivers/staging/wlan-ng/prism2mib.c         | 3799 ++++++++++
 drivers/staging/wlan-ng/prism2sta.c         | 2502 +++++++
 drivers/staging/wlan-ng/version.h           |   64 +
 drivers/staging/wlan-ng/wlan_compat.h       |  757 ++
 include/linux/kernel.h                      |    1 +
 kernel/module.c                             |   11 +
 kernel/panic.c                              |    6 +-
 scripts/mod/modpost.c                       |    9 +
 211 files changed, 152423 insertions(+), 2 deletions(-)
 create mode 100644 drivers/staging/Kconfig
 create mode 100644 drivers/staging/Makefile
 create mode 100644 drivers/staging/at76_usb/Kconfig
 create mode 100644 drivers/staging/at76_usb/Makefile
 create mode 100644 drivers/staging/at76_usb/TODO
 create mode 100644 drivers/staging/at76_usb/at76_usb.c
 create mode 100644 drivers/staging/at76_usb/at76_usb.h
 create mode 100644 drivers/staging/echo/Kconfig
 create mode 100644 drivers/staging/echo/Makefile
 create mode 100644 drivers/staging/echo/TODO
 create mode 100644 drivers/staging/echo/bit_operations.h
 create mode 100644 drivers/staging/echo/echo.c
 create mode 100644 drivers/staging/echo/echo.h
 create mode 100644 drivers/staging/echo/fir.h
 create mode 100644 drivers/staging/echo/mmx.h
 create mode 100644 drivers/staging/et131x/Kconfig
 create mode 100644 drivers/staging/et131x/Makefile
 create mode 100644 drivers/staging/et131x/README
 create mode 100644 drivers/staging/et131x/et1310_address_map.h
 create mode 100644 drivers/staging/et131x/et1310_eeprom.c
 create mode 100644 drivers/staging/et131x/et1310_eeprom.h
 create mode 100644 drivers/staging/et131x/et1310_jagcore.c
 create mode 100644 drivers/staging/et131x/et1310_jagcore.h
 create mode 100644 drivers/staging/et131x/et1310_mac.c
 create mode 100644 drivers/staging/et131x/et1310_mac.h
 create mode 100644 drivers/staging/et131x/et1310_phy.c
 create mode 100644 drivers/staging/et131x/et1310_phy.h
 create mode 100644 drivers/staging/et131x/et1310_pm.c
 create mode 100644 drivers/staging/et131x/et1310_pm.h
 create mode 100644 drivers/staging/et131x/et1310_rx.c
 create mode 100644 drivers/staging/et131x/et1310_rx.h
 create mode 100644 drivers/staging/et131x/et1310_tx.c
 create mode 100644 drivers/staging/et131x/et1310_tx.h
 create mode 100644 drivers/staging/et131x/et131x_adapter.h
 create mode 100644 drivers/staging/et131x/et131x_config.c
 create mode 100644 drivers/staging/et131x/et131x_config.h
 create mode 100644 drivers/staging/et131x/et131x_debug.c
 create mode 100644 drivers/staging/et131x/et131x_debug.h
 create mode 100644 drivers/staging/et131x/et131x_defs.h
 create mode 100644 drivers/staging/et131x/et131x_initpci.c
 create mode 100644 drivers/staging/et131x/et131x_initpci.h
 create mode 100644 drivers/staging/et131x/et131x_isr.c
 create mode 100644 drivers/staging/et131x/et131x_isr.h
 create mode 100644 drivers/staging/et131x/et131x_netdev.c
 create mode 100644 drivers/staging/et131x/et131x_netdev.h
 create mode 100644 drivers/staging/et131x/et131x_version.h
 create mode 100644 drivers/staging/go7007/Kconfig
 create mode 100644 drivers/staging/go7007/Makefile
 create mode 100644 drivers/staging/go7007/README
 create mode 100644 drivers/staging/go7007/go7007-driver.c
 create mode 100644 drivers/staging/go7007/go7007-fw.c
 create mode 100644 drivers/staging/go7007/go7007-i2c.c
 create mode 100644 drivers/staging/go7007/go7007-priv.h
 create mode 100644 drivers/staging/go7007/go7007-usb.c
 create mode 100644 drivers/staging/go7007/go7007-v4l2.c
 create mode 100644 drivers/staging/go7007/go7007.h
 create mode 100644 drivers/staging/go7007/saa7134-go7007.c
 create mode 100644 drivers/staging/go7007/snd-go7007.c
 create mode 100644 drivers/staging/go7007/wis-i2c.h
 create mode 100644 drivers/staging/go7007/wis-ov7640.c
 create mode 100644 drivers/staging/go7007/wis-saa7113.c
 create mode 100644 drivers/staging/go7007/wis-saa7115.c
 create mode 100644 drivers/staging/go7007/wis-sony-tuner.c
 create mode 100644 drivers/staging/go7007/wis-tw2804.c
 create mode 100644 drivers/staging/go7007/wis-tw9903.c
 create mode 100644 drivers/staging/go7007/wis-uda1342.c
 create mode 100644 drivers/staging/me4000/Kconfig
 create mode 100644 drivers/staging/me4000/Makefile
 create mode 100644 drivers/staging/me4000/README
 create mode 100644 drivers/staging/me4000/me4000.c
 create mode 100644 drivers/staging/me4000/me4000.h
 create mode 100644 drivers/staging/me4000/me4000_firmware.h
 create mode 100644 drivers/staging/me4000/me4610_firmware.h
 create mode 100644 drivers/staging/slicoss/Kconfig
 create mode 100644 drivers/staging/slicoss/Makefile
 create mode 100644 drivers/staging/slicoss/README
 create mode 100644 drivers/staging/slicoss/gbdownload.h
 create mode 100644 drivers/staging/slicoss/gbrcvucode.h
 create mode 100644 drivers/staging/slicoss/oasisdbgdownload.h
 create mode 100644 drivers/staging/slicoss/oasisdownload.h
 create mode 100644 drivers/staging/slicoss/oasisrcvucode.h
 create mode 100644 drivers/staging/slicoss/slic.h
 create mode 100644 drivers/staging/slicoss/slic_os.h
 create mode 100644 drivers/staging/slicoss/slicbuild.h
 create mode 100644 drivers/staging/slicoss/slicdbg.h
 create mode 100644 drivers/staging/slicoss/slicdump.h
 create mode 100644 drivers/staging/slicoss/slichw.h
 create mode 100644 drivers/staging/slicoss/slicinc.h
 create mode 100644 drivers/staging/slicoss/slicoss.c
 create mode 100644 drivers/staging/staging.c
 create mode 100644 drivers/staging/sxg/Kconfig
 create mode 100644 drivers/staging/sxg/Makefile
 create mode 100644 drivers/staging/sxg/README
 create mode 100644 drivers/staging/sxg/saharadbgdownload.h
 create mode 100644 drivers/staging/sxg/sxg.c
 create mode 100644 drivers/staging/sxg/sxg.h
 create mode 100644 drivers/staging/sxg/sxg_os.h
 create mode 100644 drivers/staging/sxg/sxgdbg.h
 create mode 100644 drivers/staging/sxg/sxghif.h
 create mode 100644 drivers/staging/sxg/sxghw.h
 create mode 100644 drivers/staging/sxg/sxgphycode.h
 create mode 100644 drivers/staging/usbip/Kconfig
 create mode 100644 drivers/staging/usbip/Makefile
 create mode 100644 drivers/staging/usbip/README
 create mode 100644 drivers/staging/usbip/stub.h
 create mode 100644 drivers/staging/usbip/stub_dev.c
 create mode 100644 drivers/staging/usbip/stub_main.c
 create mode 100644 drivers/staging/usbip/stub_rx.c
 create mode 100644 drivers/staging/usbip/stub_tx.c
 create mode 100644 drivers/staging/usbip/usbip_common.c
 create mode 100644 drivers/staging/usbip/usbip_common.h
 create mode 100644 drivers/staging/usbip/usbip_event.c
 create mode 100644 drivers/staging/usbip/vhci.h
 create mode 100644 drivers/staging/usbip/vhci_hcd.c
 create mode 100644 drivers/staging/usbip/vhci_rx.c
 create mode 100644 drivers/staging/usbip/vhci_sysfs.c
 create mode 100644 drivers/staging/usbip/vhci_tx.c
 create mode 100644 drivers/staging/winbond/Kconfig
 create mode 100644 drivers/staging/winbond/Makefile
 create mode 100644 drivers/staging/winbond/README
 create mode 100644 drivers/staging/winbond/adapter.h
 create mode 100644 drivers/staging/winbond/bss_f.h
 create mode 100644 drivers/staging/winbond/bssdscpt.h
 create mode 100644 drivers/staging/winbond/ds_tkip.h
 create mode 100644 drivers/staging/winbond/gl_80211.h
 create mode 100644 drivers/staging/winbond/ioctls.h
 create mode 100644 drivers/staging/winbond/linux/common.h
 create mode 100644 drivers/staging/winbond/linux/sysdef.h
 create mode 100644 drivers/staging/winbond/linux/wb35reg.c
 create mode 100644 drivers/staging/winbond/linux/wb35reg_f.h
 create mode 100644 drivers/staging/winbond/linux/wb35reg_s.h
 create mode 100644 drivers/staging/winbond/linux/wb35rx.c
 create mode 100644 drivers/staging/winbond/linux/wb35rx_f.h
 create mode 100644 drivers/staging/winbond/linux/wb35rx_s.h
 create mode 100644 drivers/staging/winbond/linux/wb35tx.c
 create mode 100644 drivers/staging/winbond/linux/wb35tx_f.h
 create mode 100644 drivers/staging/winbond/linux/wb35tx_s.h
 create mode 100644 drivers/staging/winbond/linux/wbusb.c
 create mode 100644 drivers/staging/winbond/linux/wbusb_f.h
 create mode 100644 drivers/staging/winbond/linux/wbusb_s.h
 create mode 100644 drivers/staging/winbond/localpara.h
 create mode 100644 drivers/staging/winbond/mac_structures.h
 create mode 100644 drivers/staging/winbond/mds.c
 create mode 100644 drivers/staging/winbond/mds_f.h
 create mode 100644 drivers/staging/winbond/mds_s.h
 create mode 100644 drivers/staging/winbond/mlme_mib.h
 create mode 100644 drivers/staging/winbond/mlme_s.h
 create mode 100644 drivers/staging/winbond/mlmetxrx.c
 create mode 100644 drivers/staging/winbond/mlmetxrx_f.h
 create mode 100644 drivers/staging/winbond/mto.c
 create mode 100644 drivers/staging/winbond/mto.h
 create mode 100644 drivers/staging/winbond/mto_f.h
 create mode 100644 drivers/staging/winbond/os_common.h
 create mode 100644 drivers/staging/winbond/phy_calibration.c
 create mode 100644 drivers/staging/winbond/phy_calibration.h
 create mode 100644 drivers/staging/winbond/reg.c
 create mode 100644 drivers/staging/winbond/rxisr.c
 create mode 100644 drivers/staging/winbond/scan_s.h
 create mode 100644 drivers/staging/winbond/sme_api.c
 create mode 100644 drivers/staging/winbond/sme_api.h
 create mode 100644 drivers/staging/winbond/sme_s.h
 create mode 100644 drivers/staging/winbond/wb35_ver.h
 create mode 100644 drivers/staging/winbond/wbhal.c
 create mode 100644 drivers/staging/winbond/wbhal_f.h
 create mode 100644 drivers/staging/winbond/wbhal_s.h
 create mode 100644 drivers/staging/winbond/wblinux.c
 create mode 100644 drivers/staging/winbond/wblinux_f.h
 create mode 100644 drivers/staging/winbond/wblinux_s.h
 create mode 100644 drivers/staging/wlan-ng/Kconfig
 create mode 100644 drivers/staging/wlan-ng/Makefile
 create mode 100644 drivers/staging/wlan-ng/README
 create mode 100644 drivers/staging/wlan-ng/hfa384x.c
 create mode 100644 drivers/staging/wlan-ng/hfa384x.h
 create mode 100644 drivers/staging/wlan-ng/hfa384x_usb.c
 create mode 100644 drivers/staging/wlan-ng/p80211conv.c
 create mode 100644 drivers/staging/wlan-ng/p80211conv.h
 create mode 100644 drivers/staging/wlan-ng/p80211hdr.h
 create mode 100644 drivers/staging/wlan-ng/p80211ioctl.h
 create mode 100644 drivers/staging/wlan-ng/p80211meta.h
 create mode 100644 drivers/staging/wlan-ng/p80211metadef.h
 create mode 100644 drivers/staging/wlan-ng/p80211metamib.h
 create mode 100644 drivers/staging/wlan-ng/p80211metamsg.h
 create mode 100644 drivers/staging/wlan-ng/p80211metastruct.h
 create mode 100644 drivers/staging/wlan-ng/p80211mgmt.h
 create mode 100644 drivers/staging/wlan-ng/p80211mod.c
 create mode 100644 drivers/staging/wlan-ng/p80211msg.h
 create mode 100644 drivers/staging/wlan-ng/p80211netdev.c
 create mode 100644 drivers/staging/wlan-ng/p80211netdev.h
 create mode 100644 drivers/staging/wlan-ng/p80211req.c
 create mode 100644 drivers/staging/wlan-ng/p80211req.h
 create mode 100644 drivers/staging/wlan-ng/p80211types.h
 create mode 100644 drivers/staging/wlan-ng/p80211wep.c
 create mode 100644 drivers/staging/wlan-ng/p80211wext.c
 create mode 100644 drivers/staging/wlan-ng/prism2_cs.c
 create mode 100644 drivers/staging/wlan-ng/prism2_pci.c
 create mode 100644 drivers/staging/wlan-ng/prism2_plx.c
 create mode 100644 drivers/staging/wlan-ng/prism2_usb.c
 create mode 100644 drivers/staging/wlan-ng/prism2mgmt.c
 create mode 100644 drivers/staging/wlan-ng/prism2mgmt.h
 create mode 100644 drivers/staging/wlan-ng/prism2mib.c
 create mode 100644 drivers/staging/wlan-ng/prism2sta.c
 create mode 100644 drivers/staging/wlan-ng/version.h
 create mode 100644 drivers/staging/wlan-ng/wlan_compat.h

---------------

David Rowe (1):
Staging: add echo cancelation module

Greg Kroah-Hartman (12):
Staging: add TAINT_CRAP for all drivers/staging code
Staging: add TAINT_CRAP flag to drivers/staging modules
Staging: add Kconfig entries and Makefile infrastructure
Staging: add MAINTAINERS entry
Staging: add et131x network driver
Staging: add Alacritech slicoss network driver
Staging: add sxg network driver
Staging: add me4000 firmware files
Staging: add me4000 pci data collection driver
Staging: add the go7007 video driver
Staging: add wlan-ng prism2 usb driver
Staging: workaround build system bug

J.R. Mauro (2):
Staging: Fix gcc warnings in sxg
Staging: Lindent sxg.c

Lior Dotan (4):
Staging: SLICOSS: lots of checkpatch fixes
Staging: SLICOSS: Fix warnings due to static usage
Staging: SLICOSS: Fix remaining type names
Staging: SLICOSS: Call pci_release_regions at driver exit

Pavel Machek (1):
Staging: add w35und wifi driver

Pavel Roskin (1):
staging: at76_usb wireless driver

Ross Cohen (1):
Staging: go7007 v4l fixes

Takahiro Hirofuchi (3):
Staging: USB/IP: add common functions needed
Staging: USB/IP: add client driver
Staging: USB/IP: add host driver

author
#28 lore raw

PATCH 24/25 Staging: workaround build system bug

From: Greg Kroah-Hartman <[email protected]>

This is needed as CONFIG_STAGING is set to y, yet there is no code in drivers/staging/ to build, so the build-in.o doesn't get created properly. Create a "dummy" module in drivers/staging called staging.c to work around this bug.

---
 drivers/staging/Makefile  |    3 +++
 drivers/staging/staging.c |   19 +++++++++++++++++++
 2 files changed, 22 insertions(+), 0 deletions(-)
 create mode 100644 drivers/staging/staging.c
drivers/staging/Makefile +3 -0
index 93decb8..7c466e9 100644
@@ -1,5 +1,8 @@
 # Makefile for staging directory
 
+# fix for build system bug...
+obj-$(CONFIG_STAGING)		+= staging.o
+
 obj-$(CONFIG_ET131X)		+= et131x/
 obj-$(CONFIG_SLICOSS)		+= slicoss/
 obj-$(CONFIG_SXG)		+= sxg/
drivers/staging/staging.c new file +19 -0
new file mode 100644
index 0000000..233e589
@@ -0,0 +1,19 @@
+#include <linux/kernel.h>
+#include <linux/init.h>
+#include <linux/module.h>
+
+static int __init staging_init(void)
+{
+	return 0;
+}
+
+static void __exit staging_exit(void)
+{
+}
+
+module_init(staging_init);
+module_exit(staging_exit);
+
+MODULE_AUTHOR("Greg Kroah-Hartman");
+MODULE_DESCRIPTION("Staging Core");
+MODULE_LICENSE("GPL");
Signature · 1 line
1.6.0.2
author
#29 lore raw

PATCH 25/25 staging: at76_usb wireless driver

In reply to Greg KH

From: Pavel Roskin <[email protected]>

Add the at76_usb wireless driver to the staging tree while the other kernel driver (out of tree) gets rewritten to use the internal wireless stack.

This patch comes directly from the Fedora kernel tree, with only the directory placement of the files changed.

---
 drivers/staging/Kconfig             |    2 +
 drivers/staging/Makefile            |    1 +
 drivers/staging/at76_usb/Kconfig    |    8 +
 drivers/staging/at76_usb/Makefile   |    1 +
 drivers/staging/at76_usb/TODO       |    2 +
 drivers/staging/at76_usb/at76_usb.c | 5559 +++++++++++++++++++++++++++++++++++
 drivers/staging/at76_usb/at76_usb.h |  619 ++++
 7 files changed, 6192 insertions(+), 0 deletions(-)
 create mode 100644 drivers/staging/at76_usb/Kconfig
 create mode 100644 drivers/staging/at76_usb/Makefile
 create mode 100644 drivers/staging/at76_usb/TODO
 create mode 100644 drivers/staging/at76_usb/at76_usb.c
 create mode 100644 drivers/staging/at76_usb/at76_usb.h
drivers/staging/Kconfig +2 -0
index 25338b7..2a79dec 100644
@@ -41,4 +41,6 @@ source "drivers/staging/wlan-ng/Kconfig"
 
 source "drivers/staging/echo/Kconfig"
 
+source "drivers/staging/at76_usb/Kconfig"
+
 endif # STAGING
drivers/staging/Makefile +1 -0
index 7c466e9..325bca4 100644
@@ -12,3 +12,4 @@ obj-$(CONFIG_USB_IP_COMMON)	+= usbip/
 obj-$(CONFIG_W35UND)		+= winbond/
 obj-$(CONFIG_PRISM2_USB)	+= wlan-ng/
 obj-$(CONFIG_ECHO)		+= echo/
+obj-$(CONFIG_USB_ATMEL)		+= at76_usb/
drivers/staging/at76_usb/Kconfig new file +8 -0
new file mode 100644
index 0000000..8606f96
@@ -0,0 +1,8 @@
+config USB_ATMEL
+	tristate "Atmel at76c503/at76c505/at76c505a USB cards"
+	depends on WLAN_80211 && USB
+	default N
+	select FW_LOADER
+	---help---
+	  Enable support for USB Wireless devices using Atmel at76c503,
+	  at76c505 or at76c505a chips.
drivers/staging/at76_usb/Makefile new file +1 -0
new file mode 100644
index 0000000..6a47e88
@@ -0,0 +1 @@
+obj-$(CONFIG_USB_ATMEL)		+= at76_usb.o
drivers/staging/at76_usb/TODO new file +2 -0
new file mode 100644
index 0000000..6911ca7
@@ -0,0 +1,2 @@
+rewrite the driver to use the proper in-kernel wireless stack
+instead of using its own.
drivers/staging/at76_usb/at76_usb.c new file +5559 -0

2,979 lines not on this page · raw message

drivers/staging/at76_usb/at76_usb.h new file +619 -0

619 lines not on this page · raw message

The rest of this diff is not shown. View the raw message.

Signature · 1 line
1.6.0.2

Part of the diff is not shown here. View the raw message.

#30 lore raw

Re: [PATCH 25/25] staging: at76_usb wireless driver

Quoted 10 lines · Greg KH

From: Pavel Roskin <[email protected]>

Add the at76_usb wireless driver to the staging tree while the other kernel driver (out of tree) gets rewritten to use the internal wireless stack.

This patch comes directly from the Fedora kernel tree, with only the directory placement of the files changed.

I'm not going to support this code in any way. I disclaim any responsibility for this code.

Signature · 2 lines
Regards,
Pavel Roskin
#31 lore raw

Re: [PATCH 25/25] staging: at76_usb wireless driver

Quoted 7 lines · Pavel Roskin
Quoted 6 lines · Greg KH

From: Pavel Roskin <[email protected]>

Add the at76_usb wireless driver to the staging tree while the other kernel driver (out of tree) gets rewritten to use the internal wireless stack.

Quoted 7 lines
Quoted 4 lines

This patch comes directly from the Fedora kernel tree, with only the directory placement of the files changed.

I'm not going to support this code in any way. I disclaim any responsibility for this code.

Heh, that's fine with me, but as you did write this code, I do want to give you the proper credit. I'll maintain it while it is in the staging tree.

You might want to poke John, as his version of this patch adds your name to the MAINTAINERS file in the Fedora kernels, something I don't think you want to have done :)

thanks,

greg k-h

#32 lore raw

Re: [PATCH 25/25] staging: at76_usb wireless driver

Quoted 16 lines · Greg KH
Quoted 7 lines · Pavel Roskin
Quoted 6 lines · Greg KH

From: Pavel Roskin <[email protected]>

Add the at76_usb wireless driver to the staging tree while the other kernel driver (out of tree) gets rewritten to use the internal wireless stack.

Quoted 7 lines
Quoted 4 lines

This patch comes directly from the Fedora kernel tree, with only the directory placement of the files changed.

I'm not going to support this code in any way. I disclaim any responsibility for this code.

Quoted 7 lines

Heh, that's fine with me, but as you did write this code, I do want to give you the proper credit. I'll maintain it while it is in the staging tree.

You might want to poke John, as his version of this patch adds your name to the MAINTAINERS file in the Fedora kernels, something I don't think you want to have done :)

OK, I don't care as long as I don't get any bug reports or support requests.

Signature · 2 lines
Regards,
Pavel Roskin
#33 lore raw

Re: [PATCH 25/25] staging: at76_usb wireless driver

Quoted 21 lines · Pavel Roskin
Quoted 20 lines · Greg KH
Quoted 7 lines · Pavel Roskin
Quoted 6 lines · Greg KH

From: Pavel Roskin <[email protected]>

Add the at76_usb wireless driver to the staging tree while the other kernel driver (out of tree) gets rewritten to use the internal wireless stack.

Quoted 7 lines
Quoted 4 lines

This patch comes directly from the Fedora kernel tree, with only the directory placement of the files changed.

I'm not going to support this code in any way. I disclaim any responsibility for this code.

Heh, that's fine with me, but as you did write this code, I do want to give you the proper credit. I'll maintain it while it is in the staging tree.

Quoted 6 lines
Quoted 3 lines

You might want to poke John, as his version of this patch adds your name to the MAINTAINERS file in the Fedora kernels, something I don't think you want to have done :)

OK, I don't care as long as I don't get any bug reports or support requests.

If you do, point them directly to me.

thanks,

greg k-h

#34 lore raw
In reply to Greg KH
Quoted 5 lines · Greg KH

I've now added 2 more patches to this tree, fixing a build error if you did not build any staging drivers into your tree (the normal mode of building), and added an additional wireless driver that came from the Fedora kernel trees.

Greg - I finally got around to merging this tree, and it got some conflicts with the changes/cleanups to taint handling (and due to the MAINTAINERS file cleanups/alphasort). They conflicts weren't all that nasty, and I think they're all resolved correctly, but it might be worth testing the TAINT_CRAP flag in particular. I tested the build in the normal config, but didn't actually bother to test any tainted drivers.

Linus

author
#35 lore raw
Quoted 9 lines · Linus Torvalds
Quoted 5 lines · Greg KH

I've now added 2 more patches to this tree, fixing a build error if you did not build any staging drivers into your tree (the normal mode of building), and added an additional wireless driver that came from the Fedora kernel trees.

Quoted 6 lines

Greg - I finally got around to merging this tree, and it got some conflicts with the changes/cleanups to taint handling (and due to the MAINTAINERS file cleanups/alphasort). They conflicts weren't all that nasty, and I think they're all resolved correctly, but it might be worth testing the TAINT_CRAP flag in particular. I tested the build in the normal config, but didn't actually bother to test any tainted drivers.

Thanks for letting me know, I'll go build and test this right now.

greg k-h

author
#36 lore raw
Quoted 10 lines · Greg KH
Quoted 9 lines · Linus Torvalds
Quoted 5 lines · Greg KH

I've now added 2 more patches to this tree, fixing a build error if you did not build any staging drivers into your tree (the normal mode of building), and added an additional wireless driver that came from the Fedora kernel trees.

Quoted 8 lines
Quoted 6 lines

Greg - I finally got around to merging this tree, and it got some conflicts with the changes/cleanups to taint handling (and due to the MAINTAINERS file cleanups/alphasort). They conflicts weren't all that nasty, and I think they're all resolved correctly, but it might be worth testing the TAINT_CRAP flag in particular. I tested the build in the normal config, but didn't actually bother to test any tainted drivers.

Thanks for letting me know, I'll go build and test this right now.

Yes, this seems to be working just fine, my kernel is properly tainted with crap now :)

thanks,

greg k-h