[GIT PATCH] more STAGING patches for 2.6.28 - Kernel

This is a discussion on [GIT PATCH] more STAGING patches for 2.6.28 - Kernel ; Here are some more staging patches against your 2.6 git tree. These should fix up all of the known build warnings, so that I don't get a bunch of patches that do the same thing from different people, as well ...

+ Reply to Thread
Page 1 of 3 1 2 3 LastLast
Results 1 to 20 of 48

Thread: [GIT PATCH] more STAGING patches for 2.6.28

  1. [GIT PATCH] more STAGING patches for 2.6.28

    Here are some more staging patches against your 2.6 git tree.

    These should fix up all of the known build warnings, so that I don't get
    a bunch of patches that do the same thing from different people, as well
    as a lot of other cleanups and 2 more new drivers.

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

    These have all been in the past few -next releases with no known build
    errors.

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

    thanks,

    greg k-h


    drivers/staging/Kconfig | 4 +
    drivers/staging/Makefile | 2 +
    drivers/staging/at76_usb/at76_usb.c | 4 +-
    drivers/staging/echo/bit_operations.h | 205 ++---
    drivers/staging/echo/echo.c | 847 +++++++++---------
    drivers/staging/echo/echo.h | 58 +--
    drivers/staging/echo/fir.h | 376 +++-----
    drivers/staging/echo/mmx.h | 29 +-
    drivers/staging/echo/oslec.h | 86 ++
    drivers/staging/et131x/et1310_phy.c | 2 -
    drivers/staging/et131x/et131x_debug.c | 1 -
    drivers/staging/et131x/et131x_initpci.c | 1 -
    drivers/staging/go7007/go7007-driver.c | 1 -
    drivers/staging/go7007/go7007-fw.c | 1 -
    drivers/staging/go7007/go7007-i2c.c | 1 -
    drivers/staging/go7007/go7007-usb.c | 1 -
    drivers/staging/go7007/snd-go7007.c | 1 -
    drivers/staging/go7007/wis-ov7640.c | 1 -
    drivers/staging/go7007/wis-saa7113.c | 1 -
    drivers/staging/go7007/wis-saa7115.c | 1 -
    drivers/staging/go7007/wis-sony-tuner.c | 1 -
    drivers/staging/go7007/wis-tw2804.c | 1 -
    drivers/staging/go7007/wis-tw9903.c | 1 -
    drivers/staging/go7007/wis-uda1342.c | 1 -
    drivers/staging/me4000/me4000.c | 908 +++++++++----------
    drivers/staging/me4000/me4000.h | 194 +++--
    drivers/staging/pcc-acpi/Kconfig | 11 +
    drivers/staging/pcc-acpi/Makefile | 1 +
    drivers/staging/pcc-acpi/TODO | 7 +
    drivers/staging/pcc-acpi/pcc-acpi.c | 1111 ++++++++++++++++++++++
    drivers/staging/poch/Kconfig | 6 +
    drivers/staging/poch/Makefile | 1 +
    drivers/staging/poch/README | 7 +
    drivers/staging/poch/poch.c | 1425 +++++++++++++++++++++++++++++
    drivers/staging/poch/poch.h | 29 +
    drivers/staging/slicoss/slicoss.c | 18 +-
    drivers/staging/sxg/README | 1 +
    drivers/staging/sxg/sxg.c | 1379 ++++++++++++++--------------
    drivers/staging/sxg/sxg_os.h | 41 +-
    drivers/staging/sxg/sxgdbg.h | 2 +-
    drivers/staging/sxg/sxghif.h | 410 ++++-----
    drivers/staging/sxg/sxghw.h | 404 ++++----
    drivers/staging/sxg/sxgphycode.h | 12 +-
    drivers/staging/usbip/usbip_common.c | 2 +-
    drivers/staging/usbip/vhci_rx.c | 2 +-
    drivers/staging/winbond/Kconfig | 2 +-
    drivers/staging/winbond/README | 1 +
    drivers/staging/winbond/bss_f.h | 6 +-
    drivers/staging/winbond/ds_tkip.h | 6 +-
    drivers/staging/winbond/linux/common.h | 17 +-
    drivers/staging/winbond/linux/wb35reg.c | 63 +-
    drivers/staging/winbond/linux/wb35reg_f.h | 12 +-
    drivers/staging/winbond/linux/wb35reg_s.h | 4 +-
    drivers/staging/winbond/linux/wb35rx.c | 175 ++--
    drivers/staging/winbond/linux/wb35rx_s.h | 2 +-
    drivers/staging/winbond/linux/wb35tx.c | 138 ++--
    drivers/staging/winbond/linux/wb35tx_f.h | 2 +-
    drivers/staging/winbond/linux/wbusb.c | 259 +++---
    drivers/staging/winbond/mds.c | 30 +-
    drivers/staging/winbond/mds_f.h | 6 +-
    drivers/staging/winbond/mds_s.h | 8 +-
    drivers/staging/winbond/mlme_s.h | 4 +-
    drivers/staging/winbond/mlmetxrx.c | 4 +-
    drivers/staging/winbond/mlmetxrx_f.h | 4 +-
    drivers/staging/winbond/reg.c | 24 +-
    drivers/staging/winbond/sme_api.c | 1 +
    drivers/staging/winbond/sme_api.h | 2 +-
    drivers/staging/winbond/wbhal.c | 32 +-
    drivers/staging/winbond/wbhal_f.h | 28 +-
    drivers/staging/winbond/wbhal_s.h | 4 +-
    drivers/staging/winbond/wblinux.c | 208 +++---
    drivers/staging/winbond/wblinux_s.h | 4 +-
    drivers/staging/wlan-ng/Kconfig | 2 +-
    drivers/staging/wlan-ng/hfa384x.h | 2 +-
    drivers/staging/wlan-ng/p80211wep.c | 1 -
    drivers/staging/wlan-ng/prism2mib.c | 2 -
    drivers/staging/wlan-ng/wlan_compat.h | 8 +-
    77 files changed, 5566 insertions(+), 3093 deletions(-)
    create mode 100644 drivers/staging/echo/oslec.h
    create mode 100644 drivers/staging/pcc-acpi/Kconfig
    create mode 100644 drivers/staging/pcc-acpi/Makefile
    create mode 100644 drivers/staging/pcc-acpi/TODO
    create mode 100644 drivers/staging/pcc-acpi/pcc-acpi.c
    create mode 100644 drivers/staging/poch/Kconfig
    create mode 100644 drivers/staging/poch/Makefile
    create mode 100644 drivers/staging/poch/README
    create mode 100644 drivers/staging/poch/poch.c
    create mode 100644 drivers/staging/poch/poch.h

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

    Diego Calleja (1):
    Staging: Fix leak in drivers/staging/at76_usb.c

    Geert Uytterhoeven (1):
    Staging: W35UND should depend on USB

    Greg Kroah-Hartman (8):
    Staging: document 4k stack problem for winbond driver
    Staging: wlan-ng: fix build error if wireless networking is not enabled
    Staging: pcc-acpi: update to latest version
    Staging: sxg: fix up unused function warnings
    Staging: sxg: fix compiler warnings.
    Staging: wbusb: fix a bunch of compiler warnings
    Staging: me4000: remove some compiler warnings
    Staging: usbip: fix build warning on 64bit kernels

    Harvey Harrison (2):
    Staging: sxg: replace __FUNCTION__ with __func__
    Staging: remove remaining uses of __FUNCTION__

    Hiroshi Miura (1):
    Staging: add pcc-acpi driver

    Huang Weiyi (6):
    Staging: SLICOSS: remove duplicated #include's
    Staging: et131x: remove duplicated #include's
    Staging: wlan-ng: prism2: remove duplicated #include
    staging: wlan-ng: prism2: remove more duplicated #include
    Staging: go7007: remove unused #include
    Staging: SLICOSS: remove unused #include

    J.R. Mauro (3):
    Staging: Clean up sxg driver
    Staging: Lindent the echo driver
    Staging: sxg: clean up C99 comments

    Lior Dotan (3):
    Staging: Fixes for me4000 pci data collection driver
    Staging: PCC-ACPI: Fix all checkpatch errors
    Staging: SLICOSS: Free multicast list at driver exit

    Mariusz Kozlowski (2):
    staging: fix potential build error in slicoss driver
    staging: balance parenthesis in wlan-ng headers

    Pekka Enberg (8):
    Staging: w35und: remove some typedefs
    Staging: echo: fix kmalloc()/kfree() uses
    Staging: echo: remove dead code
    Staging: echo: remove __cplusplus macro magic
    Staging: echo: remove annoying "end of function" markers
    Staging: w35und: remove spinlock wrappers
    Staging: w35und: use gotos for error handling
    Staging: w35und: module init cleanup

    Stephen Rothwell (1):
    linux-next: build failure

    Tzafrir Cohen (5):
    Staging: echo: A separate oslec.h for external interface
    Staging: echo: Export interface functions. Add module headers.
    Staging: echo: Replace echo_can_state_t with struct echo_can_state
    Staging: echo: Changed preffix from echo_can_ to oslec_
    Staging: echo: Replace __BLACKFIN__ASM__ with __bfin__

    Vijay Kumar (1):
    Staging: add poch driver

    --
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

  2. [PATCH 05/42] Staging: Fix leak in drivers/staging/at76_usb.c

    From: Diego Calleja

    Fix leak in at76_usb as reported in:
    http://bugzilla.kernel.org/show_bug.cgi?id=11778


    Reported-by: Daniel Marjamäki
    Signed-off-by: Diego Calleja
    Signed-off-by: Greg Kroah-Hartman
    ---
    drivers/staging/at76_usb/at76_usb.c | 4 +++-
    1 files changed, 3 insertions(+), 1 deletions(-)

    diff --git a/drivers/staging/at76_usb/at76_usb.c b/drivers/staging/at76_usb/at76_usb.c
    index 52df0c6..174e2be 100644
    --- a/drivers/staging/at76_usb/at76_usb.c
    +++ b/drivers/staging/at76_usb/at76_usb.c
    @@ -2319,9 +2319,11 @@ static int at76_iw_handler_get_scan(struct net_device *netdev,
    if (!iwe)
    return -ENOMEM;

    - if (priv->scan_state != SCAN_COMPLETED)
    + if (priv->scan_state != SCAN_COMPLETED) {
    /* scan not yet finished */
    + kfree(iwe);
    return -EAGAIN;
    + }

    spin_lock_irqsave(&priv->bss_list_spinlock, flags);

    --
    1.6.0.2

    --
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

  3. [PATCH 10/42] Staging: et131x: remove duplicated #include's

    From: Huang Weiyi

    Removed duplicated #include's in file(s) below,
    - drivers/staging/et131x/et1310_phy.c
    et1310_jagcore.h
    linux/delay.h
    - drivers/staging/et131x/et131x_debug.c
    et1310_jagcore.h
    - drivers/staging/et131x/et131x_initpci.c
    et1310_jagcore.h

    Signed-off-by: Huang Weiyi
    Signed-off-by: Greg Kroah-Hartman
    ---
    drivers/staging/et131x/et1310_phy.c | 2 --
    drivers/staging/et131x/et131x_debug.c | 1 -
    drivers/staging/et131x/et131x_initpci.c | 1 -
    3 files changed, 0 insertions(+), 4 deletions(-)

    diff --git a/drivers/staging/et131x/et1310_phy.c b/drivers/staging/et131x/et1310_phy.c
    index 6c4fa54..9dd6dfd 100644
    --- a/drivers/staging/et131x/et1310_phy.c
    +++ b/drivers/staging/et131x/et1310_phy.c
    @@ -84,7 +84,6 @@
    #include
    #include
    #include
    -#include

    #include "et1310_phy.h"
    #include "et1310_pm.h"
    @@ -95,7 +94,6 @@
    #include "et131x_initpci.h"

    #include "et1310_address_map.h"
    -#include "et1310_jagcore.h"
    #include "et1310_tx.h"
    #include "et1310_rx.h"
    #include "et1310_mac.h"
    diff --git a/drivers/staging/et131x/et131x_debug.c b/drivers/staging/et131x/et131x_debug.c
    index 9ee5bce..d1dd46e 100644
    --- a/drivers/staging/et131x/et131x_debug.c
    +++ b/drivers/staging/et131x/et131x_debug.c
    @@ -97,7 +97,6 @@
    #include "et131x_isr.h"

    #include "et1310_address_map.h"
    -#include "et1310_jagcore.h"
    #include "et1310_tx.h"
    #include "et1310_rx.h"
    #include "et1310_mac.h"
    diff --git a/drivers/staging/et131x/et131x_initpci.c b/drivers/staging/et131x/et131x_initpci.c
    index 4c6f171..a18c499 100644
    --- a/drivers/staging/et131x/et131x_initpci.c
    +++ b/drivers/staging/et131x/et131x_initpci.c
    @@ -97,7 +97,6 @@
    #include "et131x_isr.h"

    #include "et1310_address_map.h"
    -#include "et1310_jagcore.h"
    #include "et1310_tx.h"
    #include "et1310_rx.h"
    #include "et1310_mac.h"
    --
    1.6.0.2

    --
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

  4. [PATCH 07/42] staging: balance parenthesis in wlan-ng headers

    From: Mariusz Kozlowski

    Balance parenthesis in HFA384x_CMD_QOS_GET macro.

    Signed-off-by: Mariusz Kozlowski
    Signed-off-by: Greg Kroah-Hartman
    ---
    drivers/staging/wlan-ng/hfa384x.h | 2 +-
    1 files changed, 1 insertions(+), 1 deletions(-)

    diff --git a/drivers/staging/wlan-ng/hfa384x.h b/drivers/staging/wlan-ng/hfa384x.h
    index a205463..0dfb8ce 100644
    --- a/drivers/staging/wlan-ng/hfa384x.h
    +++ b/drivers/staging/wlan-ng/hfa384x.h
    @@ -824,7 +824,7 @@ PD Record codes
    #define HFA384x_CMD_MACPORT_SET(value) ((UINT16)HFA384x_CMD_AINFO_SET(value))
    #define HFA384x_CMD_ISRECL(value) ((UINT16)(HFA384x_CMD_AINFO_GET((UINT16)(value) & HFA384x_CMD_RECL)))
    #define HFA384x_CMD_RECL_SET(value) ((UINT16)HFA384x_CMD_AINFO_SET(value))
    -#define HFA384x_CMD_QOS_GET(value) ((UINT16((((UINT16)(value))&((UINT16)0x3000)) >> 12))
    +#define HFA384x_CMD_QOS_GET(value) ((UINT16)((((UINT16)(value))&((UINT16)0x3000)) >> 12))
    #define HFA384x_CMD_QOS_SET(value) ((UINT16)((((UINT16)(value)) << 12) & 0x3000))
    #define HFA384x_CMD_ISWRITE(value) ((UINT16)(HFA384x_CMD_AINFO_GET((UINT16)(value) & HFA384x_CMD_WRITE)))
    #define HFA384x_CMD_WRITE_SET(value) ((UINT16)HFA384x_CMD_AINFO_SET((UINT16)value))
    --
    1.6.0.2

    --
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

  5. [PATCH 12/42] staging: wlan-ng: prism2: remove more duplicated #include

    From: Huang Weiyi

    Removed duplicated #include "version.h" in
    drivers/staging/wlan-ng/p80211wep.c.

    Signed-off-by: Huang Weiyi
    Signed-off-by: Greg Kroah-Hartman
    ---
    drivers/staging/wlan-ng/p80211wep.c | 1 -
    1 files changed, 0 insertions(+), 1 deletions(-)

    diff --git a/drivers/staging/wlan-ng/p80211wep.c b/drivers/staging/wlan-ng/p80211wep.c
    index 53fe298..11a50c7 100644
    --- a/drivers/staging/wlan-ng/p80211wep.c
    +++ b/drivers/staging/wlan-ng/p80211wep.c
    @@ -64,7 +64,6 @@
    /*================================================= ===============*/
    /* Project Includes */

    -#include "version.h"
    #include "p80211hdr.h"
    #include "p80211types.h"
    #include "p80211msg.h"
    --
    1.6.0.2

    --
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

  6. [PATCH 02/42] Staging: W35UND should depend on USB

    From: Geert Uytterhoeven

    W35UND should depend on USB

    Signed-off-by: Geert Uytterhoeven
    Signed-off-by: Greg Kroah-Hartman
    ---
    drivers/staging/winbond/Kconfig | 2 +-
    1 files changed, 1 insertions(+), 1 deletions(-)

    diff --git a/drivers/staging/winbond/Kconfig b/drivers/staging/winbond/Kconfig
    index 10d72be..425219e 100644
    --- a/drivers/staging/winbond/Kconfig
    +++ b/drivers/staging/winbond/Kconfig
    @@ -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
    --
    1.6.0.2

    --
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

  7. [PATCH 03/42] linux-next: build failure

    From: Stephen Rothwell

    sxghif.h has code that explicitly will not build fo other architecures.

    Signed-off-by: Stephen Rothwell
    Signed-off-by: Greg Kroah-Hartman
    ---
    drivers/staging/sxg/README | 1 +
    1 files changed, 1 insertions(+), 0 deletions(-)

    diff --git a/drivers/staging/sxg/README b/drivers/staging/sxg/README
    index 4d1ddbe..d514d18 100644
    --- a/drivers/staging/sxg/README
    +++ b/drivers/staging/sxg/README
    @@ -7,6 +7,7 @@ TODO:
    - remove wrappers
    - checkpatch.pl cleanups
    - new functionality that the card needs
    + - remove reliance on x86

    Please send patches to:
    Greg Kroah-Hartman
    --
    1.6.0.2

    --
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

  8. [PATCH 14/42] Staging: SLICOSS: remove unused #include <version.h>

    From: Huang Weiyi

    The file(s) below do not use LINUX_VERSION_CODE nor KERNEL_VERSION.
    drivers/staging/slicoss/slicoss.c

    This patch removes the said #include .

    Signed-off-by: Huang Weiyi
    Signed-off-by: Greg Kroah-Hartman
    ---
    drivers/staging/slicoss/slicoss.c | 1 -
    1 files changed, 0 insertions(+), 1 deletions(-)

    diff --git a/drivers/staging/slicoss/slicoss.c b/drivers/staging/slicoss/slicoss.c
    index 69f3ea2..6ef9274 100644
    --- a/drivers/staging/slicoss/slicoss.c
    +++ b/drivers/staging/slicoss/slicoss.c
    @@ -54,7 +54,6 @@
    * IS-NIC driver.
    */

    -#include

    #define SLIC_DUMP_ENABLED 0
    #define KLUDGE_FOR_4GB_BOUNDARY 1
    --
    1.6.0.2

    --
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

  9. [PATCH 08/42] Staging: Fixes for me4000 pci data collection driver

    From: Lior Dotan

    Following Andrew Morton's review for this patch I made a patch that
    fixes most of the remarks.
    I've converted the sleep_on_timeout to wait_event_timeout but I
    probably not in the right way.
    Also I don't know what's the problem with the calls for get_user() so
    I left them untouched.

    Signed-off-by: Lior Dotan
    Cc: Andrew Morton
    Signed-off-by: Greg Kroah-Hartman
    ---
    drivers/staging/me4000/me4000.c | 896 +++++++++++++++++++--------------------
    drivers/staging/me4000/me4000.h | 194 +++++----
    2 files changed, 545 insertions(+), 545 deletions(-)

    diff --git a/drivers/staging/me4000/me4000.c b/drivers/staging/me4000/me4000.c
    index 862dd7f..75c268c 100644
    --- a/drivers/staging/me4000/me4000.c
    +++ b/drivers/staging/me4000/me4000.c
    @@ -25,24 +25,21 @@
    #include
    #include
    #include
    -#include
    -#include
    -#include
    #include
    #include
    -#include
    #include
    #include
    #include
    #include
    -
    +#include
    #include
    #include
    +#include
    #include
    #include
    -#include
    -
    -#include
    +#include
    +#include
    +#include

    /* Include-File for the Meilhaus ME-4000 I/O board */
    #include "me4000.h"
    @@ -57,14 +54,14 @@ 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 LIST_HEAD(me4000_board_info_list);

    /* 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;
    +static int me4000_ao_major_driver_no;
    +static int me4000_ai_major_driver_no;
    +static int me4000_dio_major_driver_no;
    +static int me4000_cnt_major_driver_no;
    +static int me4000_ext_int_major_driver_no;

    /* Let the user specify a custom major driver number */
    module_param(me4000_ao_major_driver_no, int, 0);
    @@ -88,36 +85,22 @@ 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);
    -
    -/*-----------------------------------------------------------------------------
    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 *);
    +static int me4000_xilinx_download(struct me4000_info *);
    +static int me4000_reset_board(struct me4000_info *);

    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);
    -
    +static void release_ao_contexts(struct me4000_info *board_info);
    /*-----------------------------------------------------------------------------
    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_get_user_info(struct me4000_user_info *,
    + struct me4000_info *board_info);
    static int me4000_read_procmem(char *, char **, off_t, int, int *, void *);

    /*-----------------------------------------------------------------------------
    @@ -140,40 +123,42 @@ static int me4000_ao_ioctl_cont(struct inode *, struct file *, unsigned int,
    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_li st_t * channels,
    - 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_start(unsigned long *, struct me4000_ao_context *);
    +static int me4000_ao_stop(struct me4000_ao_context *);
    +static int me4000_ao_immediate_stop(struct me4000_ao_context *);
    +static int me4000_ao_timer_set_divisor(u32 *, struct me4000_ao_context *);
    +static int me4000_ao_preload(struct me4000_ao_context *);
    +static int me4000_ao_preload_update(struct me4000_ao_context *);
    +static int me4000_ao_ex_trig_set_edge(int *, struct me4000_ao_context *);
    +static int me4000_ao_ex_trig_enable(struct me4000_ao_context *);
    +static int me4000_ao_ex_trig_disable(struct me4000_ao_context *);
    +static int me4000_ao_prepare(struct me4000_ao_context *ao_info);
    +static int me4000_ao_reset(struct me4000_ao_context *ao_info);
    +static int me4000_ao_enable_do(struct me4000_ao_context *);
    +static int me4000_ao_disable_do(struct me4000_ao_context *);
    +static int me4000_ao_fsm_state(int *, struct me4000_ao_context *);
    +
    +static int me4000_ao_simultaneous_ex_trig(struct me4000_ao_context *ao_context);
    +static int me4000_ao_simultaneous_sw(struct me4000_ao_context *ao_context);
    +static int me4000_ao_simultaneous_disable(struct me4000_ao_context *ao_context);
    +static int me4000_ao_simultaneous_update(
    + struct me4000_ao_channel_list *channels,
    + struct me4000_ao_context *ao_context);
    +
    +static int me4000_ao_synchronous_ex_trig(struct me4000_ao_context *ao_context);
    +static int me4000_ao_synchronous_sw(struct me4000_ao_context *ao_context);
    +static int me4000_ao_synchronous_disable(struct me4000_ao_context *ao_context);

    static int me4000_ao_ex_trig_timeout(unsigned long *arg,
    - me4000_ao_context_t * ao_context);
    + struct me4000_ao_context *ao_context);
    static int me4000_ao_get_free_buffer(unsigned long *arg,
    - me4000_ao_context_t * ao_context);
    + struct me4000_ao_context *ao_context);

    /*-----------------------------------------------------------------------------
    Analog input stuff
    ---------------------------------------------------------------------------*/
    -static int me4000_ai_single(me4000_ai_single_t *, me4000_ai_context_t *);
    +static int me4000_ai_single(struct me4000_ai_single *,
    + struct me4000_ai_context *);
    static int me4000_ai_ioctl_sing(struct inode *, struct file *, unsigned int,
    unsigned long);

    @@ -186,68 +171,69 @@ 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 *,
    - 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_prepare(struct me4000_ai_context *ai_context);
    +static int me4000_ai_reset(struct me4000_ai_context *ai_context);
    +static int me4000_ai_config(struct me4000_ai_config *,
    + struct me4000_ai_context *);
    +static int me4000_ai_start(struct me4000_ai_context *);
    +static int me4000_ai_start_ex(unsigned long *, struct me4000_ai_context *);
    +static int me4000_ai_stop(struct me4000_ai_context *);
    +static int me4000_ai_immediate_stop(struct me4000_ai_context *);
    +static int me4000_ai_ex_trig_enable(struct me4000_ai_context *);
    +static int me4000_ai_ex_trig_disable(struct me4000_ai_context *);
    +static int me4000_ai_ex_trig_setup(struct me4000_ai_trigger *,
    + struct me4000_ai_context *);
    +static int me4000_ai_sc_setup(struct me4000_ai_sc *arg,
    + struct me4000_ai_context *ai_context);
    +static int me4000_ai_offset_enable(struct me4000_ai_context *ai_context);
    +static int me4000_ai_offset_disable(struct me4000_ai_context *ai_context);
    +static int me4000_ai_fullscale_enable(struct me4000_ai_context *ai_context);
    +static int me4000_ai_fullscale_disable(struct me4000_ai_context *ai_context);
    +static int me4000_ai_fsm_state(int *arg, struct me4000_ai_context *ai_context);
    static int me4000_ai_get_count_buffer(unsigned long *arg,
    - me4000_ai_context_t * ai_context);
    + struct me4000_ai_context *ai_context);

    /*-----------------------------------------------------------------------------
    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);
    +static int me4000_eeprom_read(struct me4000_eeprom *arg,
    + struct me4000_ai_context *ai_context);
    +static int me4000_eeprom_write(struct me4000_eeprom *arg,
    + struct me4000_ai_context *ai_context);

    /*-----------------------------------------------------------------------------
    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 *);
    +static int me4000_dio_config(struct me4000_dio_config *,
    + struct me4000_dio_context *);
    +static int me4000_dio_get_byte(struct me4000_dio_byte *,
    + struct me4000_dio_context *);
    +static int me4000_dio_set_byte(struct me4000_dio_byte *,
    + struct me4000_dio_context *);
    +static int me4000_dio_reset(struct me4000_dio_context *);

    /*-----------------------------------------------------------------------------
    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 *);
    +static int me4000_cnt_config(struct me4000_cnt_config *,
    + struct me4000_cnt_context *);
    +static int me4000_cnt_read(struct me4000_cnt *, struct me4000_cnt_context *);
    +static int me4000_cnt_write(struct me4000_cnt *, struct me4000_cnt_context *);
    +static int me4000_cnt_reset(struct me4000_cnt_context *);

    /*-----------------------------------------------------------------------------
    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_enable(struct me4000_ext_int_context *);
    +static int me4000_ext_int_disable(struct me4000_ext_int_context *);
    static int me4000_ext_int_count(unsigned long *arg,
    - me4000_ext_int_context_t * ext_int_context);
    + struct me4000_ext_int_context *ext_int_context);
    static int me4000_ext_int_fasync(int fd, struct file *file_ptr, int mode);

    /*-----------------------------------------------------------------------------
    @@ -260,27 +246,18 @@ static irqreturn_t me4000_ext_int_isr(int, void *);
    /*-----------------------------------------------------------------------------
    Inline functions
    ---------------------------------------------------------------------------*/
    -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);

    -static int me4000_buf_count(me4000_circ_buf_t buf, int size)
    +static int inline me4000_buf_count(struct me4000_circ_buf buf, int size)
    {
    return ((buf.head - buf.tail) & (size - 1));
    }

    -static int me4000_buf_space(me4000_circ_buf_t buf, int size)
    +static int inline me4000_buf_space(struct me4000_circ_buf buf, int size)
    {
    return ((buf.tail - (buf.head + 1)) & (size - 1));
    }

    -static int me4000_values_to_end(me4000_circ_buf_t buf, int size)
    +static int inline me4000_values_to_end(struct me4000_circ_buf buf, int size)
    {
    int end;
    int n;
    @@ -289,7 +266,7 @@ static int me4000_values_to_end(me4000_circ_buf_t buf, int size)
    return (n < end) ? n : end;
    }

    -static int me4000_space_to_end(me4000_circ_buf_t buf, int size)
    +static int inline me4000_space_to_end(struct me4000_circ_buf buf, int size)
    {
    int end;
    int n;
    @@ -299,19 +276,19 @@ static int me4000_space_to_end(me4000_circ_buf_t buf, int size)
    return (n <= end) ? n : (end + 1);
    }

    -static void me4000_outb(unsigned char value, unsigned long port)
    +static void inline 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)
    +static void inline 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)
    +static unsigned long inline me4000_inl(unsigned long port)
    {
    unsigned long value;
    value = inl(port);
    @@ -319,7 +296,7 @@ static unsigned long me4000_inl(unsigned long port)
    return value;
    }

    -static unsigned char me4000_inb(unsigned long port)
    +static unsigned char inline me4000_inb(unsigned long port)
    {
    unsigned char value;
    value = inb(port);
    @@ -327,102 +304,102 @@ static unsigned char me4000_inb(unsigned long port)
    return value;
    }

    -struct pci_driver me4000_driver = {
    +static struct pci_driver me4000_driver = {
    .name = ME4000_NAME,
    .id_table = me4000_pci_table,
    .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,
    + .owner = THIS_MODULE,
    + .write = me4000_ao_write_sing,
    + .ioctl = me4000_ao_ioctl_sing,
    + .open = me4000_open,
    + .release = me4000_release,
    };

    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,
    + .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,
    + .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,
    + .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,
    + .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,
    + .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,
    + .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,
    + .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,
    + .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,
    - release:me4000_release,
    + .owner = THIS_MODULE,
    + .ioctl = me4000_cnt_ioctl,
    + .open = me4000_open,
    + .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,
    + .owner = THIS_MODULE,
    + .ioctl = me4000_ext_int_ioctl,
    + .open = me4000_open,
    + .release = me4000_release,
    + .fasync = me4000_ext_int_fasync,
    };

    static struct file_operations *me4000_ao_fops_array[] = {
    @@ -439,9 +416,9 @@ static struct file_operations *me4000_ai_fops_array[] = {
    &me4000_ai_fops_cont_et_chanlist, // work through one channel list by external trigger
    };

    -int __init me4000_init_module(void)
    +static int __init me4000_init_module(void)
    {
    - int result = 0;
    + int result;

    CALL_PDEBUG("init_module() is executed\n");

    @@ -533,26 +510,26 @@ int __init me4000_init_module(void)

    return 0;

    - INIT_ERROR_7:
    +INIT_ERROR_7:
    unregister_chrdev(me4000_ext_int_major_driver_no, ME4000_EXT_INT_NAME);

    - INIT_ERROR_6:
    +INIT_ERROR_6:
    unregister_chrdev(me4000_cnt_major_driver_no, ME4000_CNT_NAME);

    - INIT_ERROR_5:
    +INIT_ERROR_5:
    unregister_chrdev(me4000_dio_major_driver_no, ME4000_DIO_NAME);

    - INIT_ERROR_4:
    +INIT_ERROR_4:
    unregister_chrdev(me4000_ai_major_driver_no, ME4000_AI_NAME);

    - INIT_ERROR_3:
    +INIT_ERROR_3:
    unregister_chrdev(me4000_ao_major_driver_no, ME4000_AO_NAME);

    - INIT_ERROR_2:
    +INIT_ERROR_2:
    pci_unregister_driver(&me4000_driver);
    clear_board_info_list();

    - INIT_ERROR_1:
    +INIT_ERROR_1:
    return result;
    }

    @@ -562,18 +539,18 @@ 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;
    + struct me4000_info *board_info;
    + struct me4000_ao_context *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);
    + board_info = list_entry(board_p, struct me4000_info, 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);
    + list_entry(dac_p, struct me4000_ao_context, list);
    me4000_ao_reset(ao_context);
    free_irq(ao_context->irq, ao_context);
    if (ao_context->circ_buf.buf)
    @@ -600,14 +577,14 @@ static void clear_board_info_list(void)
    /* 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);
    + board_info = list_entry(board_p, struct me4000_info, list);
    pci_release_regions(board_info->pci_dev_p);
    list_del(board_p);
    kfree(board_info);
    }
    }

    -static int get_registers(struct pci_dev *dev, me4000_info_t * board_info)
    +static int get_registers(struct pci_dev *dev, struct me4000_info *board_info)
    {

    /*--------------------------- plx regbase ---------------------------------*/
    @@ -667,20 +644,20 @@ static int get_registers(struct pci_dev *dev, me4000_info_t * board_info)
    }

    static int init_board_info(struct pci_dev *pci_dev_p,
    - me4000_info_t * board_info)
    + struct me4000_info *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++) {
    + for (i = 0; i < ARRAY_SIZE(me4000_boards); i++) {
    if (me4000_boards[i].device_id == pci_dev_p->device) {
    board_info->board_p = &me4000_boards[i];
    break;
    }
    }
    - if (i == ME4000_BOARD_VERSIONS) {
    + if (i == ARRAY_SIZE(me4000_boards)) {
    printk(KERN_ERR
    "ME4000:init_board_info()evice ID not valid\n");
    return -ENODEV;
    @@ -755,21 +732,21 @@ static int init_board_info(struct pci_dev *pci_dev_p,
    return 0;
    }

    -static int alloc_ao_contexts(me4000_info_t * info)
    +static int alloc_ao_contexts(struct me4000_info *info)
    {
    int i;
    int err;
    - me4000_ao_context_t *ao_context;
    + struct me4000_ao_context *ao_context;

    for (i = 0; i < info->board_p->ao.count; i++) {
    - ao_context = kmalloc(sizeof(me4000_ao_context_t), GFP_KERNEL);
    + ao_context = kzalloc(sizeof(struct me4000_ao_context),
    + 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));

    spin_lock_init(&ao_context->use_lock);
    spin_lock_init(&ao_context->int_lock);
    @@ -780,15 +757,13 @@ static int alloc_ao_contexts(me4000_info_t * info)
    if (info->board_p->ao.fifo_count) {
    /* Allocate circular buffer */
    ao_context->circ_buf.buf =
    - kmalloc(ME4000_AO_BUFFER_SIZE, GFP_KERNEL);
    + kzalloc(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);

    /* Clear the circular buffer */
    ao_context->circ_buf.head = 0;
    @@ -872,9 +847,8 @@ static int alloc_ao_contexts(me4000_info_t * info)
    ME4000_NAME, ao_context);
    if (err) {
    printk(KERN_ERR
    - "alloc_ao_contexts():Can't get interrupt line");
    - if (ao_context->circ_buf.buf)
    - kfree(ao_context->circ_buf.buf);
    + "%s:Can't get interrupt line", __func__);
    + kfree(ao_context->circ_buf.buf);
    kfree(ao_context);
    release_ao_contexts(info);
    return -ENODEV;
    @@ -888,35 +862,34 @@ static int alloc_ao_contexts(me4000_info_t * info)
    return 0;
    }

    -static void release_ao_contexts(me4000_info_t * board_info)
    +static void release_ao_contexts(struct me4000_info *board_info)
    {
    struct list_head *dac_p;
    - me4000_ao_context_t *ao_context;
    + struct me4000_ao_context *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);
    + ao_context = list_entry(dac_p, struct me4000_ao_context, list);
    free_irq(ao_context->irq, ao_context);
    - if (ao_context->circ_buf.buf)
    - kfree(ao_context->circ_buf.buf);
    + kfree(ao_context->circ_buf.buf);
    list_del(dac_p);
    kfree(ao_context);
    }
    }

    -static int alloc_ai_context(me4000_info_t * info)
    +static int alloc_ai_context(struct me4000_info *info)
    {
    - me4000_ai_context_t *ai_context;
    + struct me4000_ai_context *ai_context;

    if (info->board_p->ai.count) {
    - ai_context = kmalloc(sizeof(me4000_ai_context_t), GFP_KERNEL);
    + ai_context = kzalloc(sizeof(struct me4000_ai_context),
    + 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));

    info->ai_context = ai_context;

    @@ -958,18 +931,18 @@ static int alloc_ai_context(me4000_info_t * info)
    return 0;
    }

    -static int alloc_dio_context(me4000_info_t * info)
    +static int alloc_dio_context(struct me4000_info *info)
    {
    - me4000_dio_context_t *dio_context;
    + struct me4000_dio_context *dio_context;

    if (info->board_p->dio.count) {
    - dio_context = kmalloc(sizeof(me4000_dio_context_t), GFP_KERNEL);
    + dio_context = kzalloc(sizeof(struct me4000_dio_context),
    + 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));

    info->dio_context = dio_context;

    @@ -995,18 +968,18 @@ static int alloc_dio_context(me4000_info_t * info)
    return 0;
    }

    -static int alloc_cnt_context(me4000_info_t * info)
    +static int alloc_cnt_context(struct me4000_info *info)
    {
    - me4000_cnt_context_t *cnt_context;
    + struct me4000_cnt_context *cnt_context;

    if (info->board_p->cnt.count) {
    - cnt_context = kmalloc(sizeof(me4000_cnt_context_t), GFP_KERNEL);
    + cnt_context = kzalloc(sizeof(struct me4000_cnt_context),
    + 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));

    info->cnt_context = cnt_context;

    @@ -1026,19 +999,18 @@ static int alloc_cnt_context(me4000_info_t * info)
    return 0;
    }

    -static int alloc_ext_int_context(me4000_info_t * info)
    +static int alloc_ext_int_context(struct me4000_info *info)
    {
    - me4000_ext_int_context_t *ext_int_context;
    + struct me4000_ext_int_context *ext_int_context;

    if (info->board_p->cnt.count) {
    ext_int_context =
    - kmalloc(sizeof(me4000_ext_int_context_t), GFP_KERNEL);
    + kzalloc(sizeof(struct me4000_ext_int_context), 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));

    info->ext_int_context = ext_int_context;

    @@ -1060,19 +1032,18 @@ static int alloc_ext_int_context(me4000_info_t * info)
    static int me4000_probe(struct pci_dev *dev, const struct pci_device_id *id)
    {
    int result = 0;
    - me4000_info_t *board_info;
    + struct me4000_info *board_info;

    CALL_PDEBUG("me4000_probe() is executed\n");

    /* Allocate structure for board context */
    - board_info = kmalloc(sizeof(me4000_info_t), GFP_KERNEL);
    + board_info = kzalloc(sizeof(struct me4000_info), 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);
    @@ -1080,70 +1051,70 @@ static int me4000_probe(struct pci_dev *dev, const struct pci_device_id *id)
    /* Get the PCI base registers */
    result = get_registers(dev, board_info);
    if (result) {
    - printk(KERN_ERR "me4000_probe():Cannot get registers\n");
    + printk(KERN_ERR "%s:Cannot get registers\n", __func__);
    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");
    + printk(KERN_ERR "%s:Cannot enable PCI device\n", __func__);
    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");
    + printk(KERN_ERR "%s:Cannot request I/O regions\n", __func__);
    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");
    + printk(KERN_ERR "%s:Cannot init baord info\n", __func__);
    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");
    + printk(KERN_ERR "%s:Can't download firmware\n", __func__);
    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");
    + printk(KERN_ERR "%s :Can't reset board\n", __func__);
    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");
    + printk(KERN_ERR "%s:Cannot allocate ao contexts\n", __func__);
    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");
    + printk(KERN_ERR "%s:Cannot allocate ai context\n", __func__);
    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");
    + printk(KERN_ERR "%s:Cannot allocate dio context\n", __func__);
    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");
    + printk(KERN_ERR "%s:Cannot allocate cnt context\n", __func__);
    goto PROBE_ERROR_6;
    }

    @@ -1151,36 +1122,36 @@ static int me4000_probe(struct pci_dev *dev, const struct pci_device_id *id)
    result = alloc_ext_int_context(board_info);
    if (result) {
    printk(KERN_ERR
    - "me4000_probe():Cannot allocate ext_int context\n");
    + "%s:Cannot allocate ext_int context\n", __func__);
    goto PROBE_ERROR_7;
    }

    return 0;

    - PROBE_ERROR_7:
    +PROBE_ERROR_7:
    kfree(board_info->cnt_context);

    - PROBE_ERROR_6:
    +PROBE_ERROR_6:
    kfree(board_info->dio_context);

    - PROBE_ERROR_5:
    +PROBE_ERROR_5:
    kfree(board_info->ai_context);

    - PROBE_ERROR_4:
    +PROBE_ERROR_4:
    release_ao_contexts(board_info);

    - PROBE_ERROR_3:
    +PROBE_ERROR_3:
    pci_release_regions(dev);

    - PROBE_ERROR_2:
    +PROBE_ERROR_2:
    list_del(&board_info->list);
    kfree(board_info);

    - PROBE_ERROR_1:
    +PROBE_ERROR_1:
    return result;
    }

    -static int me4000_xilinx_download(me4000_info_t * info)
    +static int me4000_xilinx_download(struct me4000_info *info)
    {
    int size = 0;
    u32 value = 0;
    @@ -1211,7 +1182,7 @@ static int me4000_xilinx_download(me4000_info_t * info)
    /* 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");
    + printk(KERN_ERR "%s:Can't init Xilinx\n", __func__);
    return -EIO;
    }

    @@ -1232,7 +1203,7 @@ static int me4000_xilinx_download(me4000_info_t * info)
    /* 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",
    + "%s:Xilinx is still busy (idx = %d)\n", __func__,
    idx);
    return -EIO;
    }
    @@ -1246,9 +1217,9 @@ static int me4000_xilinx_download(me4000_info_t * info)
    PDEBUG("me4000_xilinx_download()ownload was successful\n");
    } else {
    printk(KERN_ERR
    - "ME4000:me4000_xilinx_download()ONE flag is not set\n");
    + "ME4000:%sONE flag is not set\n", __func__);
    printk(KERN_ERR
    - "ME4000:me4000_xilinx_download()ownload not succesful\n");
    + "ME4000:%sownload not succesful\n", __func__);
    return -EIO;
    }

    @@ -1260,7 +1231,7 @@ static int me4000_xilinx_download(me4000_info_t * info)
    return 0;
    }

    -static int me4000_reset_board(me4000_info_t * info)
    +static int me4000_reset_board(struct me4000_info *info)
    {
    unsigned long icr;

    @@ -1314,12 +1285,12 @@ static int me4000_open(struct inode *inode_p, struct file *file_p)
    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;
    + struct me4000_info *board_info = NULL;
    + struct me4000_ao_context *ao_context = NULL;
    + struct me4000_ai_context *ai_context = NULL;
    + struct me4000_dio_context *dio_context = NULL;
    + struct me4000_cnt_context *cnt_context = NULL;
    + struct me4000_ext_int_context *ext_int_context = NULL;

    CALL_PDEBUG("me4000_open() is executed\n");

    @@ -1335,7 +1306,7 @@ static int me4000_open(struct inode *inode_p, struct file *file_p)
    /* 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);
    + board_info = list_entry(ptr, struct me4000_info, list);
    if (i == board)
    break;
    }
    @@ -1351,7 +1322,8 @@ static int me4000_open(struct inode *inode_p, struct file *file_p)
    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);
    + ao_context = list_entry(ptr, struct me4000_ao_context,
    + list);
    if (i == dev)
    break;
    }
    @@ -1415,7 +1387,7 @@ static int me4000_open(struct inode *inode_p, struct file *file_p)
    /* 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);
    + board_info = list_entry(ptr, struct me4000_info, list);
    if (i == board)
    break;
    }
    @@ -1469,7 +1441,7 @@ static int me4000_open(struct inode *inode_p, struct file *file_p)
    /* 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);
    + board_info = list_entry(ptr, struct me4000_info, list);
    if (board_info->board_count == board)
    break;
    }
    @@ -1514,7 +1486,7 @@ static int me4000_open(struct inode *inode_p, struct file *file_p)
    /* 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);
    + board_info = list_entry(ptr, struct me4000_info, list);
    if (board_info->board_count == board)
    break;
    }
    @@ -1557,7 +1529,7 @@ static int me4000_open(struct inode *inode_p, struct file *file_p)
    /* 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);
    + board_info = list_entry(ptr, struct me4000_info, list);
    if (board_info->board_count == board)
    break;
    }
    @@ -1613,11 +1585,11 @@ static int me4000_open(struct inode *inode_p, struct file *file_p)

    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;
    + struct me4000_ao_context *ao_context;
    + struct me4000_ai_context *ai_context;
    + struct me4000_dio_context *dio_context;
    + struct me4000_cnt_context *cnt_context;
    + struct me4000_ext_int_context *ext_int_context;

    CALL_PDEBUG("me4000_release() is executed\n");

    @@ -1677,7 +1649,7 @@ static int me4000_release(struct inode *inode_p, struct file *file_p)

    /*------------------------------- Analog output stuff --------------------------------------*/

    -static int me4000_ao_prepare(me4000_ao_context_t * ao_context)
    +static int me4000_ao_prepare(struct me4000_ao_context *ao_context)
    {
    unsigned long flags;

    @@ -1756,7 +1728,7 @@ static int me4000_ao_prepare(me4000_ao_context_t * ao_context)
    return 0;
    }

    -static int me4000_ao_reset(me4000_ao_context_t * ao_context)
    +static int me4000_ao_reset(struct me4000_ao_context *ao_context)
    {
    u32 tmp;
    wait_queue_head_t queue;
    @@ -1777,9 +1749,10 @@ static int me4000_ao_reset(me4000_ao_context_t * ao_context)
    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);
    - }
    + wait_event_timeout(queue,
    + (inl(ao_context->status_reg) &
    + ME4000_AO_STATUS_BIT_FSM) == 0,
    + 1);

    /* Set to transparent mode */
    me4000_ao_simultaneous_disable(ao_context);
    @@ -1812,9 +1785,10 @@ static int me4000_ao_reset(me4000_ao_context_t * ao_context)
    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);
    - }
    + wait_event_timeout(queue,
    + (inl(ao_context->status_reg) &
    + ME4000_AO_STATUS_BIT_FSM) == 0,
    + 1);

    /* Clear the circular buffer */
    ao_context->circ_buf.head = 0;
    @@ -1853,9 +1827,9 @@ static int me4000_ao_reset(me4000_ao_context_t * ao_context)
    }

    static ssize_t me4000_ao_write_sing(struct file *filep, const char *buff,
    - size_t cnt, loff_t * offp)
    + size_t cnt, loff_t *offp)
    {
    - me4000_ao_context_t *ao_context = filep->private_data;
    + struct me4000_ao_context *ao_context = filep->private_data;
    u32 value;
    const u16 *buffer = (const u16 *)buff;

    @@ -1863,13 +1837,13 @@ static ssize_t me4000_ao_write_sing(struct file *filep, const char *buff,

    if (cnt != 2) {
    printk(KERN_ERR
    - "me4000_ao_write_sing():Write count is not 2\n");
    + "%s:Write count is not 2\n", __func__);
    return -EINVAL;
    }

    if (get_user(value, buffer)) {
    printk(KERN_ERR
    - "me4000_ao_write_sing():Cannot copy data from user\n");
    + "%s:Cannot copy data from user\n", __func__);
    return -EFAULT;
    }

    @@ -1879,9 +1853,9 @@ static ssize_t me4000_ao_write_sing(struct file *filep, const char *buff,
    }

    static ssize_t me4000_ao_write_wrap(struct file *filep, const char *buff,
    - size_t cnt, loff_t * offp)
    + size_t cnt, loff_t *offp)
    {
    - me4000_ao_context_t *ao_context = filep->private_data;
    + struct me4000_ao_context *ao_context = filep->private_data;
    size_t i;
    u32 value;
    u32 tmp;
    @@ -1893,13 +1867,13 @@ static ssize_t me4000_ao_write_wrap(struct file *filep, const char *buff,
    /* 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");
    + "%s:There is already a conversion running\n", __func__);
    return -EBUSY;
    }

    if (count > ME4000_AO_FIFO_COUNT) {
    printk(KERN_ERR
    - "me4000_ao_write_wrap():Can't load more than %d values\n",
    + "%s:Can't load more than %d values\n", __func__,
    ME4000_AO_FIFO_COUNT);
    return -ENOSPC;
    }
    @@ -1914,7 +1888,7 @@ static ssize_t me4000_ao_write_wrap(struct file *filep, const char *buff,
    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");
    + "%s:Cannot copy data from user\n", __func__);
    return -EFAULT;
    }
    if (((ao_context->fifo_reg & 0xFF) == ME4000_AO_01_FIFO_REG)
    @@ -1928,9 +1902,9 @@ static ssize_t me4000_ao_write_wrap(struct file *filep, const char *buff,
    }

    static ssize_t me4000_ao_write_cont(struct file *filep, const char *buff,
    - size_t cnt, loff_t * offp)
    + size_t cnt, loff_t *offp)
    {
    - me4000_ao_context_t *ao_context = filep->private_data;
    + struct me4000_ao_context *ao_context = filep->private_data;
    const u16 *buffer = (const u16 *)buff;
    size_t count = cnt / 2;
    unsigned long flags;
    @@ -2154,9 +2128,9 @@ static ssize_t me4000_ao_write_cont(struct file *filep, const char *buff,
    return 2 * ret;
    }

    -static unsigned int me4000_ao_poll_cont(struct file *file_p, poll_table * wait)
    +static unsigned int me4000_ao_poll_cont(struct file *file_p, poll_table *wait)
    {
    - me4000_ao_context_t *ao_context;
    + struct me4000_ao_context *ao_context;
    unsigned long mask = 0;

    CALL_PDEBUG("me4000_ao_poll_cont() is executed\n");
    @@ -2177,7 +2151,7 @@ static unsigned int me4000_ao_poll_cont(struct file *file_p, poll_table * wait)
    static int me4000_ao_fsync_cont(struct file *file_p, struct dentry *dentry_p,
    int datasync)
    {
    - me4000_ao_context_t *ao_context;
    + struct me4000_ao_context *ao_context;
    wait_queue_head_t queue;

    CALL_PDEBUG("me4000_ao_fsync_cont() is executed\n");
    @@ -2187,15 +2161,19 @@ static int me4000_ao_fsync_cont(struct file *file_p, struct dentry *dentry_p,

    while (inl(ao_context->status_reg) & ME4000_AO_STATUS_BIT_FSM) {
    interruptible_sleep_on_timeout(&queue, 1);
    + wait_event_interruptible_timeout(queue,
    + !(inl(ao_context->status_reg) & ME4000_AO_STATUS_BIT_FSM),
    + 1);
    if (ao_context->pipe_flag) {
    printk(KERN_ERR
    - "me4000_ao_fsync_cont():Broken pipe detected\n");
    + "%s:Broken pipe detected\n", __func__);
    return -EPIPE;
    }

    if (signal_pending(current)) {
    printk(KERN_ERR
    - "me4000_ao_fsync_cont():Wait on state machine interrupted\n");
    + "%s:Wait on state machine interrupted\n",
    + __func__);
    return -EINTR;
    }
    }
    @@ -2206,7 +2184,7 @@ static int me4000_ao_fsync_cont(struct file *file_p, struct dentry *dentry_p,
    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;
    + struct me4000_ao_context *ao_context;

    CALL_PDEBUG("me4000_ao_ioctl_sing() is executed\n");

    @@ -2229,7 +2207,7 @@ static int me4000_ao_ioctl_sing(struct inode *inode_p, struct file *file_p,
    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,
    + return me4000_get_user_info((struct me4000_user_info *)arg,
    ao_context->board_info);
    case ME4000_AO_SIMULTANEOUS_EX_TRIG:
    return me4000_ao_simultaneous_ex_trig(ao_context);
    @@ -2239,8 +2217,9 @@ static int me4000_ao_ioctl_sing(struct inode *inode_p, struct file *file_p,
    return me4000_ao_simultaneous_disable(ao_context);
    case ME4000_AO_SIMULTANEOUS_UPDATE:
    return
    - me4000_ao_simultaneous_update((me4000_ao_channel_l ist_t *)
    - arg, ao_context);
    + me4000_ao_simultaneous_update(
    + (struct me4000_ao_channel_list *)arg,
    + ao_context);
    case ME4000_AO_EX_TRIG_TIMEOUT:
    return me4000_ao_ex_trig_timeout((unsigned long *)arg,
    ao_context);
    @@ -2258,7 +2237,7 @@ static int me4000_ao_ioctl_sing(struct inode *inode_p, struct file *file_p,
    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;
    + struct me4000_ao_context *ao_context;

    CALL_PDEBUG("me4000_ao_ioctl_wrap() is executed\n");

    @@ -2287,7 +2266,7 @@ static int me4000_ao_ioctl_wrap(struct inode *inode_p, struct file *file_p,
    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,
    + return me4000_get_user_info((struct me4000_user_info *)arg,
    ao_context->board_info);
    case ME4000_AO_FSM_STATE:
    return me4000_ao_fsm_state((int *)arg, ao_context);
    @@ -2310,7 +2289,7 @@ static int me4000_ao_ioctl_wrap(struct inode *inode_p, struct file *file_p,
    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;
    + struct me4000_ao_context *ao_context;

    CALL_PDEBUG("me4000_ao_ioctl_cont() is executed\n");

    @@ -2345,7 +2324,7 @@ static int me4000_ao_ioctl_cont(struct inode *inode_p, struct file *file_p,
    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,
    + return me4000_get_user_info((struct me4000_user_info *)arg,
    ao_context->board_info);
    case ME4000_AO_SYNCHRONOUS_EX_TRIG:
    return me4000_ao_synchronous_ex_trig(ao_context);
    @@ -2362,7 +2341,8 @@ static int me4000_ao_ioctl_cont(struct inode *inode_p, struct file *file_p,
    return 0;
    }

    -static int me4000_ao_start(unsigned long *arg, me4000_ao_context_t * ao_context)
    +static int me4000_ao_start(unsigned long *arg,
    + struct me4000_ao_context *ao_context)
    {
    u32 tmp;
    wait_queue_head_t queue;
    @@ -2412,7 +2392,7 @@ static int me4000_ao_start(unsigned long *arg, me4000_ao_context_t * ao_context)
    return 0;
    }

    -static int me4000_ao_stop(me4000_ao_context_t * ao_context)
    +static int me4000_ao_stop(struct me4000_ao_context *ao_context)
    {
    u32 tmp;
    wait_queue_head_t queue;
    @@ -2445,7 +2425,7 @@ static int me4000_ao_stop(me4000_ao_context_t * ao_context)
    return 0;
    }

    -static int me4000_ao_immediate_stop(me4000_ao_context_t * ao_context)
    +static int me4000_ao_immediate_stop(struct me4000_ao_context *ao_context)
    {
    u32 tmp;
    wait_queue_head_t queue;
    @@ -2477,8 +2457,8 @@ static int me4000_ao_immediate_stop(me4000_ao_context_t * ao_context)
    return 0;
    }

    -static int me4000_ao_timer_set_divisor(u32 * arg,
    - me4000_ao_context_t * ao_context)
    +static int me4000_ao_timer_set_divisor(u32 *arg,
    + struct me4000_ao_context *ao_context)
    {
    u32 divisor;
    u32 tmp;
    @@ -2518,7 +2498,7 @@ static int me4000_ao_timer_set_divisor(u32 * arg,
    }

    static int me4000_ao_ex_trig_set_edge(int *arg,
    - me4000_ao_context_t * ao_context)
    + struct me4000_ao_context *ao_context)
    {
    int mode;
    u32 tmp;
    @@ -2569,7 +2549,7 @@ static int me4000_ao_ex_trig_set_edge(int *arg,
    return 0;
    }

    -static int me4000_ao_ex_trig_enable(me4000_ao_context_t * ao_context)
    +static int me4000_ao_ex_trig_enable(struct me4000_ao_context *ao_context)
    {
    u32 tmp;
    unsigned long flags;
    @@ -2593,7 +2573,7 @@ static int me4000_ao_ex_trig_enable(me4000_ao_context_t * ao_context)
    return 0;
    }

    -static int me4000_ao_ex_trig_disable(me4000_ao_context_t * ao_context)
    +static int me4000_ao_ex_trig_disable(struct me4000_ao_context *ao_context)
    {
    u32 tmp;
    unsigned long flags;
    @@ -2617,7 +2597,7 @@ static int me4000_ao_ex_trig_disable(me4000_ao_context_t * ao_context)
    return 0;
    }

    -static int me4000_ao_simultaneous_disable(me4000_ao_context_t * ao_context)
    +static int me4000_ao_simultaneous_disable(struct me4000_ao_context *ao_context)
    {
    u32 tmp;

    @@ -2643,7 +2623,7 @@ static int me4000_ao_simultaneous_disable(me4000_ao_context_t * ao_context)
    return 0;
    }

    -static int me4000_ao_simultaneous_ex_trig(me4000_ao_context_t * ao_context)
    +static int me4000_ao_simultaneous_ex_trig(struct me4000_ao_context *ao_context)
    {
    u32 tmp;

    @@ -2659,7 +2639,7 @@ static int me4000_ao_simultaneous_ex_trig(me4000_ao_context_t * ao_context)
    return 0;
    }

    -static int me4000_ao_simultaneous_sw(me4000_ao_context_t * ao_context)
    +static int me4000_ao_simultaneous_sw(struct me4000_ao_context *ao_context)
    {
    u32 tmp;

    @@ -2675,13 +2655,13 @@ static int me4000_ao_simultaneous_sw(me4000_ao_context_t * ao_context)
    return 0;
    }

    -static int me4000_ao_preload(me4000_ao_context_t * ao_context)
    +static int me4000_ao_preload(struct me4000_ao_context *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)
    +static int me4000_ao_preload_update(struct me4000_ao_context *ao_context)
    {
    u32 tmp;
    u32 ctrl;
    @@ -2705,10 +2685,12 @@ static int me4000_ao_preload_update(me4000_ao_context_t * ao_context)
    if (!
    (tmp &
    (0x1 <<
    - (((me4000_ao_context_t *) entry)->index + 16)))) {
    + (((struct me4000_ao_context *)entry)->index
    + + 16)))) {
    tmp &=
    ~(0x1 <<
    - (((me4000_ao_context_t *) entry)->index));
    + (((struct me4000_ao_context *)entry)->
    + index));
    }
    }
    }
    @@ -2718,18 +2700,19 @@ static int me4000_ao_preload_update(me4000_ao_context_t * ao_context)
    return 0;
    }

    -static int me4000_ao_simultaneous_update(me4000_ao_channel_li st_t * arg,
    - me4000_ao_context_t * ao_context)
    +static int me4000_ao_simultaneous_update(struct me4000_ao_channel_list *arg,
    + struct me4000_ao_context *ao_context)
    {
    int err;
    int i;
    u32 tmp;
    - me4000_ao_channel_list_t channels;
    + struct me4000_ao_channel_list 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));
    + err = copy_from_user(&channels, arg,
    + sizeof(struct me4000_ao_channel_list));
    if (err) {
    printk(KERN_ERR
    "ME4000:me4000_ao_simultaneous_update():Can't copy command\n");
    @@ -2737,13 +2720,12 @@ static int me4000_ao_simultaneous_update(me4000_ao_channel_li st_t * arg,
    }

    channels.list =
    - kmalloc(sizeof(unsigned long) * channels.count, GFP_KERNEL);
    + kzalloc(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);

    /* Copy channel list from user */
    err =
    @@ -2777,7 +2759,7 @@ static int me4000_ao_simultaneous_update(me4000_ao_channel_li st_t * arg,
    return 0;
    }

    -static int me4000_ao_synchronous_ex_trig(me4000_ao_context_t * ao_context)
    +static int me4000_ao_synchronous_ex_trig(struct me4000_ao_context *ao_context)
    {
    u32 tmp;
    unsigned long flags;
    @@ -2813,7 +2795,7 @@ static int me4000_ao_synchronous_ex_trig(me4000_ao_context_t * ao_context)
    return 0;
    }

    -static int me4000_ao_synchronous_sw(me4000_ao_context_t * ao_context)
    +static int me4000_ao_synchronous_sw(struct me4000_ao_context *ao_context)
    {
    u32 tmp;
    unsigned long flags;
    @@ -2848,13 +2830,13 @@ static int me4000_ao_synchronous_sw(me4000_ao_context_t * ao_context)
    return 0;
    }

    -static int me4000_ao_synchronous_disable(me4000_ao_context_t * ao_context)
    +static int me4000_ao_synchronous_disable(struct me4000_ao_context *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)
    + struct me4000_ao_context *ao_context)
    {
    unsigned long c;
    int err;
    @@ -2864,7 +2846,7 @@ static int me4000_ao_get_free_buffer(unsigned long *arg,
    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");
    + "%s:Can't copy to user space\n", __func__);
    return -EFAULT;
    }

    @@ -2872,7 +2854,7 @@ static int me4000_ao_get_free_buffer(unsigned long *arg,
    }

    static int me4000_ao_ex_trig_timeout(unsigned long *arg,
    - me4000_ao_context_t * ao_context)
    + struct me4000_ao_context *ao_context)
    {
    u32 tmp;
    wait_queue_head_t queue;
    @@ -2928,7 +2910,7 @@ static int me4000_ao_ex_trig_timeout(unsigned long *arg,
    return 0;
    }

    -static int me4000_ao_enable_do(me4000_ao_context_t * ao_context)
    +static int me4000_ao_enable_do(struct me4000_ao_context *ao_context)
    {
    u32 tmp;
    unsigned long flags;
    @@ -2959,7 +2941,7 @@ static int me4000_ao_enable_do(me4000_ao_context_t * ao_context)
    return 0;
    }

    -static int me4000_ao_disable_do(me4000_ao_context_t * ao_context)
    +static int me4000_ao_disable_do(struct me4000_ao_context *ao_context)
    {
    u32 tmp;
    unsigned long flags;
    @@ -2989,7 +2971,7 @@ static int me4000_ao_disable_do(me4000_ao_context_t * ao_context)
    return 0;
    }

    -static int me4000_ao_fsm_state(int *arg, me4000_ao_context_t * ao_context)
    +static int me4000_ao_fsm_state(int *arg, struct me4000_ao_context *ao_context)
    {
    unsigned long tmp;

    @@ -3012,9 +2994,9 @@ static int me4000_ao_fsm_state(int *arg, me4000_ao_context_t * ao_context)
    return 0;
    }

    -/*------------------------------- Analog input stuff --------------------------------------*/
    +/*------------------------- Analog input stuff -------------------------------*/

    -static int me4000_ai_prepare(me4000_ai_context_t * ai_context)
    +static int me4000_ai_prepare(struct me4000_ai_context *ai_context)
    {
    wait_queue_head_t queue;
    int err;
    @@ -3057,14 +3039,13 @@ static int me4000_ai_prepare(me4000_ai_context_t * ai_context)

    /* Allocate circular buffer */
    ai_context->circ_buf.buf =
    - kmalloc(ME4000_AI_BUFFER_SIZE, GFP_KERNEL);
    + kzalloc(ME4000_AI_BUFFER_SIZE, GFP_KERNEL);
    if (!ai_context->circ_buf.buf) {
    printk(KERN_ERR
    "ME4000:me4000_ai_prepare():Can't get circular buffer\n");
    free_irq(ai_context->irq, ai_context);
    return -ENOMEM;
    }
    - memset(ai_context->circ_buf.buf, 0, ME4000_AI_BUFFER_SIZE);

    /* Clear the circular buffer */
    ai_context->circ_buf.head = 0;
    @@ -3074,7 +3055,7 @@ static int me4000_ai_prepare(me4000_ai_context_t * ai_context)
    return 0;
    }

    -static int me4000_ai_reset(me4000_ai_context_t * ai_context)
    +static int me4000_ai_reset(struct me4000_ai_context *ai_context)
    {
    wait_queue_head_t queue;
    u32 tmp;
    @@ -3139,7 +3120,7 @@ static int me4000_ai_reset(me4000_ai_context_t * ai_context)
    static int me4000_ai_ioctl_sing(struct inode *inode_p, struct file *file_p,
    unsigned int service, unsigned long arg)
    {
    - me4000_ai_context_t *ai_context;
    + struct me4000_ai_context *ai_context;

    CALL_PDEBUG("me4000_ai_ioctl_sing() is executed\n");

    @@ -3157,16 +3138,17 @@ static int me4000_ai_ioctl_sing(struct inode *inode_p, struct file *file_p,

    switch (service) {
    case ME4000_AI_SINGLE:
    - return me4000_ai_single((me4000_ai_single_t *) arg, ai_context);
    + return me4000_ai_single((struct me4000_ai_single *)arg,
    + ai_context);
    case ME4000_AI_EX_TRIG_ENABLE:
    return me4000_ai_ex_trig_enable(ai_context);
    case ME4000_AI_EX_TRIG_DISABLE:
    return me4000_ai_ex_trig_disable(ai_context);
    case ME4000_AI_EX_TRIG_SETUP:
    - return me4000_ai_ex_trig_setup((me4000_ai_trigger_t *) arg,
    + return me4000_ai_ex_trig_setup((struct me4000_ai_trigger *)arg,
    ai_context);
    case ME4000_GET_USER_INFO:
    - return me4000_get_user_info((me4000_user_info_t *) arg,
    + return me4000_get_user_info((struct me4000_user_info *)arg,
    ai_context->board_info);
    case ME4000_AI_OFFSET_ENABLE:
    return me4000_ai_offset_enable(ai_context);
    @@ -3177,9 +3159,11 @@ static int me4000_ai_ioctl_sing(struct inode *inode_p, struct file *file_p,
    case ME4000_AI_FULLSCALE_DISABLE:
    return me4000_ai_fullscale_disable(ai_context);
    case ME4000_AI_EEPROM_READ:
    - return me4000_eeprom_read((me4000_eeprom_t *) arg, ai_context);
    + return me4000_eeprom_read((struct me4000_eeprom *)arg,
    + ai_context);
    case ME4000_AI_EEPROM_WRITE:
    - return me4000_eeprom_write((me4000_eeprom_t *) arg, ai_context);
    + return me4000_eeprom_write((struct me4000_eeprom *)arg,
    + ai_context);
    default:
    printk(KERN_ERR
    "me4000_ai_ioctl_sing():Invalid service number\n");
    @@ -3188,10 +3172,10 @@ static int me4000_ai_ioctl_sing(struct inode *inode_p, struct file *file_p,
    return 0;
    }

    -static int me4000_ai_single(me4000_ai_single_t * arg,
    - me4000_ai_context_t * ai_context)
    +static int me4000_ai_single(struct me4000_ai_single *arg,
    + struct me4000_ai_context *ai_context)
    {
    - me4000_ai_single_t cmd;
    + struct me4000_ai_single cmd;
    int err;
    u32 tmp;
    wait_queue_head_t queue;
    @@ -3202,7 +3186,7 @@ static int me4000_ai_single(me4000_ai_single_t * arg,
    init_waitqueue_head(&queue);

    /* Copy data from user */
    - err = copy_from_user(&cmd, arg, sizeof(me4000_ai_single_t));
    + err = copy_from_user(&cmd, arg, sizeof(struct me4000_ai_single));
    if (err) {
    printk(KERN_ERR
    "ME4000:me4000_ai_single():Can't copy from user space\n");
    @@ -3301,7 +3285,7 @@ static int me4000_ai_single(me4000_ai_single_t * arg,
    cmd.value = me4000_inl(ai_context->data_reg) & 0xFFFF;

    /* Copy result back to user */
    - err = copy_to_user(arg, &cmd, sizeof(me4000_ai_single_t));
    + err = copy_to_user(arg, &cmd, sizeof(struct me4000_ai_single));
    if (err) {
    printk(KERN_ERR
    "ME4000:me4000_ai_single():Can't copy to user space\n");
    @@ -3314,7 +3298,7 @@ static int me4000_ai_single(me4000_ai_single_t * arg,
    static int me4000_ai_ioctl_sw(struct inode *inode_p, struct file *file_p,
    unsigned int service, unsigned long arg)
    {
    - me4000_ai_context_t *ai_context;
    + struct me4000_ai_context *ai_context;

    CALL_PDEBUG("me4000_ai_ioctl_sw() is executed\n");

    @@ -3332,9 +3316,11 @@ static int me4000_ai_ioctl_sw(struct inode *inode_p, struct file *file_p,

    switch (service) {
    case ME4000_AI_SC_SETUP:
    - return me4000_ai_sc_setup((me4000_ai_sc_t *) arg, ai_context);
    + return me4000_ai_sc_setup((struct me4000_ai_sc *)arg,
    + ai_context);
    case ME4000_AI_CONFIG:
    - return me4000_ai_config((me4000_ai_config_t *) arg, ai_context);
    + return me4000_ai_config((struct me4000_ai_config *)arg,
    + ai_context);
    case ME4000_AI_START:
    return me4000_ai_start(ai_context);
    case ME4000_AI_STOP:
    @@ -3344,19 +3330,20 @@ static int me4000_ai_ioctl_sw(struct inode *inode_p, struct file *file_p,
    case ME4000_AI_FSM_STATE:
    return me4000_ai_fsm_state((int *)arg, ai_context);
    case ME4000_GET_USER_INFO:
    - return me4000_get_user_info((me4000_user_info_t *) arg,
    + return me4000_get_user_info((struct me4000_user_info *)arg,
    ai_context->board_info);
    case ME4000_AI_EEPROM_READ:
    - return me4000_eeprom_read((me4000_eeprom_t *) arg, ai_context);
    + return me4000_eeprom_read((struct me4000_eeprom *)arg,
    + ai_context);
    case ME4000_AI_EEPROM_WRITE:
    - return me4000_eeprom_write((me4000_eeprom_t *) arg, ai_context);
    + return me4000_eeprom_write((struct me4000_eeprom *)arg,
    + ai_context);
    case ME4000_AI_GET_COUNT_BUFFER:
    return me4000_ai_get_count_buffer((unsigned long *)arg,
    ai_context);
    default:
    printk(KERN_ERR
    - "ME4000:me4000_ai_ioctl_sw():Invalid service number %d\n",
    - service);
    + "%s:Invalid service number %d\n", __func__, service);
    return -ENOTTY;
    }
    return 0;
    @@ -3365,7 +3352,7 @@ static int me4000_ai_ioctl_sw(struct inode *inode_p, struct file *file_p,
    static int me4000_ai_ioctl_ext(struct inode *inode_p, struct file *file_p,
    unsigned int service, unsigned long arg)
    {
    - me4000_ai_context_t *ai_context;
    + struct me4000_ai_context *ai_context;

    CALL_PDEBUG("me4000_ai_ioctl_ext() is executed\n");

    @@ -3383,9 +3370,11 @@ static int me4000_ai_ioctl_ext(struct inode *inode_p, struct file *file_p,

    switch (service) {
    case ME4000_AI_SC_SETUP:
    - return me4000_ai_sc_setup((me4000_ai_sc_t *) arg, ai_context);
    + return me4000_ai_sc_setup((struct me4000_ai_sc *)arg,
    + ai_context);
    case ME4000_AI_CONFIG:
    - return me4000_ai_config((me4000_ai_config_t *) arg, ai_context);
    + return me4000_ai_config((struct me4000_ai_config *)arg,
    + ai_context);
    case ME4000_AI_START:
    return me4000_ai_start_ex((unsigned long *)arg, ai_context);
    case ME4000_AI_STOP:
    @@ -3397,20 +3386,19 @@ static int me4000_ai_ioctl_ext(struct inode *inode_p, struct file *file_p,
    case ME4000_AI_EX_TRIG_DISABLE:
    return me4000_ai_ex_trig_disable(ai_context);
    case ME4000_AI_EX_TRIG_SETUP:
    - return me4000_ai_ex_trig_setup((me4000_ai_trigger_t *) arg,
    + return me4000_ai_ex_trig_setup((struct me4000_ai_trigger *)arg,
    ai_context);
    case ME4000_AI_FSM_STATE:
    return me4000_ai_fsm_state((int *)arg, ai_context);
    case ME4000_GET_USER_INFO:
    - return me4000_get_user_info((me4000_user_info_t *) arg,
    + return me4000_get_user_info((struct me4000_user_info *)arg,
    ai_context->board_info);
    case ME4000_AI_GET_COUNT_BUFFER:
    return me4000_ai_get_count_buffer((unsigned long *)arg,
    ai_context);
    default:
    printk(KERN_ERR
    - "ME4000:me4000_ai_ioctl_ext():Invalid service number %d\n",
    - service);
    + "%s:Invalid service number %d\n", __func__ , service);
    return -ENOTTY;
    }
    return 0;
    @@ -3418,7 +3406,7 @@ static int me4000_ai_ioctl_ext(struct inode *inode_p, struct file *file_p,

    static int me4000_ai_fasync(int fd, struct file *file_p, int mode)
    {
    - me4000_ai_context_t *ai_context;
    + struct me4000_ai_context *ai_context;

    CALL_PDEBUG("me4000_ao_fasync_cont() is executed\n");

    @@ -3426,10 +3414,10 @@ static int me4000_ai_fasync(int fd, struct file *file_p, int mode)
    return fasync_helper(fd, file_p, mode, &ai_context->fasync_p);
    }

    -static int me4000_ai_config(me4000_ai_config_t * arg,
    - me4000_ai_context_t * ai_context)
    +static int me4000_ai_config(struct me4000_ai_config *arg,
    + struct me4000_ai_context *ai_context)
    {
    - me4000_ai_config_t cmd;
    + struct me4000_ai_config cmd;
    u32 *list = NULL;
    u32 mode;
    int i;
    @@ -3451,7 +3439,7 @@ static int me4000_ai_config(me4000_ai_config_t * arg,
    }

    /* Copy data from user */
    - err = copy_from_user(&cmd, arg, sizeof(me4000_ai_config_t));
    + err = copy_from_user(&cmd, arg, sizeof(struct me4000_ai_config));
    if (err) {
    printk(KERN_ERR
    "ME4000:me4000_ai_config():Can't copy from user space\n");
    @@ -3671,7 +3659,7 @@ static int me4000_ai_config(me4000_ai_config_t * arg,

    return 0;

    - AI_CONFIG_ERR:
    +AI_CONFIG_ERR:

    /* Reset the timers */
    ai_context->chan_timer = 66;
    @@ -3699,7 +3687,7 @@ static int me4000_ai_config(me4000_ai_config_t * arg,

    }

    -static int ai_common_start(me4000_ai_context_t * ai_context)
    +static int ai_common_start(struct me4000_ai_context *ai_context)
    {
    u32 tmp;
    CALL_PDEBUG("ai_common_start() is executed\n");
    @@ -3762,7 +3750,7 @@ static int ai_common_start(me4000_ai_context_t * ai_context)
    return 0;
    }

    -static int me4000_ai_start(me4000_ai_context_t * ai_context)
    +static int me4000_ai_start(struct me4000_ai_context *ai_context)
    {
    int err;
    CALL_PDEBUG("me4000_ai_start() is executed\n");
    @@ -3779,7 +3767,7 @@ static int me4000_ai_start(me4000_ai_context_t * ai_context)
    }

    static int me4000_ai_start_ex(unsigned long *arg,
    - me4000_ai_context_t * ai_context)
    + struct me4000_ai_context *ai_context)
    {
    int err;
    wait_queue_head_t queue;
    @@ -3834,7 +3822,7 @@ static int me4000_ai_start_ex(unsigned long *arg,
    return 0;
    }

    -static int me4000_ai_stop(me4000_ai_context_t * ai_context)
    +static int me4000_ai_stop(struct me4000_ai_context *ai_context)
    {
    wait_queue_head_t queue;
    u32 tmp;
    @@ -3871,7 +3859,7 @@ static int me4000_ai_stop(me4000_ai_context_t * ai_context)
    return 0;
    }

    -static int me4000_ai_immediate_stop(me4000_ai_context_t * ai_context)
    +static int me4000_ai_immediate_stop(struct me4000_ai_context *ai_context)
    {
    wait_queue_head_t queue;
    u32 tmp;
    @@ -3908,7 +3896,7 @@ static int me4000_ai_immediate_stop(me4000_ai_context_t * ai_context)
    return 0;
    }

    -static int me4000_ai_ex_trig_enable(me4000_ai_context_t * ai_context)
    +static int me4000_ai_ex_trig_enable(struct me4000_ai_context *ai_context)
    {
    u32 tmp;
    unsigned long flags;
    @@ -3924,7 +3912,7 @@ static int me4000_ai_ex_trig_enable(me4000_ai_context_t * ai_context)
    return 0;
    }

    -static int me4000_ai_ex_trig_disable(me4000_ai_context_t * ai_context)
    +static int me4000_ai_ex_trig_disable(struct me4000_ai_context *ai_context)
    {
    u32 tmp;
    unsigned long flags;
    @@ -3940,10 +3928,10 @@ static int me4000_ai_ex_trig_disable(me4000_ai_context_t * ai_context)
    return 0;
    }

    -static int me4000_ai_ex_trig_setup(me4000_ai_trigger_t * arg,
    - me4000_ai_context_t * ai_context)
    +static int me4000_ai_ex_trig_setup(struct me4000_ai_trigger *arg,
    + struct me4000_ai_context *ai_context)
    {
    - me4000_ai_trigger_t cmd;
    + struct me4000_ai_trigger cmd;
    int err;
    u32 tmp;
    unsigned long flags;
    @@ -3951,7 +3939,7 @@ static int me4000_ai_ex_trig_setup(me4000_ai_trigger_t * arg,
    CALL_PDEBUG("me4000_ai_ex_trig_setup() is executed\n");

    /* Copy data from user */
    - err = copy_from_user(&cmd, arg, sizeof(me4000_ai_trigger_t));
    + err = copy_from_user(&cmd, arg, sizeof(struct me4000_ai_trigger));
    if (err) {
    printk(KERN_ERR
    "ME4000:me4000_ai_ex_trig_setup():Can't copy from user space\n");
    @@ -4000,16 +3988,16 @@ static int me4000_ai_ex_trig_setup(me4000_ai_trigger_t * arg,
    return 0;
    }

    -static int me4000_ai_sc_setup(me4000_ai_sc_t * arg,
    - me4000_ai_context_t * ai_context)
    +static int me4000_ai_sc_setup(struct me4000_ai_sc *arg,
    + struct me4000_ai_context *ai_context)
    {
    - me4000_ai_sc_t cmd;
    + struct me4000_ai_sc cmd;
    int err;

    CALL_PDEBUG("me4000_ai_sc_setup() is executed\n");

    /* Copy data from user */
    - err = copy_from_user(&cmd, arg, sizeof(me4000_ai_sc_t));
    + err = copy_from_user(&cmd, arg, sizeof(struct me4000_ai_sc));
    if (err) {
    printk(KERN_ERR
    "ME4000:me4000_ai_sc_setup():Can't copy from user space\n");
    @@ -4023,9 +4011,9 @@ static int me4000_ai_sc_setup(me4000_ai_sc_t * arg,
    }

    static ssize_t me4000_ai_read(struct file *filep, char *buff, size_t cnt,
    - loff_t * offp)
    + loff_t *offp)
    {
    - me4000_ai_context_t *ai_context = filep->private_data;
    + struct me4000_ai_context *ai_context = filep->private_data;
    s16 *buffer = (s16 *) buff;
    size_t count = cnt / 2;
    unsigned long flags;
    @@ -4150,9 +4138,9 @@ static ssize_t me4000_ai_read(struct file *filep, char *buff, size_t cnt,
    return ret * 2;
    }

    -static unsigned int me4000_ai_poll(struct file *file_p, poll_table * wait)
    +static unsigned int me4000_ai_poll(struct file *file_p, poll_table *wait)
    {
    - me4000_ai_context_t *ai_context;
    + struct me4000_ai_context *ai_context;
    unsigned long mask = 0;

    CALL_PDEBUG("me4000_ai_poll() is executed\n");
    @@ -4171,7 +4159,7 @@ static unsigned int me4000_ai_poll(struct file *file_p, poll_table * wait)
    return mask;
    }

    -static int me4000_ai_offset_enable(me4000_ai_context_t * ai_context)
    +static int me4000_ai_offset_enable(struct me4000_ai_context *ai_context)
    {
    unsigned long tmp;

    @@ -4184,7 +4172,7 @@ static int me4000_ai_offset_enable(me4000_ai_context_t * ai_context)
    return 0;
    }

    -static int me4000_ai_offset_disable(me4000_ai_context_t * ai_context)
    +static int me4000_ai_offset_disable(struct me4000_ai_context *ai_context)
    {
    unsigned long tmp;

    @@ -4197,7 +4185,7 @@ static int me4000_ai_offset_disable(me4000_ai_context_t * ai_context)
    return 0;
    }

    -static int me4000_ai_fullscale_enable(me4000_ai_context_t * ai_context)
    +static int me4000_ai_fullscale_enable(struct me4000_ai_context *ai_context)
    {
    unsigned long tmp;

    @@ -4210,7 +4198,7 @@ static int me4000_ai_fullscale_enable(me4000_ai_context_t * ai_context)
    return 0;
    }

    -static int me4000_ai_fullscale_disable(me4000_ai_context_t * ai_context)
    +static int me4000_ai_fullscale_disable(struct me4000_ai_context *ai_context)
    {
    unsigned long tmp;

    @@ -4223,7 +4211,7 @@ static int me4000_ai_fullscale_disable(me4000_ai_context_t * ai_context)
    return 0;
    }

    -static int me4000_ai_fsm_state(int *arg, me4000_ai_context_t * ai_context)
    +static int me4000_ai_fsm_state(int *arg, struct me4000_ai_context *ai_context)
    {
    unsigned long tmp;

    @@ -4242,7 +4230,7 @@ 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)
    + struct me4000_ai_context *ai_context)
    {
    unsigned long c;
    int err;
    @@ -4252,7 +4240,7 @@ static int me4000_ai_get_count_buffer(unsigned long *arg,
    err = copy_to_user(arg, &c, sizeof(unsigned long));
    if (err) {
    printk(KERN_ERR
    - "ME4000:me4000_ai_get_count_buffer():Can't copy to user space\n");
    + "%s:Can't copy to user space\n", __func__);
    return -EFAULT;
    }

    @@ -4261,7 +4249,7 @@ static int me4000_ai_get_count_buffer(unsigned long *arg,

    /*---------------------------------- EEPROM stuff ---------------------------*/

    -static int eeprom_write_cmd(me4000_ai_context_t * ai_context, unsigned long cmd,
    +static int eeprom_write_cmd(struct me4000_ai_context *ai_context, unsigned long cmd,
    int length)
    {
    int i;
    @@ -4318,7 +4306,7 @@ static int eeprom_write_cmd(me4000_ai_context_t * ai_context, unsigned long cmd,
    return 0;
    }

    -static unsigned short eeprom_read_cmd(me4000_ai_context_t * ai_context,
    +static unsigned short eeprom_read_cmd(struct me4000_ai_context *ai_context,
    unsigned long cmd, int length)
    {
    int i;
    @@ -4397,11 +4385,11 @@ static unsigned short eeprom_read_cmd(me4000_ai_context_t * ai_context,
    return id;
    }

    -static int me4000_eeprom_write(me4000_eeprom_t * arg,
    - me4000_ai_context_t * ai_context)
    +static int me4000_eeprom_write(struct me4000_eeprom *arg,
    + struct me4000_ai_context *ai_context)
    {
    int err;
    - me4000_eeprom_t setup;
    + struct me4000_eeprom setup;
    unsigned long cmd;
    unsigned long date_high;
    unsigned long date_low;
    @@ -4594,12 +4582,12 @@ static int me4000_eeprom_write(me4000_eeprom_t * arg,
    return 0;
    }

    -static int me4000_eeprom_read(me4000_eeprom_t * arg,
    - me4000_ai_context_t * ai_context)
    +static int me4000_eeprom_read(struct me4000_eeprom *arg,
    + struct me4000_ai_context *ai_context)
    {
    int err;
    unsigned long cmd;
    - me4000_eeprom_t setup;
    + struct me4000_eeprom setup;

    CALL_PDEBUG("me4000_eeprom_read() is executed\n");

    @@ -4687,7 +4675,7 @@ static int me4000_eeprom_read(me4000_eeprom_t * arg,
    static int me4000_dio_ioctl(struct inode *inode_p, struct file *file_p,
    unsigned int service, unsigned long arg)
    {
    - me4000_dio_context_t *dio_context;
    + struct me4000_dio_context *dio_context;

    CALL_PDEBUG("me4000_dio_ioctl() is executed\n");

    @@ -4704,13 +4692,13 @@ static int me4000_dio_ioctl(struct inode *inode_p, struct file *file_p,

    switch (service) {
    case ME4000_DIO_CONFIG:
    - return me4000_dio_config((me4000_dio_config_t *) arg,
    + return me4000_dio_config((struct me4000_dio_config *)arg,
    dio_context);
    case ME4000_DIO_SET_BYTE:
    - return me4000_dio_set_byte((me4000_dio_byte_t *) arg,
    + return me4000_dio_set_byte((struct me4000_dio_byte *)arg,
    dio_context);
    case ME4000_DIO_GET_BYTE:
    - return me4000_dio_get_byte((me4000_dio_byte_t *) arg,
    + return me4000_dio_get_byte((struct me4000_dio_byte *)arg,
    dio_context);
    case ME4000_DIO_RESET:
    return me4000_dio_reset(dio_context);
    @@ -4723,17 +4711,17 @@ static int me4000_dio_ioctl(struct inode *inode_p, struct file *file_p,
    return 0;
    }

    -static int me4000_dio_config(me4000_dio_config_t * arg,
    - me4000_dio_context_t * dio_context)
    +static int me4000_dio_config(struct me4000_dio_config *arg,
    + struct me4000_dio_context *dio_context)
    {
    - me4000_dio_config_t cmd;
    + struct me4000_dio_config cmd;
    u32 tmp;
    int err;

    CALL_PDEBUG("me4000_dio_config() is executed\n");

    /* Copy data from user */
    - err = copy_from_user(&cmd, arg, sizeof(me4000_dio_config_t));
    + err = copy_from_user(&cmd, arg, sizeof(struct me4000_dio_config));
    if (err) {
    printk(KERN_ERR
    "ME4000:me4000_dio_config():Can't copy from user space\n");
    @@ -4964,16 +4952,16 @@ static int me4000_dio_config(me4000_dio_config_t * arg,
    return 0;
    }

    -static int me4000_dio_set_byte(me4000_dio_byte_t * arg,
    - me4000_dio_context_t * dio_context)
    +static int me4000_dio_set_byte(struct me4000_dio_byte *arg,
    + struct me4000_dio_context *dio_context)
    {
    - me4000_dio_byte_t cmd;
    + struct me4000_dio_byte cmd;
    int err;

    CALL_PDEBUG("me4000_dio_set_byte() is executed\n");

    /* Copy data from user */
    - err = copy_from_user(&cmd, arg, sizeof(me4000_dio_byte_t));
    + err = copy_from_user(&cmd, arg, sizeof(struct me4000_dio_byte));
    if (err) {
    printk(KERN_ERR
    "ME4000:me4000_dio_set_byte():Can't copy from user space\n");
    @@ -5030,16 +5018,16 @@ static int me4000_dio_set_byte(me4000_dio_byte_t * arg,
    return 0;
    }

    -static int me4000_dio_get_byte(me4000_dio_byte_t * arg,
    - me4000_dio_context_t * dio_context)
    +static int me4000_dio_get_byte(struct me4000_dio_byte *arg,
    + struct me4000_dio_context *dio_context)
    {
    - me4000_dio_byte_t cmd;
    + struct me4000_dio_byte cmd;
    int err;

    CALL_PDEBUG("me4000_dio_get_byte() is executed\n");

    /* Copy data from user */
    - err = copy_from_user(&cmd, arg, sizeof(me4000_dio_byte_t));
    + err = copy_from_user(&cmd, arg, sizeof(struct me4000_dio_byte));
    if (err) {
    printk(KERN_ERR
    "ME4000:me4000_dio_get_byte():Can't copy from user space\n");
    @@ -5070,7 +5058,7 @@ static int me4000_dio_get_byte(me4000_dio_byte_t * arg,
    }

    /* Copy result back to user */
    - err = copy_to_user(arg, &cmd, sizeof(me4000_dio_byte_t));
    + err = copy_to_user(arg, &cmd, sizeof(struct me4000_dio_byte));
    if (err) {
    printk(KERN_ERR
    "ME4000:me4000_dio_get_byte():Can't copy to user space\n");
    @@ -5080,7 +5068,7 @@ static int me4000_dio_get_byte(me4000_dio_byte_t * arg,
    return 0;
    }

    -static int me4000_dio_reset(me4000_dio_context_t * dio_context)
    +static int me4000_dio_reset(struct me4000_dio_context *dio_context)
    {
    CALL_PDEBUG("me4000_dio_reset() is executed\n");

    @@ -5101,7 +5089,7 @@ static int me4000_dio_reset(me4000_dio_context_t * dio_context)
    static int me4000_cnt_ioctl(struct inode *inode_p, struct file *file_p,
    unsigned int service, unsigned long arg)
    {
    - me4000_cnt_context_t *cnt_context;
    + struct me4000_cnt_context *cnt_context;

    CALL_PDEBUG("me4000_cnt_ioctl() is executed\n");

    @@ -5118,11 +5106,11 @@ static int me4000_cnt_ioctl(struct inode *inode_p, struct file *file_p,

    switch (service) {
    case ME4000_CNT_READ:
    - return me4000_cnt_read((me4000_cnt_t *) arg, cnt_context);
    + return me4000_cnt_read((struct me4000_cnt *)arg, cnt_context);
    case ME4000_CNT_WRITE:
    - return me4000_cnt_write((me4000_cnt_t *) arg, cnt_context);
    + return me4000_cnt_write((struct me4000_cnt *)arg, cnt_context);
    case ME4000_CNT_CONFIG:
    - return me4000_cnt_config((me4000_cnt_config_t *) arg,
    + return me4000_cnt_config((struct me4000_cnt_config *)arg,
    cnt_context);
    case ME4000_CNT_RESET:
    return me4000_cnt_reset(cnt_context);
    @@ -5135,10 +5123,10 @@ static int me4000_cnt_ioctl(struct inode *inode_p, struct file *file_p,
    return 0;
    }

    -static int me4000_cnt_config(me4000_cnt_config_t * arg,
    - me4000_cnt_context_t * cnt_context)
    +static int me4000_cnt_config(struct me4000_cnt_config *arg,
    + struct me4000_cnt_context *cnt_context)
    {
    - me4000_cnt_config_t cmd;
    + struct me4000_cnt_config cmd;
    u8 counter;
    u8 mode;
    int err;
    @@ -5146,7 +5134,7 @@ static int me4000_cnt_config(me4000_cnt_config_t * arg,
    CALL_PDEBUG("me4000_cnt_config() is executed\n");

    /* Copy data from user */
    - err = copy_from_user(&cmd, arg, sizeof(me4000_cnt_config_t));
    + err = copy_from_user(&cmd, arg, sizeof(struct me4000_cnt_config));
    if (err) {
    printk(KERN_ERR
    "ME4000:me4000_cnt_config():Can't copy from user space\n");
    @@ -5204,17 +5192,17 @@ static int me4000_cnt_config(me4000_cnt_config_t * arg,
    return 0;
    }

    -static int me4000_cnt_read(me4000_cnt_t * arg,
    - me4000_cnt_context_t * cnt_context)
    +static int me4000_cnt_read(struct me4000_cnt *arg,
    + struct me4000_cnt_context *cnt_context)
    {
    - me4000_cnt_t cmd;
    + struct me4000_cnt cmd;
    u8 tmp;
    int err;

    CALL_PDEBUG("me4000_cnt_read() is executed\n");

    /* Copy data from user */
    - err = copy_from_user(&cmd, arg, sizeof(me4000_cnt_t));
    + err = copy_from_user(&cmd, arg, sizeof(struct me4000_cnt));
    if (err) {
    printk(KERN_ERR
    "ME4000:me4000_cnt_read():Can't copy from user space\n");
    @@ -5249,7 +5237,7 @@ static int me4000_cnt_read(me4000_cnt_t * arg,
    }

    /* Copy result back to user */
    - err = copy_to_user(arg, &cmd, sizeof(me4000_cnt_t));
    + err = copy_to_user(arg, &cmd, sizeof(struct me4000_cnt));
    if (err) {
    printk(KERN_ERR
    "ME4000:me4000_cnt_read():Can't copy to user space\n");
    @@ -5259,17 +5247,17 @@ static int me4000_cnt_read(me4000_cnt_t * arg,
    return 0;
    }

    -static int me4000_cnt_write(me4000_cnt_t * arg,
    - me4000_cnt_context_t * cnt_context)
    +static int me4000_cnt_write(struct me4000_cnt *arg,
    + struct me4000_cnt_context *cnt_context)
    {
    - me4000_cnt_t cmd;
    + struct me4000_cnt cmd;
    u8 tmp;
    int err;

    CALL_PDEBUG("me4000_cnt_write() is executed\n");

    /* Copy data from user */
    - err = copy_from_user(&cmd, arg, sizeof(me4000_cnt_t));
    + err = copy_from_user(&cmd, arg, sizeof(struct me4000_cnt));
    if (err) {
    printk(KERN_ERR
    "ME4000:me4000_cnt_write():Can't copy from user space\n");
    @@ -5306,7 +5294,7 @@ static int me4000_cnt_write(me4000_cnt_t * arg,
    return 0;
    }

    -static int me4000_cnt_reset(me4000_cnt_context_t * cnt_context)
    +static int me4000_cnt_reset(struct me4000_cnt_context *cnt_context)
    {
    CALL_PDEBUG("me4000_cnt_reset() is executed\n");

    @@ -5333,7 +5321,7 @@ static int me4000_cnt_reset(me4000_cnt_context_t * cnt_context)
    static int me4000_ext_int_ioctl(struct inode *inode_p, struct file *file_p,
    unsigned int service, unsigned long arg)
    {
    - me4000_ext_int_context_t *ext_int_context;
    + struct me4000_ext_int_context *ext_int_context;

    CALL_PDEBUG("me4000_ext_int_ioctl() is executed\n");

    @@ -5366,7 +5354,7 @@ static int me4000_ext_int_ioctl(struct inode *inode_p, struct file *file_p,
    return 0;
    }

    -static int me4000_ext_int_enable(me4000_ext_int_context_t * ext_int_context)
    +static int me4000_ext_int_enable(struct me4000_ext_int_context *ext_int_context)
    {
    unsigned long tmp;

    @@ -5379,7 +5367,7 @@ static int me4000_ext_int_enable(me4000_ext_int_context_t * ext_int_context)
    return 0;
    }

    -static int me4000_ext_int_disable(me4000_ext_int_context_t * ext_int_context)
    +static int me4000_ext_int_disable(struct me4000_ext_int_context *ext_int_context)
    {
    unsigned long tmp;

    @@ -5393,7 +5381,7 @@ static int me4000_ext_int_disable(me4000_ext_int_context_t * ext_int_context)
    }

    static int me4000_ext_int_count(unsigned long *arg,
    - me4000_ext_int_context_t * ext_int_context)
    + struct me4000_ext_int_context *ext_int_context)
    {

    CALL_PDEBUG("me4000_ext_int_count() is executed\n");
    @@ -5404,10 +5392,10 @@ static int me4000_ext_int_count(unsigned long *arg,

    /*------------------------------------ General stuff ------------------------------------*/

    -static int me4000_get_user_info(me4000_user_info_t * arg,
    - me4000_info_t * board_info)
    +static int me4000_get_user_info(struct me4000_user_info *arg,
    + struct me4000_info *board_info)
    {
    - me4000_user_info_t user_info;
    + struct me4000_user_info user_info;

    CALL_PDEBUG("me4000_get_user_info() is executed\n");

    @@ -5437,7 +5425,7 @@ static int me4000_get_user_info(me4000_user_info_t * arg,

    user_info.cnt_count = board_info->board_p->cnt.count;

    - if (copy_to_user(arg, &user_info, sizeof(me4000_user_info_t)))
    + if (copy_to_user(arg, &user_info, sizeof(struct me4000_user_info)))
    return -EFAULT;

    return 0;
    @@ -5448,7 +5436,7 @@ static int me4000_get_user_info(me4000_user_info_t * arg,
    static int me4000_ext_int_fasync(int fd, struct file *file_ptr, int mode)
    {
    int result = 0;
    - me4000_ext_int_context_t *ext_int_context;
    + struct me4000_ext_int_context *ext_int_context;

    CALL_PDEBUG("me4000_ext_int_fasync() is executed\n");

    @@ -5465,7 +5453,7 @@ static irqreturn_t me4000_ao_isr(int irq, void *dev_id)
    {
    u32 tmp;
    u32 value;
    - me4000_ao_context_t *ao_context;
    + struct me4000_ao_context *ao_context;
    int i;
    int c = 0;
    int c1 = 0;
    @@ -5589,7 +5577,7 @@ static irqreturn_t me4000_ao_isr(int irq, void *dev_id)
    static irqreturn_t me4000_ai_isr(int irq, void *dev_id)
    {
    u32 tmp;
    - me4000_ai_context_t *ai_context;
    + struct me4000_ai_context *ai_context;
    int i;
    int c = 0;
    int c1 = 0;
    @@ -5933,7 +5921,7 @@ static irqreturn_t me4000_ai_isr(int irq, void *dev_id)

    static irqreturn_t me4000_ext_int_isr(int irq, void *dev_id)
    {
    - me4000_ext_int_context_t *ext_int_context;
    + struct me4000_ext_int_context *ext_int_context;
    unsigned long tmp;

    ISR_PDEBUG("me4000_ext_int_isr() is executed\n");
    @@ -5969,10 +5957,10 @@ static irqreturn_t me4000_ext_int_isr(int irq, void *dev_id)
    return IRQ_HANDLED;
    }

    -void __exit me4000_module_exit(void)
    +static void __exit me4000_module_exit(void)
    {
    struct list_head *board_p;
    - me4000_info_t *board_info;
    + struct me4000_info *board_info;

    CALL_PDEBUG("cleanup_module() is executed\n");

    @@ -5993,7 +5981,7 @@ void __exit me4000_module_exit(void)
    /* Reset the boards */
    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);
    + board_info = list_entry(board_p, struct me4000_info, list);
    me4000_reset_board(board_info);
    }

    @@ -6007,7 +5995,7 @@ static int me4000_read_procmem(char *buf, char **start, off_t offset, int count,
    {
    int len = 0;
    int limit = count - 1000;
    - me4000_info_t *board_info;
    + struct me4000_info *board_info;
    struct list_head *ptr;

    len += sprintf(buf + len, "\nME4000 DRIVER VERSION %X.%X.%X\n\n",
    @@ -6019,7 +6007,7 @@ static int me4000_read_procmem(char *buf, char **start, off_t offset, int count,
    for (ptr = me4000_board_info_list.next;
    (ptr != &me4000_board_info_list) && (len < limit);
    ptr = ptr->next) {
    - board_info = list_entry(ptr, me4000_info_t, list);
    + board_info = list_entry(ptr, struct me4000_info, list);

    len +=
    sprintf(buf + len, "Board number %d:\n",
    diff --git a/drivers/staging/me4000/me4000.h b/drivers/staging/me4000/me4000.h
    index c35e4b9..81c6f4d 100644
    --- a/drivers/staging/me4000/me4000.h
    +++ b/drivers/staging/me4000/me4000.h
    @@ -329,46 +329,46 @@
    Circular buffer used for analog input/output reads/writes.
    ================================================== =========================*/

    -typedef struct me4000_circ_buf {
    +struct me4000_circ_buf {
    s16 *buf;
    int volatile head;
    int volatile tail;
    -} me4000_circ_buf_t;
    +};

    /*================================================= ============================
    Information about the hardware capabilities
    ================================================== =========================*/

    -typedef struct me4000_ao_info {
    +struct me4000_ao_info {
    int count;
    int fifo_count;
    -} me4000_ao_info_t;
    +};

    -typedef struct me4000_ai_info {
    +struct me4000_ai_info {
    int count;
    int sh_count;
    int diff_count;
    int ex_trig_analog;
    -} me4000_ai_info_t;
    +};

    -typedef struct me4000_dio_info {
    +struct me4000_dio_info {
    int count;
    -} me4000_dio_info_t;
    +};

    -typedef struct me4000_cnt_info {
    +struct me4000_cnt_info {
    int count;
    -} me4000_cnt_info_t;
    +};

    -typedef struct me4000_board {
    +struct me4000_board {
    u16 vendor_id;
    u16 device_id;
    - me4000_ao_info_t ao;
    - me4000_ai_info_t ai;
    - me4000_dio_info_t dio;
    - me4000_cnt_info_t cnt;
    -} me4000_board_t;
    + struct me4000_ao_info ao;
    + struct me4000_ai_info ai;
    + struct me4000_dio_info dio;
    + struct me4000_cnt_info cnt;
    +};

    -static me4000_board_t me4000_boards[] = {
    +static struct me4000_board me4000_boards[] = {
    {PCI_VENDOR_ID_MEILHAUS, 0x4610, {0, 0}, {16, 0, 0, 0}, {4}, {3}},

    {PCI_VENDOR_ID_MEILHAUS, 0x4650, {0, 0}, {16, 0, 0, 0}, {4}, {0}},
    @@ -391,8 +391,6 @@ static me4000_board_t me4000_boards[] = {
    {0},
    };

    -#define ME4000_BOARD_VERSIONS (sizeof(me4000_boards) / sizeof(me4000_board_t) - 1)
    -
    /*================================================= ============================
    PCI device table.
    This is used by modprobe to translate PCI IDs to drivers.
    @@ -427,19 +425,19 @@ MODULE_DEVICE_TABLE(pci, me4000_pci_table);
    Global board and subdevice information structures
    ================================================== =========================*/

    -typedef struct me4000_info {
    +struct me4000_info {
    struct list_head list; // List of all detected boards
    int board_count; // Index of the board after detection

    unsigned long plx_regbase; // PLX configuration space base address
    - unsigned long me4000_regbase; // Base address of the ME4000
    - unsigned long timer_regbase; // Base address of the timer circuit
    - unsigned long program_regbase; // Base address to set the program pin for the xilinx
    + resource_size_t me4000_regbase; // Base address of the ME4000
    + resource_size_t timer_regbase; // Base address of the timer circuit
    + resource_size_t program_regbase; // Base address to set the program pin for the xilinx

    unsigned long plx_regbase_size; // PLX register set space
    - unsigned long me4000_regbase_size; // ME4000 register set space
    - unsigned long timer_regbase_size; // Timer circuit register set space
    - unsigned long program_regbase_size; // Size of program base address of the ME4000
    + resource_size_t me4000_regbase_size; // ME4000 register set space
    + resource_size_t timer_regbase_size; // Timer circuit register set space
    + resource_size_t program_regbase_size; // Size of program base address of the ME4000

    unsigned int serial_no; // Serial number of the board
    unsigned char hw_revision; // Hardware revision of the board
    @@ -451,7 +449,7 @@ typedef struct me4000_info {
    int pci_func_no; // PCI function number
    struct pci_dev *pci_dev_p; // General PCI information

    - me4000_board_t *board_p; // Holds the board capabilities
    + struct me4000_board *board_p; // Holds the board capabilities

    unsigned int irq; // IRQ assigned from the PCI BIOS
    unsigned int irq_count; // Count of external interrupts
    @@ -464,18 +462,18 @@ typedef struct me4000_info {
    struct me4000_dio_context *dio_context; // Digital I/O specific context
    struct me4000_cnt_context *cnt_context; // Counter specific context
    struct me4000_ext_int_context *ext_int_context; // External interrupt specific context
    -} me4000_info_t;
    +};

    -typedef struct me4000_ao_context {
    +struct me4000_ao_context {
    struct list_head list; // linked list of me4000_ao_context_t
    int index; // Index in the list
    int mode; // Indicates mode (0 = single, 1 = wraparound, 2 = continous)
    int dac_in_use; // Indicates if already opend
    spinlock_t use_lock; // Guards in_use
    spinlock_t int_lock; // Used when locking out interrupts
    - me4000_circ_buf_t circ_buf; // Circular buffer
    + struct me4000_circ_buf circ_buf; // Circular buffer
    wait_queue_head_t wait_queue; // Wait queue to sleep while blocking write
    - me4000_info_t *board_info;
    + struct me4000_info *board_info;
    unsigned int irq; // The irq associated with this ADC
    int volatile pipe_flag; // Indicates broken pipe set from me4000_ao_isr()
    unsigned long ctrl_reg;
    @@ -486,9 +484,9 @@ typedef struct me4000_ao_context {
    unsigned long irq_status_reg;
    unsigned long preload_reg;
    struct fasync_struct *fasync_p; // Queue for asynchronous notification
    -} me4000_ao_context_t;
    +};

    -typedef struct me4000_ai_context {
    +struct me4000_ai_context {
    struct list_head list; // linked list of me4000_ai_info_t
    int mode; // Indicates mode
    int in_use; // Indicates if already opend
    @@ -496,9 +494,9 @@ typedef struct me4000_ai_context {
    spinlock_t int_lock; // Used when locking out interrupts
    int number; // Number of the DAC
    unsigned int irq; // The irq associated with this ADC
    - me4000_circ_buf_t circ_buf; // Circular buffer
    + struct me4000_circ_buf circ_buf; // Circular buffer
    wait_queue_head_t wait_queue; // Wait queue to sleep while blocking read
    - me4000_info_t *board_info;
    + struct me4000_info *board_info;

    struct fasync_struct *fasync_p; // Queue for asynchronous notification

    @@ -523,48 +521,48 @@ typedef struct me4000_ai_context {
    unsigned long channel_list_count;
    unsigned long sample_counter;
    int sample_counter_reload;
    -} me4000_ai_context_t;
    +};

    -typedef struct me4000_dio_context {
    +struct me4000_dio_context {
    struct list_head list; // linked list of me4000_dio_context_t
    int in_use; // Indicates if already opend
    spinlock_t use_lock; // Guards in_use
    int number;
    int dio_count;
    - me4000_info_t *board_info;
    + struct me4000_info *board_info;
    unsigned long dir_reg;
    unsigned long ctrl_reg;
    unsigned long port_0_reg;
    unsigned long port_1_reg;
    unsigned long port_2_reg;
    unsigned long port_3_reg;
    -} me4000_dio_context_t;
    +};

    -typedef struct me4000_cnt_context {
    +struct me4000_cnt_context {
    struct list_head list; // linked list of me4000_dio_context_t
    int in_use; // Indicates if already opend
    spinlock_t use_lock; // Guards in_use
    int number;
    int cnt_count;
    - me4000_info_t *board_info;
    + struct me4000_info *board_info;
    unsigned long ctrl_reg;
    unsigned long counter_0_reg;
    unsigned long counter_1_reg;
    unsigned long counter_2_reg;
    -} me4000_cnt_context_t;
    +};

    -typedef struct me4000_ext_int_context {
    +struct me4000_ext_int_context {
    struct list_head list; // linked list of me4000_dio_context_t
    int in_use; // Indicates if already opend
    spinlock_t use_lock; // Guards in_use
    int number;
    - me4000_info_t *board_info;
    + struct me4000_info *board_info;
    unsigned int irq;
    unsigned long int_count;
    struct fasync_struct *fasync_ptr;
    unsigned long ctrl_reg;
    unsigned long irq_status_reg;
    -} me4000_ext_int_context_t;
    +};

    #endif

    @@ -745,12 +743,12 @@ typedef struct me4000_ext_int_context {
    General type definitions
    ----------------------------------------------------------------------------*/

    -typedef struct me4000_user_info {
    +struct me4000_user_info {
    int board_count; // Index of the board after detection
    unsigned long plx_regbase; // PLX configuration space base address
    - unsigned long me4000_regbase; // Base address of the ME4000
    + resource_size_t me4000_regbase; // Base address of the ME4000
    unsigned long plx_regbase_size; // PLX register set space
    - unsigned long me4000_regbase_size; // ME4000 register set space
    + resource_size_t me4000_regbase_size; // ME4000 register set space
    unsigned long serial_no; // Serial number of the board
    unsigned char hw_revision; // Hardware revision of the board
    unsigned short vendor_id; // Meilhaus vendor id (0x1402)
    @@ -773,62 +771,62 @@ typedef struct me4000_user_info {
    int dio_count; // Count of digital I/O ports

    int cnt_count; // Count of counters
    -} me4000_user_info_t;
    +};

    /*-----------------------------------------------------------------------------
    Type definitions for analog output
    ----------------------------------------------------------------------------*/

    -typedef struct me4000_ao_channel_list {
    +struct me4000_ao_channel_list {
    unsigned long count;
    unsigned long *list;
    -} me4000_ao_channel_list_t;
    +};

    /*-----------------------------------------------------------------------------
    Type definitions for analog input
    ----------------------------------------------------------------------------*/

    -typedef struct me4000_ai_channel_list {
    +struct me4000_ai_channel_list {
    unsigned long count;
    unsigned long *list;
    -} me4000_ai_channel_list_t;
    +};

    -typedef struct me4000_ai_timer {
    +struct me4000_ai_timer {
    unsigned long pre_chan;
    unsigned long chan;
    unsigned long scan_low;
    unsigned long scan_high;
    -} me4000_ai_timer_t;
    +};

    -typedef struct me4000_ai_config {
    - me4000_ai_timer_t timer;
    - me4000_ai_channel_list_t channel_list;
    +struct me4000_ai_config {
    + struct me4000_ai_timer timer;
    + struct me4000_ai_channel_list channel_list;
    int sh;
    -} me4000_ai_config_t;
    +};

    -typedef struct me4000_ai_single {
    +struct me4000_ai_single {
    int channel;
    int range;
    int mode;
    short value;
    unsigned long timeout;
    -} me4000_ai_single_t;
    +};

    -typedef struct me4000_ai_trigger {
    +struct me4000_ai_trigger {
    int mode;
    int edge;
    -} me4000_ai_trigger_t;
    +};

    -typedef struct me4000_ai_sc {
    +struct me4000_ai_sc {
    unsigned long value;
    int reload;
    -} me4000_ai_sc_t;
    +};

    /*-----------------------------------------------------------------------------
    Type definitions for eeprom
    ----------------------------------------------------------------------------*/

    -typedef struct me4000_eeprom {
    +struct me4000_eeprom {
    unsigned long date;
    short uni_10_offset;
    short uni_10_fullscale;
    @@ -842,45 +840,45 @@ typedef struct me4000_eeprom {
    short diff_10_fullscale;
    short diff_2_5_offset;
    short diff_2_5_fullscale;
    -} me4000_eeprom_t;
    +};

    /*-----------------------------------------------------------------------------
    Type definitions for digital I/O
    ----------------------------------------------------------------------------*/

    -typedef struct me4000_dio_config {
    +struct me4000_dio_config {
    int port;
    int mode;
    int function;
    -} me4000_dio_config_t;
    +};

    -typedef struct me4000_dio_byte {
    +struct me4000_dio_byte {
    int port;
    unsigned char byte;
    -} me4000_dio_byte_t;
    +};

    /*-----------------------------------------------------------------------------
    Type definitions for counters
    ----------------------------------------------------------------------------*/

    -typedef struct me4000_cnt {
    +struct me4000_cnt {
    int counter;
    unsigned short value;
    -} me4000_cnt_t;
    +};

    -typedef struct me4000_cnt_config {
    +struct me4000_cnt_config {
    int counter;
    int mode;
    -} me4000_cnt_config_t;
    +};

    /*-----------------------------------------------------------------------------
    Type definitions for external interrupt
    ----------------------------------------------------------------------------*/

    -typedef struct {
    +struct me4000_int {
    int int1_count;
    int int2_count;
    -} me4000_int_type;
    +};

    /*-----------------------------------------------------------------------------
    The ioctls of the board
    @@ -888,7 +886,8 @@ typedef struct {

    #define ME4000_IOCTL_MAXNR 50
    #define ME4000_MAGIC 'y'
    -#define ME4000_GET_USER_INFO _IOR (ME4000_MAGIC, 0, me4000_user_info_t)
    +#define ME4000_GET_USER_INFO _IOR (ME4000_MAGIC, 0, \
    + struct me4000_user_info)

    #define ME4000_AO_START _IOW (ME4000_MAGIC, 1, unsigned long)
    #define ME4000_AO_STOP _IO (ME4000_MAGIC, 2)
    @@ -904,25 +903,35 @@ typedef struct {
    #define ME4000_AO_DISABLE_DO _IO (ME4000_MAGIC, 12)
    #define ME4000_AO_FSM_STATE _IOR (ME4000_MAGIC, 13, int)

    -#define ME4000_AI_SINGLE _IOR (ME4000_MAGIC, 14, me4000_ai_single_t)
    +#define ME4000_AI_SINGLE _IOR (ME4000_MAGIC, 14, \
    + struct me4000_ai_single)
    #define ME4000_AI_START _IOW (ME4000_MAGIC, 15, unsigned long)
    #define ME4000_AI_STOP _IO (ME4000_MAGIC, 16)
    #define ME4000_AI_IMMEDIATE_STOP _IO (ME4000_MAGIC, 17)
    #define ME4000_AI_EX_TRIG_ENABLE _IO (ME4000_MAGIC, 18)
    #define ME4000_AI_EX_TRIG_DISABLE _IO (ME4000_MAGIC, 19)
    -#define ME4000_AI_EX_TRIG_SETUP _IOW (ME4000_MAGIC, 20, me4000_ai_trigger_t)
    -#define ME4000_AI_CONFIG _IOW (ME4000_MAGIC, 21, me4000_ai_config_t)
    -#define ME4000_AI_SC_SETUP _IOW (ME4000_MAGIC, 22, me4000_ai_sc_t)
    +#define ME4000_AI_EX_TRIG_SETUP _IOW (ME4000_MAGIC, 20, \
    + struct me4000_ai_trigger)
    +#define ME4000_AI_CONFIG _IOW (ME4000_MAGIC, 21, \
    + struct me4000_ai_config)
    +#define ME4000_AI_SC_SETUP _IOW (ME4000_MAGIC, 22, \
    + struct me4000_ai_sc)
    #define ME4000_AI_FSM_STATE _IOR (ME4000_MAGIC, 23, int)

    -#define ME4000_DIO_CONFIG _IOW (ME4000_MAGIC, 24, me4000_dio_config_t)
    -#define ME4000_DIO_GET_BYTE _IOR (ME4000_MAGIC, 25, me4000_dio_byte_t)
    -#define ME4000_DIO_SET_BYTE _IOW (ME4000_MAGIC, 26, me4000_dio_byte_t)
    +#define ME4000_DIO_CONFIG _IOW (ME4000_MAGIC, 24, \
    + struct me4000_dio_config)
    +#define ME4000_DIO_GET_BYTE _IOR (ME4000_MAGIC, 25, \
    + struct me4000_dio_byte)
    +#define ME4000_DIO_SET_BYTE _IOW (ME4000_MAGIC, 26, \
    + struct me4000_dio_byte)
    #define ME4000_DIO_RESET _IO (ME4000_MAGIC, 27)

    -#define ME4000_CNT_READ _IOR (ME4000_MAGIC, 28, me4000_cnt_t)
    -#define ME4000_CNT_WRITE _IOW (ME4000_MAGIC, 29, me4000_cnt_t)
    -#define ME4000_CNT_CONFIG _IOW (ME4000_MAGIC, 30, me4000_cnt_config_t)
    +#define ME4000_CNT_READ _IOR (ME4000_MAGIC, 28, \
    + struct me4000_cnt)
    +#define ME4000_CNT_WRITE _IOW (ME4000_MAGIC, 29, \
    + struct me4000_cnt)
    +#define ME4000_CNT_CONFIG _IOW (ME4000_MAGIC, 30, \
    + struct me4000_cnt_config)
    #define ME4000_CNT_RESET _IO (ME4000_MAGIC, 31)

    #define ME4000_EXT_INT_DISABLE _IO (ME4000_MAGIC, 32)
    @@ -934,13 +943,16 @@ typedef struct {
    #define ME4000_AI_FULLSCALE_ENABLE _IO (ME4000_MAGIC, 37)
    #define ME4000_AI_FULLSCALE_DISABLE _IO (ME4000_MAGIC, 38)

    -#define ME4000_AI_EEPROM_READ _IOR (ME4000_MAGIC, 39, me4000_eeprom_t)
    -#define ME4000_AI_EEPROM_WRITE _IOW (ME4000_MAGIC, 40, me4000_eeprom_t)
    +#define ME4000_AI_EEPROM_READ _IOR (ME4000_MAGIC, 39, \
    + struct me4000_eeprom)
    +#define ME4000_AI_EEPROM_WRITE _IOW (ME4000_MAGIC, 40, \
    + struct me4000_eeprom)

    #define ME4000_AO_SIMULTANEOUS_EX_TRIG _IO (ME4000_MAGIC, 41)
    #define ME4000_AO_SIMULTANEOUS_SW _IO (ME4000_MAGIC, 42)
    #define ME4000_AO_SIMULTANEOUS_DISABLE _IO (ME4000_MAGIC, 43)
    -#define ME4000_AO_SIMULTANEOUS_UPDATE _IOW (ME4000_MAGIC, 44, me4000_ao_channel_list_t)
    +#define ME4000_AO_SIMULTANEOUS_UPDATE _IOW (ME4000_MAGIC, 44, \
    + struct me4000_ao_channel_list)

    #define ME4000_AO_SYNCHRONOUS_EX_TRIG _IO (ME4000_MAGIC, 45)
    #define ME4000_AO_SYNCHRONOUS_SW _IO (ME4000_MAGIC, 46)
    --
    1.6.0.2

    --
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

  10. [PATCH 15/42] Staging: w35und: remove some typedefs

    From: Pekka Enberg

    This patch removes some obfuscating typedefs from the driver code.

    Cc: Pavel Machek
    Signed-off-by: Pekka Enberg
    Signed-off-by: Greg Kroah-Hartman
    ---
    drivers/staging/winbond/bss_f.h | 6 ++--
    drivers/staging/winbond/ds_tkip.h | 6 ++--
    drivers/staging/winbond/linux/common.h | 10 +--------
    drivers/staging/winbond/linux/wb35reg.c | 26 +++++++++++-----------
    drivers/staging/winbond/linux/wb35reg_f.h | 12 +++++-----
    drivers/staging/winbond/linux/wb35reg_s.h | 2 +-
    drivers/staging/winbond/linux/wb35rx.c | 16 +++++++-------
    drivers/staging/winbond/linux/wb35rx_s.h | 2 +-
    drivers/staging/winbond/linux/wb35tx.c | 8 +++---
    drivers/staging/winbond/linux/wb35tx_f.h | 2 +-
    drivers/staging/winbond/linux/wbusb.c | 4 +-
    drivers/staging/winbond/mds.c | 28 +++++++++++++-----------
    drivers/staging/winbond/mds_f.h | 6 ++--
    drivers/staging/winbond/mds_s.h | 8 +++---
    drivers/staging/winbond/mlme_s.h | 2 +-
    drivers/staging/winbond/mlmetxrx.c | 4 +-
    drivers/staging/winbond/mlmetxrx_f.h | 4 +-
    drivers/staging/winbond/reg.c | 24 ++++++++++----------
    drivers/staging/winbond/sme_api.h | 2 +-
    drivers/staging/winbond/wbhal.c | 32 ++++++++++++++--------------
    drivers/staging/winbond/wbhal_f.h | 28 ++++++++++++------------
    drivers/staging/winbond/wbhal_s.h | 4 +-
    drivers/staging/winbond/wblinux.c | 7 +++--
    23 files changed, 119 insertions(+), 124 deletions(-)

    diff --git a/drivers/staging/winbond/bss_f.h b/drivers/staging/winbond/bss_f.h
    index c957bc9..0131831 100644
    --- a/drivers/staging/winbond/bss_f.h
    +++ b/drivers/staging/winbond/bss_f.h
    @@ -24,7 +24,7 @@ void DesiredRate2InfoElement(PWB32_ADAPTER Adapter, u8 *addr, u16 *iFildOffset,
    u8 *pBasicRateSet, u8 BasicRateCount,
    u8 *pOperationRateSet, u8 OperationRateCount);
    void BSSAddIBSSdata(PWB32_ADAPTER Adapter, PWB_BSSDESCRIPTION psDesData);
    -unsigned char boCmpMacAddr( PUCHAR, PUCHAR );
    +unsigned char boCmpMacAddr( u8 *, u8 *);
    unsigned char boCmpSSID(struct SSID_Element *psSSID1, struct SSID_Element *psSSID2);
    u16 wBSSfindSSID(PWB32_ADAPTER Adapter, struct SSID_Element *psSsid);
    u16 wRoamingQuery(PWB32_ADAPTER Adapter);
    @@ -42,11 +42,11 @@ void RateReSortForSRate(PWB32_ADAPTER Adapter, u8 *RateArray, u8 num);
    void Assemble_IE(PWB32_ADAPTER Adapter, u16 wBssIdx);
    void SetMaxTxRate(PWB32_ADAPTER Adapter);

    -void CreateWpaIE(PWB32_ADAPTER Adapter, u16* iFildOffset, PUCHAR msg, struct Management_Frame* msgHeader,
    +void CreateWpaIE(PWB32_ADAPTER Adapter, u16* iFildOffset, u8 *msg, struct Management_Frame* msgHeader,
    struct Association_Request_Frame_Body* msgBody, u16 iMSindex); //added by WS 05/14/05

    #ifdef _WPA2_
    -void CreateRsnIE(PWB32_ADAPTER Adapter, u16* iFildOffset, PUCHAR msg, struct Management_Frame* msgHeader,
    +void CreateRsnIE(PWB32_ADAPTER Adapter, u16* iFildOffset, u8 *msg, struct Management_Frame* msgHeader,
    struct Association_Request_Frame_Body* msgBody, u16 iMSindex);//added by WS 05/14/05

    u16 SearchPmkid(PWB32_ADAPTER Adapter, struct Management_Frame* msgHeader,
    diff --git a/drivers/staging/winbond/ds_tkip.h b/drivers/staging/winbond/ds_tkip.h
    index 29e5055..6841d66 100644
    --- a/drivers/staging/winbond/ds_tkip.h
    +++ b/drivers/staging/winbond/ds_tkip.h
    @@ -25,9 +25,9 @@ typedef struct tkip
    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 );
    +//void _append_data( u8 *pData, u16 size, tkip_t *p );
    +void Mds_MicGet( void* Adapter, void* pRxLayer1, u8 *pKey, u8 *pMic );
    +void Mds_MicFill( void* Adapter, void* pDes, u8 *XmitBufAddress );



    diff --git a/drivers/staging/winbond/linux/common.h b/drivers/staging/winbond/linux/common.h
    index 6b00bad..c8f14b7 100644
    --- a/drivers/staging/winbond/linux/common.h
    +++ b/drivers/staging/winbond/linux/common.h
    @@ -39,14 +39,6 @@
    // Common type definition
    //================================================== =============

    -typedef u8* PUCHAR;
    -typedef s8* PCHAR;
    -typedef u8* PBOOLEAN;
    -typedef u16* PUSHORT;
    -typedef u32* PULONG;
    -typedef s16* PSHORT;
    -
    -
    //===========================================
    #define IGNORE 2
    #define SUCCESS 1
    @@ -110,7 +102,7 @@ typedef struct urb * PURB;
    #define OS_ATOMIC_READ( _A, _V ) _V
    #define OS_ATOMIC_INC( _A, _V ) EncapAtomicInc( _A, (void*)_V )
    #define OS_ATOMIC_DEC( _A, _V ) EncapAtomicDec( _A, (void*)_V )
    -#define OS_MEMORY_CLEAR( _A, _S ) memset( (PUCHAR)_A,0,_S)
    +#define OS_MEMORY_CLEAR( _A, _S ) memset( (u8 *)_A,0,_S)
    #define OS_MEMORY_COMPARE( _A, _B, _S ) (memcmp(_A,_B,_S)? 0 : 1) // Definition is reverse with Ndis 1: the same 0: different


    diff --git a/drivers/staging/winbond/linux/wb35reg.c b/drivers/staging/winbond/linux/wb35reg.c
    index 2c0b454..5c28ec9 100644
    --- a/drivers/staging/winbond/linux/wb35reg.c
    +++ b/drivers/staging/winbond/linux/wb35reg.c
    @@ -10,7 +10,7 @@ extern void phy_calibration_winbond(hw_data_t *phw_data, u32 frequency);
    // Flag : AUTO_INCREMENT - RegisterNo will auto increment 4
    // NO_INCREMENT - Function will write data into the same register
    unsigned char
    -Wb35Reg_BurstWrite(phw_data_t pHwData, u16 RegisterNo, PULONG pRegisterData, u8 NumberOfData, u8 Flag)
    +Wb35Reg_BurstWrite(phw_data_t pHwData, u16 RegisterNo, u32 * pRegisterData, u8 NumberOfData, u8 Flag)
    {
    PWB35REG pWb35Reg = &pHwData->Wb35Reg;
    PURB pUrb = NULL;
    @@ -30,13 +30,13 @@ Wb35Reg_BurstWrite(phw_data_t pHwData, u16 RegisterNo, PULONG pRegisterData, u8
    if( pUrb && pRegQueue ) {
    pRegQueue->DIRECT = 2;// burst write register
    pRegQueue->INDEX = RegisterNo;
    - pRegQueue->pBuffer = (PULONG)((PUCHAR)pRegQueue + sizeof(REG_QUEUE));
    + pRegQueue->pBuffer = (u32 *)((u8 *)pRegQueue + sizeof(REG_QUEUE));
    memcpy( pRegQueue->pBuffer, pRegisterData, DataSize );
    //the function for reversing register data from little endian to big endian
    for( i=0; i pRegQueue->pBuffer[i] = cpu_to_le32( pRegQueue->pBuffer[i] );

    - dr = (struct usb_ctrlrequest *)((PUCHAR)pRegQueue + sizeof(REG_QUEUE) + DataSize);
    + dr = (struct usb_ctrlrequest *)((u8 *)pRegQueue + sizeof(REG_QUEUE) + DataSize);
    dr->bRequestType = USB_TYPE_VENDOR | USB_DIR_OUT | USB_RECIP_DEVICE;
    dr->bRequest = 0x04; // USB or vendor-defined request code, burst mode
    dr->wValue = cpu_to_le16( Flag ); // 0: Register number auto-increment, 1: No auto increment
    @@ -181,7 +181,7 @@ Wb35Reg_Write( phw_data_t pHwData, u16 RegisterNo, u32 RegisterValue )
    pRegQueue->INDEX = RegisterNo;
    pRegQueue->VALUE = cpu_to_le32(RegisterValue);
    pRegQueue->RESERVED_VALID = FALSE;
    - dr = (struct usb_ctrlrequest *)((PUCHAR)pRegQueue + sizeof(REG_QUEUE));
    + dr = (struct usb_ctrlrequest *)((u8 *)pRegQueue + sizeof(REG_QUEUE));
    dr->bRequestType = USB_TYPE_VENDOR|USB_DIR_OUT |USB_RECIP_DEVICE;
    dr->bRequest = 0x03; // USB or vendor-defined request code, burst mode
    dr->wValue = cpu_to_le16(0x0);
    @@ -220,7 +220,7 @@ Wb35Reg_Write( phw_data_t pHwData, u16 RegisterNo, u32 RegisterValue )
    // FALSE : register not support
    unsigned char
    Wb35Reg_WriteWithCallbackValue( phw_data_t pHwData, u16 RegisterNo, u32 RegisterValue,
    - PCHAR pValue, s8 Len)
    + s8 *pValue, s8 Len)
    {
    PWB35REG pWb35Reg = &pHwData->Wb35Reg;
    struct usb_ctrlrequest *dr;
    @@ -243,7 +243,7 @@ Wb35Reg_WriteWithCallbackValue( phw_data_t pHwData, u16 RegisterNo, u32 Register
    //NOTE : Users must guarantee the size of value will not exceed the buffer size.
    memcpy(pRegQueue->RESERVED, pValue, Len);
    pRegQueue->RESERVED_VALID = TRUE;
    - dr = (struct usb_ctrlrequest *)((PUCHAR)pRegQueue + sizeof(REG_QUEUE));
    + dr = (struct usb_ctrlrequest *)((u8 *)pRegQueue + sizeof(REG_QUEUE));
    dr->bRequestType = USB_TYPE_VENDOR|USB_DIR_OUT |USB_RECIP_DEVICE;
    dr->bRequest = 0x03; // USB or vendor-defined request code, burst mode
    dr->wValue = cpu_to_le16(0x0);
    @@ -278,10 +278,10 @@ Wb35Reg_WriteWithCallbackValue( phw_data_t pHwData, u16 RegisterNo, u32 Register
    // FALSE : register not support
    // pRegisterValue : It must be a resident buffer due to asynchronous read register.
    unsigned char
    -Wb35Reg_ReadSync( phw_data_t pHwData, u16 RegisterNo, PULONG pRegisterValue )
    +Wb35Reg_ReadSync( phw_data_t pHwData, u16 RegisterNo, u32 * pRegisterValue )
    {
    PWB35REG pWb35Reg = &pHwData->Wb35Reg;
    - PULONG pltmp = pRegisterValue;
    + u32 * pltmp = pRegisterValue;
    int ret = -1;

    // Module shutdown
    @@ -327,7 +327,7 @@ Wb35Reg_ReadSync( phw_data_t pHwData, u16 RegisterNo, PULONG pRegisterValue
    // FALSE : register not support
    // pRegisterValue : It must be a resident buffer due to asynchronous read register.
    unsigned char
    -Wb35Reg_Read(phw_data_t pHwData, u16 RegisterNo, PULONG pRegisterValue )
    +Wb35Reg_Read(phw_data_t pHwData, u16 RegisterNo, u32 * pRegisterValue )
    {
    PWB35REG pWb35Reg = &pHwData->Wb35Reg;
    struct usb_ctrlrequest * dr;
    @@ -348,7 +348,7 @@ Wb35Reg_Read(phw_data_t pHwData, u16 RegisterNo, PULONG pRegisterValue )
    pRegQueue->DIRECT = 0;// read register
    pRegQueue->INDEX = RegisterNo;
    pRegQueue->pBuffer = pRegisterValue;
    - dr = (struct usb_ctrlrequest *)((PUCHAR)pRegQueue + sizeof(REG_QUEUE));
    + dr = (struct usb_ctrlrequest *)((u8 *)pRegQueue + sizeof(REG_QUEUE));
    dr->bRequestType = USB_TYPE_VENDOR|USB_RECIP_DEVICE|USB_DIR_IN;
    dr->bRequest = 0x01; // USB or vendor-defined request code, burst mode
    dr->wValue = cpu_to_le16(0x0);
    @@ -399,7 +399,7 @@ Wb35Reg_EP0VM(phw_data_t pHwData )
    PWB35REG pWb35Reg = &pHwData->Wb35Reg;
    PURB pUrb;
    struct usb_ctrlrequest *dr;
    - PULONG pBuffer;
    + u32 * pBuffer;
    int ret = -1;
    PREG_QUEUE pRegQueue;

    @@ -429,7 +429,7 @@ Wb35Reg_EP0VM(phw_data_t pHwData )

    usb_fill_control_urb( pUrb, pHwData->WbUsb.udev,
    REG_DIRECTION(pHwData->WbUsb.udev,pRegQueue),
    - (PUCHAR)dr,pBuffer,cpu_to_le16(dr->wLength),
    + (u8 *)dr,pBuffer,cpu_to_le16(dr->wLength),
    Wb35Reg_EP0VM_complete, (void*)pHwData);

    pWb35Reg->EP0vm_state = VM_RUNNING;
    @@ -655,7 +655,7 @@ unsigned char Wb35Reg_initial(phw_data_t pHwData)
    // version in _GENREQ.ASM of the DWB NE1000/2000 driver.
    //================================================== ================================
    u32
    -CardComputeCrc(PUCHAR Buffer, u32 Length)
    +CardComputeCrc(u8 * Buffer, u32 Length)
    {
    u32 Crc, Carry;
    u32 i, j;
    diff --git a/drivers/staging/winbond/linux/wb35reg_f.h b/drivers/staging/winbond/linux/wb35reg_f.h
    index 38e2906..3006cfe 100644
    --- a/drivers/staging/winbond/linux/wb35reg_f.h
    +++ b/drivers/staging/winbond/linux/wb35reg_f.h
    @@ -29,16 +29,16 @@ void EEPROMTxVgaAdjust( phw_data_t pHwData ); // 20060619.5 Add

    void Wb35Reg_destroy( phw_data_t pHwData );

    -unsigned char Wb35Reg_Read( phw_data_t pHwData, u16 RegisterNo, PULONG pRegisterValue );
    -unsigned char Wb35Reg_ReadSync( phw_data_t pHwData, u16 RegisterNo, PULONG pRegisterValue );
    +unsigned char Wb35Reg_Read( phw_data_t pHwData, u16 RegisterNo, u32 * pRegisterValue );
    +unsigned char Wb35Reg_ReadSync( phw_data_t pHwData, u16 RegisterNo, u32 * pRegisterValue );
    unsigned char Wb35Reg_Write( phw_data_t pHwData, u16 RegisterNo, u32 RegisterValue );
    unsigned char Wb35Reg_WriteSync( phw_data_t pHwData, u16 RegisterNo, u32 RegisterValue );
    unsigned char Wb35Reg_WriteWithCallbackValue( phw_data_t pHwData,
    u16 RegisterNo,
    u32 RegisterValue,
    - PCHAR pValue,
    - s8 Len);
    -unsigned char Wb35Reg_BurstWrite( phw_data_t pHwData, u16 RegisterNo, PULONG pRegisterData, u8 NumberOfData, u8 Flag );
    + s8 *pValue,
    + s8 Len);
    +unsigned char Wb35Reg_BurstWrite( phw_data_t pHwData, u16 RegisterNo, u32 * pRegisterData, u8 NumberOfData, u8 Flag );

    void Wb35Reg_EP0VM( phw_data_t pHwData );
    void Wb35Reg_EP0VM_start( phw_data_t pHwData );
    @@ -47,7 +47,7 @@ void Wb35Reg_EP0VM_complete( PURB pUrb );
    u32 BitReverse( u32 dwData, u32 DataLength);

    void CardGetMulticastBit( u8 Address[MAC_ADDR_LENGTH], u8 *Byte, u8 *Value );
    -u32 CardComputeCrc( PUCHAR Buffer, u32 Length );
    +u32 CardComputeCrc( u8 * Buffer, u32 Length );

    void Wb35Reg_phy_calibration( phw_data_t pHwData );
    void Wb35Reg_Update( phw_data_t pHwData, u16 RegisterNo, u32 RegisterValue );
    diff --git a/drivers/staging/winbond/linux/wb35reg_s.h b/drivers/staging/winbond/linux/wb35reg_s.h
    index a7595b1..9b76301 100644
    --- a/drivers/staging/winbond/linux/wb35reg_s.h
    +++ b/drivers/staging/winbond/linux/wb35reg_s.h
    @@ -75,7 +75,7 @@ typedef struct _REG_QUEUE
    union
    {
    u32 VALUE;
    - PULONG pBuffer;
    + u32 * pBuffer;
    };
    u8 RESERVED[4];// space reserved for communication

    diff --git a/drivers/staging/winbond/linux/wb35rx.c b/drivers/staging/winbond/linux/wb35rx.c
    index 26157eb..c5c3317 100644
    --- a/drivers/staging/winbond/linux/wb35rx.c
    +++ b/drivers/staging/winbond/linux/wb35rx.c
    @@ -27,7 +27,7 @@ void Wb35Rx_start(phw_data_t pHwData)
    void Wb35Rx( phw_data_t pHwData )
    {
    PWB35RX pWb35Rx = &pHwData->Wb35Rx;
    - PUCHAR pRxBufferAddress;
    + u8 * pRxBufferAddress;
    PURB pUrb = (PURB)pWb35Rx->RxUrb;
    int retv;
    u32 RxBufferId;
    @@ -89,7 +89,7 @@ void Wb35Rx_Complete(PURB pUrb)
    {
    phw_data_t pHwData = pUrb->context;
    PWB35RX pWb35Rx = &pHwData->Wb35Rx;
    - PUCHAR pRxBufferAddress;
    + u8 * pRxBufferAddress;
    u32 SizeCheck;
    u16 BulkLength;
    u32 RxBufferId;
    @@ -116,7 +116,7 @@ void Wb35Rx_Complete(PURB pUrb)

    // Start to process the data only in successful condition
    pWb35Rx->RxOwner[ RxBufferId ] = 0; // Set the owner to driver
    - R00.value = le32_to_cpu(*(PULONG)pRxBufferAddress);
    + R00.value = le32_to_cpu(*(u32 *)pRxBufferAddress);

    // The URB is completed, check the result
    if (pWb35Rx->EP3VM_status != 0) {
    @@ -223,7 +223,7 @@ void Wb35Rx_reset_descriptor( phw_data_t pHwData )

    void Wb35Rx_adjust(PDESCRIPTOR pRxDes)
    {
    - PULONG pRxBufferAddress;
    + u32 * pRxBufferAddress;
    u32 DecryptionMethod;
    u32 i;
    u16 BufferSize;
    @@ -264,7 +264,7 @@ u16 Wb35Rx_indicate(phw_data_t pHwData)
    {
    DESCRIPTOR RxDes;
    PWB35RX pWb35Rx = &pHwData->Wb35Rx;
    - PUCHAR pRxBufferAddress;
    + u8 * pRxBufferAddress;
    u16 PacketSize;
    u16 stmp, BufferSize, stmp2 = 0;
    u32 RxBufferId;
    @@ -283,13 +283,13 @@ u16 Wb35Rx_indicate(phw_data_t pHwData)

    // Parse the bulkin buffer
    while (BufferSize >= 4) {
    - if ((cpu_to_le32(*(PULONG)pRxBufferAddress) & 0x0fffffff) == RX_END_TAG) //Is ending? 921002.9.a
    + if ((cpu_to_le32(*(u32 *)pRxBufferAddress) & 0x0fffffff) == RX_END_TAG) //Is ending? 921002.9.a
    break;

    // Get the R00 R01 first
    - RxDes.R00.value = le32_to_cpu(*(PULONG)pRxBufferAddress);
    + RxDes.R00.value = le32_to_cpu(*(u32 *)pRxBufferAddress);
    PacketSize = (u16)RxDes.R00.R00_receive_byte_count;
    - RxDes.R01.value = le32_to_cpu(*((PULONG)(pRxBufferAddress+4)));
    + RxDes.R01.value = le32_to_cpu(*((u32 *)(pRxBufferAddress+4)));
    // For new DMA 4k
    if ((PacketSize & 0x03) > 0)
    PacketSize -= 4;
    diff --git a/drivers/staging/winbond/linux/wb35rx_s.h b/drivers/staging/winbond/linux/wb35rx_s.h
    index 53b831f..b90c269 100644
    --- a/drivers/staging/winbond/linux/wb35rx_s.h
    +++ b/drivers/staging/winbond/linux/wb35rx_s.h
    @@ -41,7 +41,7 @@ typedef struct _WB35RX
    u32 Ep3ErrorCount2; // 20060625.1 Usbd for Rx DMA error count

    int EP3VM_status;
    - PUCHAR pDRx;
    + u8 * pDRx;

    } WB35RX, *PWB35RX;

    diff --git a/drivers/staging/winbond/linux/wb35tx.c b/drivers/staging/winbond/linux/wb35tx.c
    index cf19c3b..bcb014a 100644
    --- a/drivers/staging/winbond/linux/wb35tx.c
    +++ b/drivers/staging/winbond/linux/wb35tx.c
    @@ -12,7 +12,7 @@


    unsigned char
    -Wb35Tx_get_tx_buffer(phw_data_t pHwData, PUCHAR *pBuffer )
    +Wb35Tx_get_tx_buffer(phw_data_t pHwData, u8 **pBuffer)
    {
    PWB35TX pWb35Tx = &pHwData->Wb35Tx;

    @@ -37,7 +37,7 @@ void Wb35Tx(phw_data_t pHwData)
    {
    PWB35TX pWb35Tx = &pHwData->Wb35Tx;
    PADAPTER Adapter = pHwData->Adapter;
    - PUCHAR pTxBufferAddress;
    + u8 *pTxBufferAddress;
    PMDS pMds = &Adapter->Mds;
    struct urb * pUrb = (struct urb *)pWb35Tx->Tx4Urb;
    int retv;
    @@ -225,7 +225,7 @@ void Wb35Tx_EP2VM(phw_data_t pHwData)
    {
    PWB35TX pWb35Tx = &pHwData->Wb35Tx;
    struct urb * pUrb = (struct urb *)pWb35Tx->Tx2Urb;
    - PULONG pltmp = (PULONG)pWb35Tx->EP2_buf;
    + u32 * pltmp = (u32 *)pWb35Tx->EP2_buf;
    int retv;

    do {
    @@ -266,7 +266,7 @@ void Wb35Tx_EP2VM_complete(struct urb * pUrb)
    T02_DESCRIPTOR T02, TSTATUS;
    PADAPTER Adapter = (PADAPTER)pHwData->Adapter;
    PWB35TX pWb35Tx = &pHwData->Wb35Tx;
    - PULONG pltmp = (PULONG)pWb35Tx->EP2_buf;
    + u32 * pltmp = (u32 *)pWb35Tx->EP2_buf;
    u32 i;
    u16 InterruptInLength;

    diff --git a/drivers/staging/winbond/linux/wb35tx_f.h b/drivers/staging/winbond/linux/wb35tx_f.h
    index 7705a84..107b129 100644
    --- a/drivers/staging/winbond/linux/wb35tx_f.h
    +++ b/drivers/staging/winbond/linux/wb35tx_f.h
    @@ -3,7 +3,7 @@
    //====================================
    unsigned char Wb35Tx_initial( phw_data_t pHwData );
    void Wb35Tx_destroy( phw_data_t pHwData );
    -unsigned char Wb35Tx_get_tx_buffer( phw_data_t pHwData, PUCHAR *pBuffer );
    +unsigned char Wb35Tx_get_tx_buffer( phw_data_t pHwData, u8 **pBuffer );

    void Wb35Tx_EP2VM( phw_data_t pHwData );
    void Wb35Tx_EP2VM_start( phw_data_t pHwData );
    diff --git a/drivers/staging/winbond/linux/wbusb.c b/drivers/staging/winbond/linux/wbusb.c
    index cbad5fb..ee9f471 100644
    --- a/drivers/staging/winbond/linux/wbusb.c
    +++ b/drivers/staging/winbond/linux/wbusb.c
    @@ -136,7 +136,7 @@ static int wbsoft_config(struct ieee80211_hw *dev, struct ieee80211_conf *conf)
    hal_set_current_channel(&my_adapter->sHwData, ch);
    hal_set_beacon_period(&my_adapter->sHwData, conf->beacon_int);
    // hal_set_cap_info(&my_adapter->sHwData, ?? );
    -// hal_set_ssid(phw_data_t pHwData, PUCHAR pssid, u8 ssid_len); ??
    +// hal_set_ssid(phw_data_t pHwData, u8 * pssid, u8 ssid_len); ??
    hal_set_accept_broadcast(&my_adapter->sHwData, 1);
    hal_set_accept_promiscuous(&my_adapter->sHwData, 1);
    hal_set_accept_multicast(&my_adapter->sHwData, 1);
    @@ -148,7 +148,7 @@ static int wbsoft_config(struct ieee80211_hw *dev, struct ieee80211_conf *conf)

    // hal_start_bss(&my_adapter->sHwData, WLAN_BSSTYPE_INFRASTRUCTURE); ??

    -//void hal_set_rates(phw_data_t pHwData, PUCHAR pbss_rates,
    +//void hal_set_rates(phw_data_t pHwData, u8 * pbss_rates,
    // u8 length, unsigned char basic_rate_set)

    return 0;
    diff --git a/drivers/staging/winbond/mds.c b/drivers/staging/winbond/mds.c
    index 8ce6389..400397c 100644
    --- a/drivers/staging/winbond/mds.c
    +++ b/drivers/staging/winbond/mds.c
    @@ -40,7 +40,7 @@ Mds_Tx(PADAPTER Adapter)
    PMDS pMds = &Adapter->Mds;
    DESCRIPTOR TxDes;
    PDESCRIPTOR pTxDes = &TxDes;
    - PUCHAR XmitBufAddress;
    + u8 *XmitBufAddress;
    u16 XmitBufSize, PacketSize, stmp, CurrentSize, FragmentThreshold;
    u8 FillIndex, TxDesIndex, FragmentCount, FillCount;
    unsigned char BufferFilled = FALSE, MICAdd = 0;
    @@ -90,7 +90,7 @@ Mds_Tx(PADAPTER Adapter)
    BufferFilled = TRUE;

    /* Leaves first u8 intact */
    - memset((PUCHAR)pTxDes + 1, 0, sizeof(DESCRIPTOR) - 1);
    + memset((u8 *)pTxDes + 1, 0, sizeof(DESCRIPTOR) - 1);

    TxDesIndex = pMds->TxDesIndex;//Get the current ID
    pTxDes->Descriptor_ID = TxDesIndex;
    @@ -229,10 +229,10 @@ Mds_SendComplete(PADAPTER Adapter, PT02_DESCRIPTOR pT02)
    }

    void
    -Mds_HeaderCopy(PADAPTER Adapter, PDESCRIPTOR pDes, PUCHAR TargetBuffer)
    +Mds_HeaderCopy(PADAPTER Adapter, PDESCRIPTOR pDes, u8 *TargetBuffer)
    {
    PMDS pMds = &Adapter->Mds;
    - PUCHAR src_buffer = pDes->buffer_address[0];//931130.5.g
    + u8 *src_buffer = pDes->buffer_address[0];//931130.5.g
    PT00_DESCRIPTOR pT00;
    PT01_DESCRIPTOR pT01;
    u16 stmp;
    @@ -276,7 +276,7 @@ Mds_HeaderCopy(PADAPTER Adapter, PDESCRIPTOR pDes, PUCHAR TargetBuffer)
    //
    // Set tx rate
    //
    - stmp = *(PUSHORT)(TargetBuffer+30); // 2n alignment address
    + stmp = *(u16 *)(TargetBuffer+30); // 2n alignment address

    //Use basic rate
    ctmp1 = ctmpf = CURRENT_TX_RATE_FOR_MNG;
    @@ -326,11 +326,13 @@ Mds_HeaderCopy(PADAPTER Adapter, PDESCRIPTOR pDes, PUCHAR TargetBuffer)

    // The function return the 4n size of usb pk
    u16
    -Mds_BodyCopy(PADAPTER Adapter, PDESCRIPTOR pDes, PUCHAR TargetBuffer)
    +Mds_BodyCopy(PADAPTER Adapter, PDESCRIPTOR pDes, u8 *TargetBuffer)
    {
    PT00_DESCRIPTOR pT00;
    PMDS pMds = &Adapter->Mds;
    - PUCHAR buffer, src_buffer, pctmp;
    + u8 *buffer;
    + u8 *src_buffer;
    + u8 *pctmp;
    u16 Size = 0;
    u16 SizeLeft, CopySize, CopyLeft, stmp;
    u8 buf_index, FragmentCount = 0;
    @@ -354,7 +356,7 @@ Mds_BodyCopy(PADAPTER Adapter, PDESCRIPTOR pDes, PUCHAR TargetBuffer)
    SizeLeft -= CopySize;

    // 1 Byte operation
    - pctmp = (PUCHAR)( buffer + 8 + DOT_11_SEQUENCE_OFFSET );
    + pctmp = (u8 *)( buffer + 8 + DOT_11_SEQUENCE_OFFSET );
    *pctmp &= 0xf0;
    *pctmp |= FragmentCount;//931130.5.m
    if( !FragmentCount )
    @@ -379,7 +381,7 @@ Mds_BodyCopy(PADAPTER Adapter, PDESCRIPTOR pDes, PUCHAR TargetBuffer)
    buf_index++;
    buf_index %= MAX_DESCRIPTOR_BUFFER_INDEX;
    } else {
    - PUCHAR pctmp = pDes->buffer_address[buf_index];
    + u8 *pctmp = pDes->buffer_address[buf_index];
    pctmp += CopySize;
    pDes->buffer_address[buf_index] = pctmp;
    pDes->buffer_size[buf_index] -= CopySize;
    @@ -419,7 +421,7 @@ Mds_BodyCopy(PADAPTER Adapter, PDESCRIPTOR pDes, PUCHAR TargetBuffer)

    pT00->T00_last_mpdu = 1;
    pT00->T00_IsLastMpdu = 1;
    - buffer = (PUCHAR)pT00 + 8; // +8 for USB hdr
    + buffer = (u8 *)pT00 + 8; // +8 for USB hdr
    buffer[1] &= ~0x04; // Clear more frag bit of 802.11 frame control
    pDes->FragmentCount = FragmentCount; // Update the correct fragment number
    return Size;
    @@ -427,7 +429,7 @@ Mds_BodyCopy(PADAPTER Adapter, PDESCRIPTOR pDes, PUCHAR TargetBuffer)


    void
    -Mds_DurationSet( PADAPTER Adapter, PDESCRIPTOR pDes, PUCHAR buffer )
    +Mds_DurationSet( PADAPTER Adapter, PDESCRIPTOR pDes, u8 *buffer )
    {
    PT00_DESCRIPTOR pT00;
    PT01_DESCRIPTOR pT01;
    @@ -574,7 +576,7 @@ Mds_DurationSet( PADAPTER Adapter, PDESCRIPTOR pDes, PUCHAR buffer )
    DEFAULT_SIFSTIME*3 );
    }

    - ((PUSHORT)buffer)[5] = cpu_to_le16(Duration);// 4 USHOR for skip 8B USB, 2USHORT=FC + Duration
    + ((u16 *)buffer)[5] = cpu_to_le16(Duration);// 4 USHOR for skip 8B USB, 2USHORT=FC + Duration

    //----20061009 add by anson's endian
    pNextT00->value = cpu_to_le32(pNextT00->value);
    @@ -615,7 +617,7 @@ Mds_DurationSet( PADAPTER Adapter, PDESCRIPTOR pDes, PUCHAR buffer )
    }
    }

    - ((PUSHORT)buffer)[5] = cpu_to_le16(Duration);// 4 USHOR for skip 8B USB, 2USHORT=FC + Duration
    + ((u16 *)buffer)[5] = cpu_to_le16(Duration);// 4 USHOR for skip 8B USB, 2USHORT=FC + Duration
    pT00->value = cpu_to_le32(pT00->value);
    pT01->value = cpu_to_le32(pT01->value);
    //--end 20061009 add
    diff --git a/drivers/staging/winbond/mds_f.h b/drivers/staging/winbond/mds_f.h
    index 651188b..7a682d4 100644
    --- a/drivers/staging/winbond/mds_f.h
    +++ b/drivers/staging/winbond/mds_f.h
    @@ -1,9 +1,9 @@
    unsigned char Mds_initial( PADAPTER Adapter );
    void Mds_Destroy( PADAPTER Adapter );
    void Mds_Tx( PADAPTER Adapter );
    -void Mds_HeaderCopy( PADAPTER Adapter, PDESCRIPTOR pDes, PUCHAR TargetBuffer );
    -u16 Mds_BodyCopy( PADAPTER Adapter, PDESCRIPTOR pDes, PUCHAR TargetBuffer );
    -void Mds_DurationSet( PADAPTER Adapter, PDESCRIPTOR pDes, PUCHAR TargetBuffer );
    +void Mds_HeaderCopy( PADAPTER Adapter, PDESCRIPTOR pDes, u8 *TargetBuffer );
    +u16 Mds_BodyCopy( PADAPTER Adapter, PDESCRIPTOR pDes, u8 *TargetBuffer );
    +void Mds_DurationSet( PADAPTER Adapter, PDESCRIPTOR pDes, u8 *TargetBuffer );
    void Mds_SendComplete( PADAPTER Adapter, PT02_DESCRIPTOR pT02 );
    void Mds_MpduProcess( PADAPTER Adapter, PDESCRIPTOR pRxDes );
    void Mds_reset_descriptor( PADAPTER Adapter );
    diff --git a/drivers/staging/winbond/mds_s.h b/drivers/staging/winbond/mds_s.h
    index 4738279..9df2e09 100644
    --- a/drivers/staging/winbond/mds_s.h
    +++ b/drivers/staging/winbond/mds_s.h
    @@ -86,7 +86,7 @@ typedef struct _MDS
    {
    // For Tx usage
    u8 TxOwner[ ((MAX_USB_TX_BUFFER_NUMBER + 3) & ~0x03) ];
    - PUCHAR pTxBuffer;
    + u8 *pTxBuffer;
    u16 TxBufferSize[ ((MAX_USB_TX_BUFFER_NUMBER + 1) & ~0x01) ];
    u8 TxDesFrom[ ((MAX_USB_TX_DESCRIPTOR + 3) & ~0x03) ];//931130.4.u // 1: MLME 2: NDIS control 3: NDIS data
    u8 TxCountInBuffer[ ((MAX_USB_TX_DESCRIPTOR + 3) & ~0x03) ]; // 20060928
    @@ -103,7 +103,7 @@ typedef struct _MDS
    u16 TxResult[ ((MAX_USB_TX_DESCRIPTOR + 1) & ~0x01) ];//Collect the sending result of Mpdu

    u8 MicRedundant[8]; // For tmp use
    - PUCHAR MicWriteAddress[2]; //The start address to fill the Mic, use 2 point due to Mic maybe fragment
    + u8 *MicWriteAddress[2]; //The start address to fill the Mic, use 2 point due to Mic maybe fragment

    u16 MicWriteSize[2]; //931130.4.x

    @@ -144,7 +144,7 @@ typedef struct _MDS

    typedef struct _RxBuffer
    {
    - PUCHAR pBufferAddress; // Pointer the received data buffer.
    + u8 * pBufferAddress; // Pointer the received data buffer.
    u16 BufferSize;
    u8 RESERVED;
    u8 BufferIndex;// Only 1 byte
    @@ -176,7 +176,7 @@ typedef struct _RXLAYER1
    /////////////////////////////////////////////////////////////////////////////////////////////
    // For brand-new Rx system
    u8 ReservedBuffer[ 2400 ];//If Buffer ID is reserved one, it must copy the data into this area
    - PUCHAR ReservedBufferPoint;// Point to the next availabe address of reserved buffer
    + u8 *ReservedBufferPoint;// Point to the next availabe address of reserved buffer

    }RXLAYER1, * PRXLAYER1;

    diff --git a/drivers/staging/winbond/mlme_s.h b/drivers/staging/winbond/mlme_s.h
    index 58094f6..6ec818b 100644
    --- a/drivers/staging/winbond/mlme_s.h
    +++ b/drivers/staging/winbond/mlme_s.h
    @@ -125,7 +125,7 @@
    typedef struct _MLME_FRAME
    {
    //NDIS_PACKET MLME_Packet;
    - PCHAR pMMPDU;
    + s8 * pMMPDU;
    u16 len;
    u8 DataType;
    u8 IsInUsed;
    diff --git a/drivers/staging/winbond/mlmetxrx.c b/drivers/staging/winbond/mlmetxrx.c
    index 46b091e..e8533b8 100644
    --- a/drivers/staging/winbond/mlmetxrx.c
    +++ b/drivers/staging/winbond/mlmetxrx.c
    @@ -113,13 +113,13 @@ MLME_GetNextPacket(PADAPTER Adapter, PDESCRIPTOR pDes)
    pDes->Type = Adapter->sMlmeFrame.DataType;
    }

    -void MLMEfreeMMPDUBuffer(PWB32_ADAPTER Adapter, PCHAR pData)
    +void MLMEfreeMMPDUBuffer(PWB32_ADAPTER Adapter, s8 *pData)
    {
    int i;

    // Reclaim the data buffer
    for (i = 0; i < MAX_NUM_TX_MMPDU; i++) {
    - if (pData == (PCHAR)&(Adapter->sMlmeFrame.TxMMPDU[i]))
    + if (pData == (s8 *)&(Adapter->sMlmeFrame.TxMMPDU[i]))
    break;
    }
    if (Adapter->sMlmeFrame.TxMMPDUInUse[i])
    diff --git a/drivers/staging/winbond/mlmetxrx_f.h b/drivers/staging/winbond/mlmetxrx_f.h
    index d74e225..24cd5f3 100644
    --- a/drivers/staging/winbond/mlmetxrx_f.h
    +++ b/drivers/staging/winbond/mlmetxrx_f.h
    @@ -20,7 +20,7 @@ MLMEGetMMPDUBuffer(
    PWB32_ADAPTER Adapter
    );

    -void MLMEfreeMMPDUBuffer( PWB32_ADAPTER Adapter, PCHAR pData);
    +void MLMEfreeMMPDUBuffer( PWB32_ADAPTER Adapter, s8 * pData);

    void MLME_GetNextPacket( PADAPTER Adapter, PDESCRIPTOR pDes );
    u8 MLMESendFrame( PWB32_ADAPTER Adapter,
    @@ -42,7 +42,7 @@ MLMERcvFrame(
    void
    MLMEReturnPacket(
    PWB32_ADAPTER Adapter,
    - PUCHAR pRxBufer
    + u8 * pRxBufer
    );
    #ifdef _IBSS_BEACON_SEQ_STICK_
    s8 SendBCNullData(PWB32_ADAPTER Adapter, u16 wIdx);
    diff --git a/drivers/staging/winbond/reg.c b/drivers/staging/winbond/reg.c
    index b475c7a..57af5b8 100644
    --- a/drivers/staging/winbond/reg.c
    +++ b/drivers/staging/winbond/reg.c
    @@ -922,16 +922,16 @@ Uxx_ReadEthernetAddress( phw_data_t pHwData )
    // Only unplug and plug again can make hardware read EEPROM again. 20060727
    Wb35Reg_WriteSync( pHwData, 0x03b4, 0x08000000 ); // Start EEPROM access + Read + address(0x0d)
    Wb35Reg_ReadSync( pHwData, 0x03b4, &ltmp );
    - *(PUSHORT)pHwData->PermanentMacAddress = cpu_to_le16((u16)ltmp); //20060926 anson's endian
    + *(u16 *)pHwData->PermanentMacAddress = cpu_to_le16((u16)ltmp); //20060926 anson's endian
    Wb35Reg_WriteSync( pHwData, 0x03b4, 0x08010000 ); // Start EEPROM access + Read + address(0x0d)
    Wb35Reg_ReadSync( pHwData, 0x03b4, &ltmp );
    - *(PUSHORT)(pHwData->PermanentMacAddress + 2) = cpu_to_le16((u16)ltmp); //20060926 anson's endian
    + *(u16 *)(pHwData->PermanentMacAddress + 2) = cpu_to_le16((u16)ltmp); //20060926 anson's endian
    Wb35Reg_WriteSync( pHwData, 0x03b4, 0x08020000 ); // Start EEPROM access + Read + address(0x0d)
    Wb35Reg_ReadSync( pHwData, 0x03b4, &ltmp );
    - *(PUSHORT)(pHwData->PermanentMacAddress + 4) = cpu_to_le16((u16)ltmp); //20060926 anson's endian
    - *(PUSHORT)(pHwData->PermanentMacAddress + 6) = 0;
    - Wb35Reg_WriteSync( pHwData, 0x03e8, cpu_to_le32(*(PULONG)pHwData->PermanentMacAddress) ); //20060926 anson's endian
    - Wb35Reg_WriteSync( pHwData, 0x03ec, cpu_to_le32(*(PULONG)(pHwData->PermanentMacAddress+4)) ); //20060926 anson's endian
    + *(u16 *)(pHwData->PermanentMacAddress + 4) = cpu_to_le16((u16)ltmp); //20060926 anson's endian
    + *(u16 *)(pHwData->PermanentMacAddress + 6) = 0;
    + Wb35Reg_WriteSync( pHwData, 0x03e8, cpu_to_le32(*(u32 *)pHwData->PermanentMacAddress) ); //20060926 anson's endian
    + Wb35Reg_WriteSync( pHwData, 0x03ec, cpu_to_le32(*(u32 *)(pHwData->PermanentMacAddress+4)) ); //20060926 anson's endian
    }


    @@ -1038,7 +1038,7 @@ void
    RFSynthesizer_initial(phw_data_t pHwData)
    {
    u32 altmp[32];
    - PULONG pltmp = altmp;
    + u32 * pltmp = altmp;
    u32 ltmp;
    u8 number=0x00; // The number of register vale
    u8 i;
    @@ -2358,11 +2358,11 @@ void Mxx_initial( phw_data_t pHwData )
    pltmp[2] = pWb35Reg->M2C_MacControl;

    // M30 BSSID
    - pltmp[3] = *(PULONG)pHwData->bssid;
    + pltmp[3] = *(u32 *)pHwData->bssid;

    // M34
    pHwData->AID = DEFAULT_AID;
    - tmp = *(PUSHORT)(pHwData->bssid+4);
    + tmp = *(u16 *)(pHwData->bssid+4);
    tmp |= DEFAULT_AID << 16;
    pltmp[4] = tmp;

    @@ -2428,7 +2428,7 @@ void GetTxVgaFromEEPROM( phw_data_t pHwData )
    {
    u32 i, j, ltmp;
    u16 Value[MAX_TXVGA_EEPROM];
    - PUCHAR pctmp;
    + u8 *pctmp;
    u8 ctmp=0;

    // Get the entire TxVga setting in EEPROM
    @@ -2441,7 +2441,7 @@ void GetTxVgaFromEEPROM( phw_data_t pHwData )
    }

    // Adjust the filed which fills with reserved value.
    - pctmp = (PUCHAR)Value;
    + pctmp = (u8 *)Value;
    for( i=0; i<(MAX_TXVGA_EEPROM*2); i++ )
    {
    if( pctmp[i] != 0xff )
    @@ -2480,7 +2480,7 @@ void GetTxVgaFromEEPROM( phw_data_t pHwData )
    // This function will use default TxVgaSettingInEEPROM data to calculate new TxVga.
    void EEPROMTxVgaAdjust( phw_data_t pHwData ) // 20060619.5 Add
    {
    - PUCHAR pTxVga = pHwData->TxVgaSettingInEEPROM;
    + u8 * pTxVga = pHwData->TxVgaSettingInEEPROM;
    s16 i, stmp;

    //-- 2.4G -- 20060704.2 Request from Tiger
    diff --git a/drivers/staging/winbond/sme_api.h b/drivers/staging/winbond/sme_api.h
    index 016b225..745eb37 100644
    --- a/drivers/staging/winbond/sme_api.h
    +++ b/drivers/staging/winbond/sme_api.h
    @@ -208,7 +208,7 @@ s8 sme_set_tx_antenna(void *pcore_data, u32 TxAntenna);
    s8 sme_set_IBSS_chan(void *pcore_data, ChanInfo chan);

    //20061108 WPS
    -s8 sme_set_IE_append(void *pcore_data, PUCHAR buffer, u16 buf_len);
    +s8 sme_set_IE_append(void *pcore_data, u8 *buffer, u16 buf_len);



    diff --git a/drivers/staging/winbond/wbhal.c b/drivers/staging/winbond/wbhal.c
    index daf4422..5d68ece 100644
    --- a/drivers/staging/winbond/wbhal.c
    +++ b/drivers/staging/winbond/wbhal.c
    @@ -1,13 +1,13 @@
    #include "os_common.h"

    -void hal_get_ethernet_address( phw_data_t pHwData, PUCHAR current_address )
    +void hal_get_ethernet_address( phw_data_t pHwData, u8 *current_address )
    {
    if( pHwData->SurpriseRemove ) return;

    memcpy( current_address, pHwData->CurrentMacAddress, ETH_LENGTH_OF_ADDRESS );
    }

    -void hal_set_ethernet_address( phw_data_t pHwData, PUCHAR current_address )
    +void hal_set_ethernet_address( phw_data_t pHwData, u8 *current_address )
    {
    u32 ltmp[2];

    @@ -15,13 +15,13 @@ void hal_set_ethernet_address( phw_data_t pHwData, PUCHAR current_address )

    memcpy( pHwData->CurrentMacAddress, current_address, ETH_LENGTH_OF_ADDRESS );

    - ltmp[0]= cpu_to_le32( *(PULONG)pHwData->CurrentMacAddress );
    - ltmp[1]= cpu_to_le32( *(PULONG)(pHwData->CurrentMacAddress + 4) ) & 0xffff;
    + ltmp[0]= cpu_to_le32( *(u32 *)pHwData->CurrentMacAddress );
    + ltmp[1]= cpu_to_le32( *(u32 *)(pHwData->CurrentMacAddress + 4) ) & 0xffff;

    Wb35Reg_BurstWrite( pHwData, 0x03e8, ltmp, 2, AUTO_INCREMENT );
    }

    -void hal_get_permanent_address( phw_data_t pHwData, PUCHAR pethernet_address )
    +void hal_get_permanent_address( phw_data_t pHwData, u8 *pethernet_address )
    {
    if( pHwData->SurpriseRemove ) return;

    @@ -89,7 +89,7 @@ void hal_halt(phw_data_t pHwData, void *ppa_data)
    }

    //---------------------------------------------------------------------------------------------------
    -void hal_set_rates(phw_data_t pHwData, PUCHAR pbss_rates,
    +void hal_set_rates(phw_data_t pHwData, u8 *pbss_rates,
    u8 length, unsigned char basic_rate_set)
    {
    PWB35REG pWb35Reg = &pHwData->Wb35Reg;
    @@ -158,13 +158,13 @@ void hal_set_rates(phw_data_t pHwData, PUCHAR pbss_rates,
    // Fill data into support rate until buffer full
    //---20060926 add by anson's endian
    for (i=0; i<4; i++)
    - *(PULONG)(SupportedRate+(i<<2)) = cpu_to_le32( *(PULONG)(SupportedRate+(i<<2)) );
    + *(u32 *)(SupportedRate+(i<<2)) = cpu_to_le32( *(u32 *)(SupportedRate+(i<<2)) );
    //--- end 20060926 add by anson's endian
    - Wb35Reg_BurstWrite( pHwData,0x087c, (PULONG)SupportedRate, 4, AUTO_INCREMENT );
    - pWb35Reg->M7C_MacControl = ((PULONG)SupportedRate)[0];
    - pWb35Reg->M80_MacControl = ((PULONG)SupportedRate)[1];
    - pWb35Reg->M84_MacControl = ((PULONG)SupportedRate)[2];
    - pWb35Reg->M88_MacControl = ((PULONG)SupportedRate)[3];
    + Wb35Reg_BurstWrite( pHwData,0x087c, (u32 *)SupportedRate, 4, AUTO_INCREMENT );
    + pWb35Reg->M7C_MacControl = ((u32 *)SupportedRate)[0];
    + pWb35Reg->M80_MacControl = ((u32 *)SupportedRate)[1];
    + pWb35Reg->M84_MacControl = ((u32 *)SupportedRate)[2];
    + pWb35Reg->M88_MacControl = ((u32 *)SupportedRate)[3];

    // Fill length
    tmp = Count1<<28 | Count2<<24;
    @@ -206,7 +206,7 @@ void hal_set_current_channel_ex( phw_data_t pHwData, ChanInfo channel )
    pWb35Reg->M28_MacControl &= ~0xff; // Clean channel information field
    pWb35Reg->M28_MacControl |= channel.ChanNo;
    Wb35Reg_WriteWithCallbackValue( pHwData, 0x0828, pWb35Reg->M28_MacControl,
    - (PCHAR)&channel, sizeof(ChanInfo));
    + (s8 *)&channel, sizeof(ChanInfo));
    }
    //---------------------------------------------------------------------------------------------------
    void hal_set_current_channel( phw_data_t pHwData, ChanInfo channel )
    @@ -277,7 +277,7 @@ void hal_set_accept_beacon( phw_data_t pHwData, u8 enable )
    Wb35Reg_Write( pHwData, 0x0800, pWb35Reg->M00_MacControl );
    }
    //---------------------------------------------------------------------------------------------------
    -void hal_set_multicast_address( phw_data_t pHwData, PUCHAR address, u8 number )
    +void hal_set_multicast_address( phw_data_t pHwData, u8 *address, u8 number )
    {
    PWB35REG pWb35Reg = &pHwData->Wb35Reg;
    u8 Byte, Bit;
    @@ -297,7 +297,7 @@ void hal_set_multicast_address( phw_data_t pHwData, PUCHAR address, u8 number )
    }

    // Updating register
    - Wb35Reg_BurstWrite( pHwData, 0x0804, (PULONG)pWb35Reg->Multicast, 2, AUTO_INCREMENT );
    + Wb35Reg_BurstWrite( pHwData, 0x0804, (u32 *)pWb35Reg->Multicast, 2, AUTO_INCREMENT );
    }
    //---------------------------------------------------------------------------------------------------
    u8 hal_get_accept_beacon( phw_data_t pHwData )
    @@ -806,7 +806,7 @@ u8 hal_get_hw_radio_off( phw_data_t pHwData )
    }
    }

    -unsigned char hal_get_dxx_reg( phw_data_t pHwData, u16 number, PULONG pValue )
    +unsigned char hal_get_dxx_reg( phw_data_t pHwData, u16 number, u32 * pValue )
    {
    if( number < 0x1000 )
    number += 0x1000;
    diff --git a/drivers/staging/winbond/wbhal_f.h b/drivers/staging/winbond/wbhal_f.h
    index fe25f97..ea9531a 100644
    --- a/drivers/staging/winbond/wbhal_f.h
    +++ b/drivers/staging/winbond/wbhal_f.h
    @@ -16,23 +16,23 @@
    //================================================== ==================================
    // Function declaration
    //================================================== ==================================
    -void hal_remove_mapping_key( phw_data_t pHwData, PUCHAR pmac_addr );
    +void hal_remove_mapping_key( phw_data_t pHwData, u8 *pmac_addr );
    void hal_remove_default_key( phw_data_t pHwData, u32 index );
    -unsigned char hal_set_mapping_key( phw_data_t Adapter, PUCHAR pmac_addr, u8 null_key, u8 wep_on, PUCHAR ptx_tsc, PUCHAR prx_tsc, u8 key_type, u8 key_len, PUCHAR pkey_data );
    -unsigned char hal_set_default_key( phw_data_t Adapter, u8 index, u8 null_key, u8 wep_on, PUCHAR ptx_tsc, PUCHAR prx_tsc, u8 key_type, u8 key_len, PUCHAR pkey_data );
    +unsigned char hal_set_mapping_key( phw_data_t Adapter, u8 *pmac_addr, u8 null_key, u8 wep_on, u8 *ptx_tsc, u8 *prx_tsc, u8 key_type, u8 key_len, u8 *pkey_data );
    +unsigned char hal_set_default_key( phw_data_t Adapter, u8 index, u8 null_key, u8 wep_on, u8 *ptx_tsc, u8 *prx_tsc, u8 key_type, u8 key_len, u8 *pkey_data );
    void hal_clear_all_default_key( phw_data_t pHwData );
    void hal_clear_all_group_key( phw_data_t pHwData );
    void hal_clear_all_mapping_key( phw_data_t pHwData );
    void hal_clear_all_key( phw_data_t pHwData );
    -void hal_get_ethernet_address( phw_data_t pHwData, PUCHAR current_address );
    -void hal_set_ethernet_address( phw_data_t pHwData, PUCHAR current_address );
    -void hal_get_permanent_address( phw_data_t pHwData, PUCHAR pethernet_address );
    +void hal_get_ethernet_address( phw_data_t pHwData, u8 *current_address );
    +void hal_set_ethernet_address( phw_data_t pHwData, u8 *current_address );
    +void hal_get_permanent_address( phw_data_t pHwData, u8 *pethernet_address );
    unsigned char hal_init_hardware( phw_data_t pHwData, PADAPTER Adapter );
    void hal_set_power_save_mode( phw_data_t pHwData, unsigned char power_save, unsigned char wakeup, unsigned char dtim );
    -void hal_get_power_save_mode( phw_data_t pHwData, PBOOLEAN pin_pwr_save );
    +void hal_get_power_save_mode( phw_data_t pHwData, u8 *pin_pwr_save );
    void hal_set_slot_time( phw_data_t pHwData, u8 type );
    #define hal_set_atim_window( _A, _ATM )
    -void hal_set_rates( phw_data_t pHwData, PUCHAR pbss_rates, u8 length, unsigned char basic_rate_set );
    +void hal_set_rates( phw_data_t pHwData, u8 *pbss_rates, u8 length, unsigned char basic_rate_set );
    #define hal_set_basic_rates( _A, _R, _L ) hal_set_rates( _A, _R, _L, TRUE )
    #define hal_set_op_rates( _A, _R, _L ) hal_set_rates( _A, _R, _L, FALSE )
    void hal_start_bss( phw_data_t pHwData, u8 mac_op_mode );
    @@ -40,19 +40,19 @@ void hal_join_request( phw_data_t pHwData, u8 bss_type ); // 0:BSS STA 1:IBSS
    void hal_stop_sync_bss( phw_data_t pHwData );
    void hal_resume_sync_bss( phw_data_t pHwData);
    void hal_set_aid( phw_data_t pHwData, u16 aid );
    -void hal_set_bssid( phw_data_t pHwData, PUCHAR pbssid );
    -void hal_get_bssid( phw_data_t pHwData, PUCHAR pbssid );
    +void hal_set_bssid( phw_data_t pHwData, u8 *pbssid );
    +void hal_get_bssid( phw_data_t pHwData, u8 *pbssid );
    void hal_set_beacon_period( phw_data_t pHwData, u16 beacon_period );
    void hal_set_listen_interval( phw_data_t pHwData, u16 listen_interval );
    void hal_set_cap_info( phw_data_t pHwData, u16 capability_info );
    -void hal_set_ssid( phw_data_t pHwData, PUCHAR pssid, u8 ssid_len );
    +void hal_set_ssid( phw_data_t pHwData, u8 *pssid, u8 ssid_len );
    void hal_set_current_channel( phw_data_t pHwData, ChanInfo channel );
    void hal_set_current_channel_ex( phw_data_t pHwData, ChanInfo channel );
    void hal_get_current_channel( phw_data_t pHwData, ChanInfo *channel );
    void hal_set_accept_broadcast( phw_data_t pHwData, u8 enable );
    void hal_set_accept_multicast( phw_data_t pHwData, u8 enable );
    void hal_set_accept_beacon( phw_data_t pHwData, u8 enable );
    -void hal_set_multicast_address( phw_data_t pHwData, PUCHAR address, u8 number );
    +void hal_set_multicast_address( phw_data_t pHwData, u8 *address, u8 number );
    u8 hal_get_accept_beacon( phw_data_t pHwData );
    void hal_stop( phw_data_t pHwData );
    void hal_halt( phw_data_t pHwData, void *ppa_data );
    @@ -97,7 +97,7 @@ void hal_surprise_remove( phw_data_t pHwData );


    void hal_rate_change( phw_data_t pHwData ); // Notify the HAL rate is changing 20060613.1
    -unsigned char hal_get_dxx_reg( phw_data_t pHwData, u16 number, PULONG pValue );
    +unsigned char hal_get_dxx_reg( phw_data_t pHwData, u16 number, u32 * pValue );
    unsigned char hal_set_dxx_reg( phw_data_t pHwData, u16 number, u32 value );
    #define hal_get_time_count( _P ) (_P->time_count/10) // return 100ms count
    #define hal_detect_error( _P ) (_P->WbUsb.DetectCount)
    @@ -116,7 +116,7 @@ unsigned char hal_idle( phw_data_t pHwData );
    #define pa_stall_execution( _A ) //OS_SLEEP( 1 )
    #define hw_get_cxx_reg( _A, _B, _C )
    #define hw_set_cxx_reg( _A, _B, _C )
    -#define hw_get_dxx_reg( _A, _B, _C ) hal_get_dxx_reg( _A, _B, (PULONG)_C )
    +#define hw_get_dxx_reg( _A, _B, _C ) hal_get_dxx_reg( _A, _B, (u32 *)_C )
    #define hw_set_dxx_reg( _A, _B, _C ) hal_set_dxx_reg( _A, _B, (u32)_C )


    diff --git a/drivers/staging/winbond/wbhal_s.h b/drivers/staging/winbond/wbhal_s.h
    index 5b862ff..2ee3f0f 100644
    --- a/drivers/staging/winbond/wbhal_s.h
    +++ b/drivers/staging/winbond/wbhal_s.h
    @@ -461,7 +461,7 @@ typedef struct _HW_DATA_T
    //================================================== ===================
    // Definition for 802.11
    //================================================== ===================
    - PUCHAR bssid_pointer; // Used by hal_get_bssid for return value
    + u8 *bssid_pointer; // Used by hal_get_bssid for return value
    u8 bssid[8];// Only 6 byte will be used. 8 byte is required for read buffer
    u8 ssid[32];// maximum ssid length is 32 byte

    @@ -486,7 +486,7 @@ typedef struct _HW_DATA_T
    u32 CurrentRadioSw; // 20060320.2 0:On 1:Off
    u32 CurrentRadioHw; // 20060825 0:On 1:Off

    - PUCHAR power_save_point; // Used by hal_get_power_save_mode for return value
    + u8 *power_save_point; // Used by hal_get_power_save_mode for return value
    u8 cwmin;
    u8 desired_power_save;
    u8 dtim;// Is running dtim
    diff --git a/drivers/staging/winbond/wblinux.c b/drivers/staging/winbond/wblinux.c
    index 2eade5a..51dad95 100644
    --- a/drivers/staging/winbond/wblinux.c
    +++ b/drivers/staging/winbond/wblinux.c
    @@ -25,7 +25,7 @@ EncapAtomicInc(PADAPTER Adapter, void* pAtomic)
    {
    PWBLINUX pWbLinux = &Adapter->WbLinux;
    u32 ltmp;
    - PULONG pltmp = (PULONG)pAtomic;
    + u32 * pltmp = (u32 *)pAtomic;
    OS_SPIN_LOCK_ACQUIRED( &pWbLinux->AtomicSpinLock );
    (*pltmp)++;
    ltmp = (*pltmp);
    @@ -38,7 +38,7 @@ EncapAtomicDec(PADAPTER Adapter, void* pAtomic)
    {
    PWBLINUX pWbLinux = &Adapter->WbLinux;
    u32 ltmp;
    - PULONG pltmp = (PULONG)pAtomic;
    + u32 * pltmp = (u32 *)pAtomic;
    OS_SPIN_LOCK_ACQUIRED( &pWbLinux->AtomicSpinLock );
    (*pltmp)--;
    ltmp = (*pltmp);
    @@ -142,7 +142,8 @@ unsigned char
    WbWLanInitialize(PADAPTER Adapter)
    {
    phw_data_t pHwData;
    - PUCHAR pMacAddr, pMacAddr2;
    + u8 *pMacAddr;
    + u8 *pMacAddr2;
    u32 InitStep = 0;
    u8 EEPROM_region;
    u8 HwRadioOff;
    --
    1.6.0.2

    --
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

  11. [PATCH 09/42] Staging: SLICOSS: remove duplicated #include's

    From: Huang Weiyi

    Removed duplicated #include's in drivers/staging/slicoss/slicoss.c.
    linux/delay.h
    linux/etherdevice.h
    linux/init.h
    linux/netdevice.h
    linux/pci.h
    linux/skbuff.h
    linux/slab.h
    linux/string.h

    Signed-off-by: Huang Weiyi
    Signed-off-by: Greg Kroah-Hartman
    ---
    drivers/staging/slicoss/slicoss.c | 8 --------
    1 files changed, 0 insertions(+), 8 deletions(-)

    diff --git a/drivers/staging/slicoss/slicoss.c b/drivers/staging/slicoss/slicoss.c
    index 47b0ae1..69f3ea2 100644
    --- a/drivers/staging/slicoss/slicoss.c
    +++ b/drivers/staging/slicoss/slicoss.c
    @@ -96,17 +96,9 @@
    #include

    #include
    -#include
    -#include
    -#include
    -#include
    #include
    -#include
    -#include
    #include
    #include
    -#include
    -#include
    #include

    #include
    --
    1.6.0.2

    --
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

  12. [PATCH 01/42] Staging: add pcc-acpi driver

    From: Hiroshi Miura

    Adds the pcc-acpi driver to the staging tree.

    From: Hiroshi Miura
    Cc: YOKOTA Hiroshi
    Signed-off-by: Greg Kroah-Hartman
    ---
    drivers/staging/Kconfig | 2 +
    drivers/staging/Makefile | 1 +
    drivers/staging/pcc-acpi/Kconfig | 11 +
    drivers/staging/pcc-acpi/Makefile | 1 +
    drivers/staging/pcc-acpi/TODO | 7 +
    drivers/staging/pcc-acpi/pcc-acpi.c | 974 +++++++++++++++++++++++++++++++++++
    6 files changed, 996 insertions(+), 0 deletions(-)
    create mode 100644 drivers/staging/pcc-acpi/Kconfig
    create mode 100644 drivers/staging/pcc-acpi/Makefile
    create mode 100644 drivers/staging/pcc-acpi/TODO
    create mode 100644 drivers/staging/pcc-acpi/pcc-acpi.c

    diff --git a/drivers/staging/Kconfig b/drivers/staging/Kconfig
    index 2a79dec..65a86b7 100644
    --- a/drivers/staging/Kconfig
    +++ b/drivers/staging/Kconfig
    @@ -43,4 +43,6 @@ source "drivers/staging/echo/Kconfig"

    source "drivers/staging/at76_usb/Kconfig"

    +source "drivers/staging/pcc-acpi/Kconfig"
    +
    endif # STAGING
    diff --git a/drivers/staging/Makefile b/drivers/staging/Makefile
    index 325bca4..e5c4a38 100644
    --- a/drivers/staging/Makefile
    +++ b/drivers/staging/Makefile
    @@ -13,3 +13,4 @@ obj-$(CONFIG_W35UND) += winbond/
    obj-$(CONFIG_PRISM2_USB) += wlan-ng/
    obj-$(CONFIG_ECHO) += echo/
    obj-$(CONFIG_USB_ATMEL) += at76_usb/
    +obj-$(CONFIG_PCC_ACPI) += pcc-acpi/
    diff --git a/drivers/staging/pcc-acpi/Kconfig b/drivers/staging/pcc-acpi/Kconfig
    new file mode 100644
    index 0000000..6720d40
    --- /dev/null
    +++ b/drivers/staging/pcc-acpi/Kconfig
    @@ -0,0 +1,11 @@
    +config PCC_ACPI
    + tristate "Panasonic ACPI Hotkey support"
    + depends on ACPI
    + default n
    + ---help---
    + This driver provides support for Panasonic hotkeys through the
    + ACPI interface. This works for the Panasonic R1 (N variant),
    + R2, R3, T2, W2, and Y2 laptops.
    +
    + To compile this driver as a module, choose M here. The module
    + will be called pcc-acpi.
    diff --git a/drivers/staging/pcc-acpi/Makefile b/drivers/staging/pcc-acpi/Makefile
    new file mode 100644
    index 0000000..f93b29e
    --- /dev/null
    +++ b/drivers/staging/pcc-acpi/Makefile
    @@ -0,0 +1 @@
    +obj-$(CONFIG_PCC_ACPI) += pcc-acpi.o
    diff --git a/drivers/staging/pcc-acpi/TODO b/drivers/staging/pcc-acpi/TODO
    new file mode 100644
    index 0000000..fab2409
    --- /dev/null
    +++ b/drivers/staging/pcc-acpi/TODO
    @@ -0,0 +1,7 @@
    +TODO:
    + - Lindent fixes
    + - checkpatch.pl fixes
    + - verify that the acpi interface is correct
    + - remove /proc dependancy if needed (not sure yet.)
    +
    +Please send any patches for this driver to Greg Kroah-Hartman
    diff --git a/drivers/staging/pcc-acpi/pcc-acpi.c b/drivers/staging/pcc-acpi/pcc-acpi.c
    new file mode 100644
    index 0000000..ffda32a
    --- /dev/null
    +++ b/drivers/staging/pcc-acpi/pcc-acpi.c
    @@ -0,0 +1,974 @@
    +/*
    + * Panasonic HotKey and lcd brightness control Extra driver
    + * (C) 2004 Hiroshi Miura
    + * (C) 2004 NTT DATA Intellilink Co. http://www.intellilink.co.jp/
    + * (C) YOKOTA Hiroshi
    + * (C) 2004 David Bronaugh
    + *
    + * derived from toshiba_acpi.c, Copyright (C) 2002-2004 John Belmonte
    + *
    + * This program is free software; you can redistribute it and/or modify
    + * it under the terms of the GNU General Public License version 2 as
    + * publicshed by the Free Software Foundation.
    + *
    + * This program is distributed in the hope that it will be useful,
    + * but WITHOUT ANY WARRANTY; without even the implied warranty of
    + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
    + * GNU General Public License for more details.
    + *
    + * You should have received a copy of the GNU General Public License
    + * along with this program; if not, write to the Free Software
    + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
    + *
    + *---------------------------------------------------------------------------
    + *
    + * ChangeLog:
    + *
    + * Nov.04, 2006 Hiroshi Miura
    + * -v0.9 remove warning about section reference.
    + * remove acpi_os_free
    + * add /proc/acpi/pcc/brightness interface to allow HAL to access.
    + * merge dbronaugh's enhancement
    + * Aug.17, 2004 David Bronaugh (dbronaugh)
    + * - Added screen brightness setting interface
    + * Thanks to the FreeBSD crew (acpi_panasonic.c authors)
    + * for the ideas I needed to accomplish it
    + *
    + * May.29, 2006 Hiroshi Miura
    + * -v0.8.4 follow to change keyinput structure
    + * thanks Fabian Yamaguchi ,
    + * Jacob Bower and
    + * Hiroshi Yokota for providing solutions.
    + *
    + * Oct.02, 2004 Hiroshi Miura
    + * -v0.8.2 merge code of YOKOTA Hiroshi .
    + * Add sticky key mode interface.
    + * Refactoring acpi_pcc_generete_keyinput().
    + *
    + * Sep.15, 2004 Hiroshi Miura
    + * -v0.8 Generate key input event on input subsystem.
    + * This is based on yet another driver written by Ryuta Nakanishi.
    + *
    + * Sep.10, 2004 Hiroshi Miura
    + * -v0.7 Change proc interface functions using seq_file
    + * facility as same as other ACPI drivers.
    + *
    + * Aug.28, 2004 Hiroshi Miura
    + * -v0.6.4 Fix a silly error with status checking
    + *
    + * Aug.25, 2004 Hiroshi Miura
    + * -v0.6.3 replace read_acpi_int by standard function acpi_evaluate_integer
    + * some clean up and make smart copyright notice.
    + * fix return value of pcc_acpi_get_key()
    + * fix checking return value of acpi_bus_register_driver()
    + *
    + * Aug.22, 2004 David Bronaugh
    + * -v0.6.2 Add check on ACPI data (num_sifr)
    + * Coding style cleanups, better error messages/handling
    + * Fixed an off-by-one error in memory allocation
    + *
    + * Aug.21, 2004 David Bronaugh
    + * -v0.6.1 Fix a silly error with status checking
    + *
    + * Aug.20, 2004 David Bronaugh
    + * - v0.6 Correct brightness controls to reflect reality
    + * based on information gleaned by Hiroshi Miura
    + * and discussions with Hiroshi Miura
    + *
    + * Aug.10, 2004 Hiroshi Miura
    + * - v0.5 support LCD brightness control
    + * based on the disclosed information by MEI.
    + *
    + * Jul.25, 2004 Hiroshi Miura
    + * - v0.4 first post version
    + * add function to retrive SIFR
    + *
    + * Jul.24, 2004 Hiroshi Miura
    + * - v0.3 get proper status of hotkey
    + *
    + * Jul.22, 2004 Hiroshi Miura
    + * - v0.2 add HotKey handler
    + *
    + * Jul.17, 2004 Hiroshi Miura
    + * - v0.1 start from toshiba_acpi driver written by John Belmonte
    + *
    + */
    +
    +#define ACPI_PCC_VERSION "0.9"
    +
    +#include
    +#include
    +#include
    +#include
    +#include
    +#include
    +#include
    +#include
    +#include
    +#include
    +#include
    +#include
    +
    +
    +/************************************************** ***********************
    + * "seq" file template definition.
    + */
    +/* "seq" initializer */
    +#define SEQ_OPEN_FS(_open_func_name_, _show_func_name_) \
    +static int _open_func_name_(struct inode *inode, struct file *file) \
    +{ \
    + return single_open(file, _show_func_name_, PDE(inode)->data); \
    +}
    +
    +/*-------------------------------------------------------------------------
    + * "seq" fops template for read-only files.
    + */
    +#define SEQ_FILEOPS_R(_open_func_name_) \
    +{ \
    + .open = _open_func_name_, \
    + .read = seq_read, \
    + .llseek = seq_lseek, \
    + .release = single_release, \
    +}
    +
    +/*------------------------------------------------------------------------
    + * "seq" fops template for read-write files.
    + */
    +#define SEQ_FILEOPS_RW(_open_func_name_, _write_func_name_) \
    +{ \
    + .open = _open_func_name_ , \
    + .read = seq_read, \
    + .write = _write_func_name_, \
    + .llseek = seq_lseek, \
    + .release = single_release, \
    +}
    +
    +/*
    + * "seq" file template definition ended.
    + ************************************************** *************************
    + */
    +#ifndef ACPI_HOTKEY_COMPONENT
    +#define ACPI_HOTKEY_COMPONENT 0x10000000
    +#endif
    +
    +#define _COMPONENT ACPI_HOTKEY_COMPONENT
    +ACPI_MODULE_NAME("pcc_acpi")
    +
    +MODULE_AUTHOR("Hiroshi Miura");
    +MODULE_DESCRIPTION("ACPI HotKey driver for Panasonic Lets Note laptops");
    +MODULE_LICENSE("GPL");
    +
    +#define LOGPREFIX "pcc_acpi: "
    +
    +/************************************************** **
    + * Define ACPI PATHs
    + ************************************************** **/
    +/* Lets note hotkeys */
    +#define METHOD_HKEY_QUERY "HINF"
    +#define METHOD_HKEY_SQTY "SQTY"
    +#define METHOD_HKEY_SINF "SINF"
    +#define METHOD_HKEY_SSET "SSET"
    +#define HKEY_NOTIFY 0x80
    +
    +/* for brightness control */
    +#define LCD_MAX_BRIGHTNESS 255
    +/* This may be magical -- beware */
    +#define LCD_BRIGHTNESS_INCREMENT 17
    +/* Registers of SINF */
    +#define SINF_LCD_BRIGHTNESS 4
    +
    +/************************************************** *****************
    + *
    + * definitions for /proc/ interface
    + *
    + ************************************************** *****************/
    +#define ACPI_PCC_DRIVER_NAME "PCC Extra Driver"
    +#define ACPI_PCC_DEVICE_NAME "PCCExtra"
    +#define ACPI_PCC_CLASS "pcc"
    +#define PROC_PCC ACPI_PCC_CLASS
    +
    +#define ACPI_PCC_INPUT_PHYS "panasonic/hkey0"
    +
    +/* This is transitional definition */
    +#ifndef KEY_BATT
    +# define KEY_BATT 227
    +#endif
    +
    +#define PROC_STR_MAX_LEN 8
    +
    +/* LCD_TYPEs: 0 = Normal, 1 = Semi-transparent
    + ENV_STATEs: Normal temp=0x01, High temp=0x81, N/A=0x00
    +*/
    +enum SINF_BITS { SINF_NUM_BATTERIES = 0,
    + SINF_LCD_TYPE, /* 1 */
    + SINF_AC_MAX_BRIGHT, SINF_AC_MIN_BRIGHT, SINF_AC_CUR_BRIGHT, /* 2, 3, 4 */
    + /* 4 = R1 only handle SINF_AC_CUR_BRIGHT as SINF_CUR_BRIGHT and don't know AC state */
    + SINF_DC_MAX_BRIGHT, SINF_DC_MIN_BRIGHT, SINF_DC_CUR_BRIGHT, /* 5, 6, 7 */
    + SINF_MUTE,
    + SINF_RESERVED, SINF_ENV_STATE, /* 9, 10 */
    + SINF_STICKY_KEY = 0x80,
    +};
    +
    +static int acpi_pcc_hotkey_add(struct acpi_device *device);
    +static int acpi_pcc_hotkey_remove(struct acpi_device *device, int type);
    +static int acpi_pcc_hotkey_resume(struct acpi_device *device);
    +
    +static const struct acpi_device_id pcc_device_ids[] = {
    + {"MAT0012", 0},
    + {"MAT0013", 0},
    + {"MAT0018", 0},
    + {"MAT0019", 0},
    + {"", 0},
    +};
    +MODULE_DEVICE_TABLE(acpi, pcc_device_ids);
    +
    +static struct acpi_driver acpi_pcc_driver = {
    + .name = ACPI_PCC_DRIVER_NAME,
    + .class = ACPI_PCC_CLASS,
    + .ids = pcc_device_ids,
    + .ops = {
    + .add = acpi_pcc_hotkey_add,
    + .remove = acpi_pcc_hotkey_remove,
    + .resume = acpi_pcc_hotkey_resume,
    + },
    +};
    +
    +struct acpi_hotkey {
    + acpi_handle handle;
    + struct acpi_device *device;
    + struct proc_dir_entry *proc_dir_entry;
    + unsigned long num_sifr;
    + unsigned long status;
    + struct input_dev *input_dev;
    + int sticky_mode;
    +};
    +
    +struct pcc_keyinput {
    + struct acpi_hotkey *hotkey;
    + int key_mode;
    +};
    +
    +/* --------------------------------------------------------------------------
    + method access functions
    + -------------------------------------------------------------------------- */
    +static int acpi_pcc_write_sset(struct acpi_hotkey *hotkey, int func, int val)
    +{
    + union acpi_object in_objs[] = {
    + { .integer.type = ACPI_TYPE_INTEGER,
    + .integer.value = func, },
    + { .integer.type = ACPI_TYPE_INTEGER,
    + .integer.value = val, },
    + };
    + struct acpi_object_list params = {
    + .count = ARRAY_SIZE(in_objs),
    + .pointer = in_objs,
    + };
    + acpi_status status = AE_OK;
    +
    + ACPI_FUNCTION_TRACE("acpi_pcc_write_sset");
    +
    + status = acpi_evaluate_object(hotkey->handle, METHOD_HKEY_SSET, &params, NULL);
    +
    + return_VALUE(status == AE_OK);
    +}
    +
    +static inline int acpi_pcc_get_sqty(struct acpi_device *device)
    +{
    + unsigned long s;
    + acpi_status status;
    +
    + ACPI_FUNCTION_TRACE("acpi_pcc_get_sqty");
    +
    + status = acpi_evaluate_integer(device->handle, METHOD_HKEY_SQTY, NULL, &s);
    + if (ACPI_SUCCESS(status)) {
    + return_VALUE(s);
    + } else {
    + ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
    + "evaluation error HKEY.SQTY\n"));
    + return_VALUE(-EINVAL);
    + }
    +}
    +
    +static int acpi_pcc_retrieve_biosdata(struct acpi_hotkey *hotkey, u32* sinf)
    +{
    + acpi_status status;
    + struct acpi_buffer buffer = {ACPI_ALLOCATE_BUFFER, NULL};
    + union acpi_object *hkey = NULL;
    + int i;
    +
    + ACPI_FUNCTION_TRACE("acpi_pcc_retrieve_biosdata");
    +
    + status = acpi_evaluate_object(hotkey->handle, METHOD_HKEY_SINF, 0 , &buffer);
    + if (ACPI_FAILURE(status)) {
    + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "evaluation error HKEY.SINF\n"));
    + return_VALUE(0);
    + }
    +
    + hkey = buffer.pointer;
    + if (!hkey || (hkey->type != ACPI_TYPE_PACKAGE)) {
    + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Invalid HKEY.SINF\n"));
    + goto end;
    + }
    +
    + if (hotkey->num_sifr < hkey->package.count) {
    + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "SQTY reports bad SINF length\n"));
    + status = AE_ERROR;
    + goto end;
    + }
    +
    + for (i = 0; i < hkey->package.count; i++) {
    + union acpi_object *element = &(hkey->package.elements[i]);
    + if (likely(element->type == ACPI_TYPE_INTEGER)) {
    + sinf[i] = element->integer.value;
    + } else {
    + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Invalid HKEY.SINF data\n"));
    + }
    + }
    + sinf[hkey->package.count] = -1;
    +
    +end:
    + kfree(buffer.pointer);
    + return_VALUE(status == AE_OK);
    +}
    +
    +static int acpi_pcc_read_sinf_field(struct seq_file *seq, int field)
    +{
    + struct acpi_hotkey *hotkey = (struct acpi_hotkey *) seq->private;
    + u32* sinf = kmalloc(sizeof(u32) * (hotkey->num_sifr + 1), GFP_KERNEL);
    +
    + ACPI_FUNCTION_TRACE("acpi_pcc_read_sinf_field");
    +
    + if (!sinf) {
    + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Couldn't allocate %li bytes\n",
    + sizeof(u32) * hotkey->num_sifr));
    + return_VALUE(0);
    + }
    +
    + if (acpi_pcc_retrieve_biosdata(hotkey, sinf)) {
    + seq_printf(seq, "%u\n", sinf[field]);
    + } else {
    + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Couldn't retrieve BIOS data\n"));
    + }
    +
    + kfree(sinf);
    + return_VALUE(0);
    +}
    +
    +/* --------------------------------------------------------------------------
    + user interface functions
    + -------------------------------------------------------------------------- */
    +/* read methods */
    +/* Sinf read methods */
    +#define PCC_SINF_READ_F(_name_, FUNC) \
    +static int _name_ (struct seq_file *seq, void *offset) \
    +{ \
    + return acpi_pcc_read_sinf_field(seq, (FUNC)); \
    +}
    +
    +PCC_SINF_READ_F(acpi_pcc_numbatteries_show, SINF_NUM_BATTERIES);
    +PCC_SINF_READ_F(acpi_pcc_lcdtype_show, SINF_LCD_TYPE);
    +PCC_SINF_READ_F(acpi_pcc_ac_brightness_max_show, SINF_AC_MAX_BRIGHT);
    +PCC_SINF_READ_F(acpi_pcc_ac_brightness_min_show, SINF_AC_MIN_BRIGHT);
    +PCC_SINF_READ_F(acpi_pcc_ac_brightness_show, SINF_AC_CUR_BRIGHT);
    +PCC_SINF_READ_F(acpi_pcc_dc_brightness_max_show, SINF_DC_MAX_BRIGHT);
    +PCC_SINF_READ_F(acpi_pcc_dc_brightness_min_show, SINF_DC_MIN_BRIGHT);
    +PCC_SINF_READ_F(acpi_pcc_dc_brightness_show, SINF_DC_CUR_BRIGHT);
    +PCC_SINF_READ_F(acpi_pcc_brightness_show, SINF_AC_CUR_BRIGHT);
    +PCC_SINF_READ_F(acpi_pcc_mute_show, SINF_MUTE);
    +
    +static int acpi_pcc_sticky_key_show(struct seq_file *seq, void *offset)
    +{
    + struct acpi_hotkey *hotkey = seq->private;
    +
    + ACPI_FUNCTION_TRACE("acpi_pcc_sticky_key_show");
    +
    + if (!hotkey || !hotkey->device) {
    + return_VALUE(0);
    + }
    +
    + seq_printf(seq, "%d\n", hotkey->sticky_mode);
    +
    + return_VALUE(0);
    +}
    +
    +static int acpi_pcc_keyinput_show(struct seq_file *seq, void *offset)
    +{
    + struct acpi_hotkey *hotkey = (struct acpi_hotkey *) seq->private;
    + struct input_dev *hotk_input_dev = hotkey->input_dev;
    + struct pcc_keyinput *keyinput = input_get_drvdata(hotk_input_dev);
    +
    + ACPI_FUNCTION_TRACE("acpi_pcc_keyinput_show");
    +
    + seq_printf(seq, "%d\n", keyinput->key_mode);
    +
    + return_VALUE(0);
    +}
    +
    +static int acpi_pcc_version_show(struct seq_file *seq, void *offset)
    +{
    + struct acpi_hotkey *hotkey = (struct acpi_hotkey *) seq->private;
    +
    + ACPI_FUNCTION_TRACE("acpi_pcc_version_show");
    +
    + if (!hotkey || !hotkey->device)
    + return 0;
    +
    + seq_printf(seq, "%s version %s\n", ACPI_PCC_DRIVER_NAME, ACPI_PCC_VERSION);
    + seq_printf(seq, "%li functions\n", hotkey->num_sifr);
    +
    + return_VALUE(0);
    +}
    +
    +/* write methods */
    +static ssize_t acpi_pcc_write_single_flag (struct file *file,
    + const char __user *buffer,
    + size_t count,
    + int sinf_func)
    +{
    + struct seq_file *seq = file->private_data;
    + struct acpi_hotkey *hotkey = seq->private;
    + char write_string[PROC_STR_MAX_LEN];
    + u32 val;
    +
    + ACPI_FUNCTION_TRACE("acpi_pcc_write_single_flag");
    +
    + if (!hotkey || (count > sizeof(write_string) - 1)) {
    + return_VALUE(-EINVAL);
    + }
    +
    + if (copy_from_user(write_string, buffer, count)) {
    + return_VALUE(-EFAULT);
    + }
    + write_string[count] = '\0';
    +
    + if (sscanf(write_string, "%i", &val) == 1 && (val == 0 || val == 1)) {
    + acpi_pcc_write_sset(hotkey, sinf_func, val);
    + }
    +
    + return_VALUE(count);
    +}
    +
    +static unsigned long acpi_pcc_write_brightness(struct file *file, const char __user *buffer,
    + size_t count,
    + int min_index, int max_index,
    + int cur_index)
    +{
    + struct seq_file *seq = (struct seq_file *)file->private_data;
    + struct acpi_hotkey *hotkey = (struct acpi_hotkey *)seq->private;
    + char write_string[PROC_STR_MAX_LEN];
    + u32 bright;
    + u32* sinf = kmalloc(sizeof(u32) * (hotkey->num_sifr + 1), GFP_KERNEL);
    +
    + ACPI_FUNCTION_TRACE("acpi_pcc_write_brightness");
    +
    + if (!hotkey || (count > sizeof(write_string) - 1))
    + return_VALUE(-EINVAL);
    +
    + if (!sinf) {
    + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Couldn't allocate %li bytes\n",
    + sizeof(u32) * hotkey->num_sifr));
    + return_VALUE(-EFAULT);
    + }
    +
    + if (copy_from_user(write_string, buffer, count))
    + return_VALUE(-EFAULT);
    +
    + write_string[count] = '\0';
    +
    + if (!acpi_pcc_retrieve_biosdata(hotkey, sinf)) {
    + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Couldn't retrieve BIOS data\n"));
    + goto end;
    + }
    +
    + if (sscanf(write_string, "%i", &bright) == 1 &&
    + bright >= sinf[min_index] && bright <= sinf[max_index]) {
    + acpi_pcc_write_sset(hotkey, cur_index, bright);
    + }
    +
    +end:
    + kfree(sinf);
    + return_VALUE(count);
    +}
    +
    +static ssize_t acpi_pcc_write_ac_brightness(struct file *file, const char __user *buffer,
    + size_t count, loff_t *ppos)
    +{
    + return acpi_pcc_write_brightness(file, buffer, count, SINF_AC_MIN_BRIGHT,
    + SINF_AC_MAX_BRIGHT,
    + SINF_AC_CUR_BRIGHT);
    +}
    +
    +static ssize_t acpi_pcc_write_dc_brightness(struct file *file, const char __user *buffer,
    + size_t count, loff_t *ppos)
    +{
    + return acpi_pcc_write_brightness(file, buffer, count, SINF_DC_MIN_BRIGHT,
    + SINF_DC_MAX_BRIGHT,
    + SINF_DC_CUR_BRIGHT);
    +}
    +
    +static ssize_t acpi_pcc_write_no_brightness(struct file *file, const char __user *buffer,
    + size_t count, loff_t *ppos)
    +{
    + return acpi_pcc_write_brightness(file, buffer, count, SINF_AC_MIN_BRIGHT,
    + SINF_AC_MAX_BRIGHT,
    + SINF_AC_CUR_BRIGHT);
    +}
    +
    +static ssize_t acpi_pcc_write_mute (struct file *file,
    + const char __user *buffer,
    + size_t count, loff_t *ppos)
    +{
    + return acpi_pcc_write_single_flag(file, buffer, count, SINF_MUTE);
    +}
    +
    +static ssize_t acpi_pcc_write_sticky_key (struct file *file,
    + const char __user *buffer,
    + size_t count, loff_t *ppos)
    +{
    + return acpi_pcc_write_single_flag(file, buffer, count, SINF_STICKY_KEY);
    +}
    +
    +static ssize_t acpi_pcc_write_keyinput(struct file *file, const char __user *buffer,
    + size_t count, loff_t *ppos)
    +{
    + struct seq_file *seq = (struct seq_file *)file->private_data;
    + struct acpi_hotkey *hotkey = (struct acpi_hotkey *)seq->private;
    + struct pcc_keyinput *keyinput;
    + char write_string[PROC_STR_MAX_LEN];
    + int key_mode;
    +
    + ACPI_FUNCTION_TRACE("acpi_pcc_write_keyinput");
    +
    + if (!hotkey || (count > sizeof(write_string) - 1))
    + return_VALUE(-EINVAL);
    +
    + if (copy_from_user(write_string, buffer, count))
    + return_VALUE(-EFAULT);
    +
    + write_string[count] = '\0';
    +
    + if (sscanf(write_string, "%i", &key_mode) == 1 && (key_mode == 0 || key_mode == 1)) {
    + keyinput = (struct pcc_keyinput *)input_get_drvdata(hotkey->input_dev);
    + keyinput->key_mode = key_mode;
    + }
    +
    + return_VALUE(count);
    +}
    +
    +/* --------------------------------------------------------------------------
    + hotkey driver
    + -------------------------------------------------------------------------- */
    +static void acpi_pcc_generete_keyinput(struct acpi_hotkey *hotkey)
    +{
    + struct input_dev *hotk_input_dev = hotkey->input_dev;
    + struct pcc_keyinput *keyinput = input_get_drvdata(hotk_input_dev);
    + int hinf = hotkey->status;
    + int key_code, hkey_num;
    + const int key_map[] = {
    + /* 0 */ -1,
    + /* 1 */ KEY_BRIGHTNESSDOWN,
    + /* 2 */ KEY_BRIGHTNESSUP,
    + /* 3 */ -1, /* vga/lcd switch event is not occur on hotkey driver. */
    + /* 4 */ KEY_MUTE,
    + /* 5 */ KEY_VOLUMEDOWN,
    + /* 6 */ KEY_VOLUMEUP,
    + /* 7 */ KEY_SLEEP,
    + /* 8 */ -1, /* Change CPU boost: do nothing */
    + /* 9 */ KEY_BATT,
    + /* 10 */ KEY_SUSPEND,
    + };
    +
    + ACPI_FUNCTION_TRACE("acpi_pcc_generete_keyinput");
    +
    + if (keyinput->key_mode == 0) { return_VOID; }
    +
    + hkey_num = hinf & 0xf;
    +
    + if (( 0 > hkey_num ) ||
    + (hkey_num > ARRAY_SIZE(key_map))) {
    + ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
    + "hotkey number out of range: %d\n",
    + hkey_num));
    + return_VOID;
    + }
    +
    + key_code = key_map[hkey_num];
    +
    + if (key_code != -1) {
    + int pushed = (hinf & 0x80) ? TRUE : FALSE;
    +
    + input_report_key(hotk_input_dev, key_code, pushed);
    + input_sync(hotk_input_dev);
    + }
    +}
    +
    +static int acpi_pcc_hotkey_get_key(struct acpi_hotkey *hotkey)
    +{
    + unsigned long result;
    + acpi_status status = AE_OK;
    +
    + ACPI_FUNCTION_TRACE("acpi_pcc_hotkey_get_key");
    +
    + status = acpi_evaluate_integer(hotkey->handle, METHOD_HKEY_QUERY, NULL, &result);
    + if (likely(ACPI_SUCCESS(status))) {
    + hotkey->status = result;
    + } else {
    + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "error getting hotkey status\n"));
    + }
    +
    + return_VALUE(status == AE_OK);
    +}
    +
    +void acpi_pcc_hotkey_notify(acpi_handle handle, u32 event, void *data)
    +{
    + struct acpi_hotkey *hotkey = (struct acpi_hotkey *) data;
    +
    + ACPI_FUNCTION_TRACE("acpi_pcc_hotkey_notify");
    +
    + switch(event) {
    + case HKEY_NOTIFY:
    + if (acpi_pcc_hotkey_get_key(hotkey)) {
    + /* generate event like '"pcc HKEY 00000080 00000084"' when Fn+F4 pressed */
    + acpi_bus_generate_proc_event(hotkey->device, event, hotkey->status);
    + }
    + acpi_pcc_generete_keyinput(hotkey);
    + break;
    + default:
    + /* nothing to do */
    + break;
    + }
    + return_VOID;
    +}
    +
    +/* --------------------------------------------------------------------------
    + FS Interface (/proc)
    + -------------------------------------------------------------------------- */
    +/* oepn proc file fs*/
    +SEQ_OPEN_FS(acpi_pcc_dc_brightness_open_fs, acpi_pcc_dc_brightness_show);
    +SEQ_OPEN_FS(acpi_pcc_numbatteries_open_fs, acpi_pcc_numbatteries_show);
    +SEQ_OPEN_FS(acpi_pcc_lcdtype_open_fs, acpi_pcc_lcdtype_show);
    +SEQ_OPEN_FS(acpi_pcc_ac_brightness_max_open_fs, acpi_pcc_ac_brightness_max_show);
    +SEQ_OPEN_FS(acpi_pcc_ac_brightness_min_open_fs, acpi_pcc_ac_brightness_min_show);
    +SEQ_OPEN_FS(acpi_pcc_ac_brightness_open_fs, acpi_pcc_ac_brightness_show);
    +SEQ_OPEN_FS(acpi_pcc_dc_brightness_max_open_fs, acpi_pcc_dc_brightness_max_show);
    +SEQ_OPEN_FS(acpi_pcc_dc_brightness_min_open_fs, acpi_pcc_dc_brightness_min_show);
    +SEQ_OPEN_FS(acpi_pcc_brightness_open_fs, acpi_pcc_brightness_show);
    +SEQ_OPEN_FS(acpi_pcc_mute_open_fs, acpi_pcc_mute_show);
    +SEQ_OPEN_FS(acpi_pcc_version_open_fs, acpi_pcc_version_show);
    +SEQ_OPEN_FS(acpi_pcc_keyinput_open_fs, acpi_pcc_keyinput_show);
    +SEQ_OPEN_FS(acpi_pcc_sticky_key_open_fs, acpi_pcc_sticky_key_show);
    +
    +typedef struct file_operations fops_t;
    +static fops_t acpi_pcc_numbatteries_fops = SEQ_FILEOPS_R (acpi_pcc_numbatteries_open_fs);
    +static fops_t acpi_pcc_lcdtype_fops = SEQ_FILEOPS_R (acpi_pcc_lcdtype_open_fs);
    +static fops_t acpi_pcc_mute_fops = SEQ_FILEOPS_RW(acpi_pcc_mute_open_fs, acpi_pcc_write_mute);
    +static fops_t acpi_pcc_ac_brightness_fops = SEQ_FILEOPS_RW(acpi_pcc_ac_brightness_open_fs, acpi_pcc_write_ac_brightness);
    +static fops_t acpi_pcc_ac_brightness_max_fops = SEQ_FILEOPS_R(acpi_pcc_ac_brightness_max_open_fs);
    +static fops_t acpi_pcc_ac_brightness_min_fops = SEQ_FILEOPS_R(acpi_pcc_ac_brightness_min_open_fs);
    +static fops_t acpi_pcc_dc_brightness_fops = SEQ_FILEOPS_RW(acpi_pcc_dc_brightness_open_fs, acpi_pcc_write_dc_brightness);
    +static fops_t acpi_pcc_dc_brightness_max_fops = SEQ_FILEOPS_R(acpi_pcc_dc_brightness_max_open_fs);
    +static fops_t acpi_pcc_dc_brightness_min_fops = SEQ_FILEOPS_R(acpi_pcc_dc_brightness_min_open_fs);
    +static fops_t acpi_pcc_brightness_fops = SEQ_FILEOPS_RW(acpi_pcc_brightness_open_fs, acpi_pcc_write_no_brightness);
    +static fops_t acpi_pcc_sticky_key_fops = SEQ_FILEOPS_RW(acpi_pcc_sticky_key_open_fs, acpi_pcc_write_sticky_key);
    +static fops_t acpi_pcc_keyinput_fops = SEQ_FILEOPS_RW(acpi_pcc_keyinput_open_fs, acpi_pcc_write_keyinput);
    +static fops_t acpi_pcc_version_fops = SEQ_FILEOPS_R (acpi_pcc_version_open_fs);
    +
    +typedef struct _ProcItem
    +{
    + const char* name;
    + struct file_operations *fops;
    + mode_t flag;
    +} ProcItem;
    +
    +/* Note: These functions map *exactly* to the SINF/SSET functions */
    +ProcItem pcc_proc_items_sifr[] =
    +{
    + { "num_batteries", &acpi_pcc_numbatteries_fops, S_IRUGO },
    + { "lcd_type", &acpi_pcc_lcdtype_fops, S_IRUGO },
    + { "ac_brightness_max" , &acpi_pcc_ac_brightness_max_fops,S_IRUGO },
    + { "ac_brightness_min" , &acpi_pcc_ac_brightness_min_fops,S_IRUGO },
    + { "ac_brightness" , &acpi_pcc_ac_brightness_fops, S_IFREG | S_IRUGO | S_IWUSR },
    + { "dc_brightness_max" , &acpi_pcc_dc_brightness_max_fops,S_IRUGO },
    + { "dc_brightness_min" , &acpi_pcc_dc_brightness_min_fops,S_IRUGO },
    + { "dc_brightness" , &acpi_pcc_dc_brightness_fops, S_IFREG | S_IRUGO | S_IWUSR },
    + { "brightness" , &acpi_pcc_brightness_fops, S_IFREG | S_IRUGO | S_IWUSR },
    + { "mute", &acpi_pcc_mute_fops, S_IFREG | S_IRUGO | S_IWUSR },
    + { NULL, NULL, 0 },
    +};
    +
    +ProcItem pcc_proc_items[] =
    +{
    + { "sticky_key", &acpi_pcc_sticky_key_fops, S_IFREG | S_IRUGO | S_IWUSR },
    + { "keyinput", &acpi_pcc_keyinput_fops, S_IFREG | S_IRUGO | S_IWUSR },
    + { "version", &acpi_pcc_version_fops, S_IRUGO },
    + { NULL, NULL, 0 },
    +};
    +
    +static int acpi_pcc_add_device(struct acpi_device *device,
    + ProcItem *proc_items,
    + int num)
    +{
    + struct proc_dir_entry* proc;
    + ProcItem* item;
    + int i;
    + struct acpi_hotkey *hotkey = (struct acpi_hotkey*)acpi_driver_data(device);
    +
    + for (item = proc_items, i = 0; item->name && i < num; ++item, ++i) {
    + proc = create_proc_entry(item->name, item->flag, hotkey->proc_dir_entry);
    + if (likely(proc)) {
    + proc->proc_fops = item->fops;
    + proc->data = hotkey;
    + proc->owner = THIS_MODULE;
    + } else {
    + while (i-- > 0) {
    + item--;
    + remove_proc_entry(item->name, hotkey->proc_dir_entry);
    + }
    + return -ENODEV;
    + }
    + }
    + return 0;
    +}
    +
    +static int acpi_pcc_proc_init(struct acpi_device *device)
    +{
    + struct proc_dir_entry* acpi_pcc_dir;
    + struct acpi_hotkey *hotkey = (struct acpi_hotkey*)acpi_driver_data(device);
    + acpi_status status;
    +
    + ACPI_FUNCTION_TRACE("acpi_pcc_proc_init");
    +
    + acpi_pcc_dir = proc_mkdir(PROC_PCC, acpi_root_dir);
    +
    + if (unlikely(!acpi_pcc_dir)) {
    + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Couldn't create dir in /proc\n"));
    + return_VALUE(-ENODEV);
    + }
    +
    + acpi_pcc_dir->owner = THIS_MODULE;
    + hotkey->proc_dir_entry = acpi_pcc_dir;
    +
    + status = acpi_pcc_add_device(device, pcc_proc_items_sifr, hotkey->num_sifr);
    + status |= acpi_pcc_add_device(device, pcc_proc_items, sizeof(pcc_proc_items)/sizeof(ProcItem));
    + if (unlikely(status)) {
    + remove_proc_entry(PROC_PCC, acpi_root_dir);
    + hotkey->proc_dir_entry = NULL;
    + return_VALUE(-ENODEV);
    + }
    +
    + return_VALUE(status);
    +}
    +
    +static void acpi_pcc_remove_device(struct acpi_device *device,
    + ProcItem *proc_items,
    + int num)
    +{
    + struct acpi_hotkey *hotkey = (struct acpi_hotkey*)acpi_driver_data(device);
    + ProcItem* item;
    + int i;
    +
    + for (item = proc_items, i = 0; item->name != NULL && i < num; ++item, ++i) {
    + remove_proc_entry(item->name, hotkey->proc_dir_entry);
    + }
    +
    + return;
    +}
    +
    +/* --------------------------------------------------------------------------
    + input init
    + -------------------------------------------------------------------------- */
    +static int acpi_pcc_init_input(struct acpi_hotkey *hotkey)
    +{
    + struct input_dev *hotk_input_dev;
    + struct pcc_keyinput *pcc_keyinput;
    +
    + ACPI_FUNCTION_TRACE("acpi_pcc_init_input");
    +
    +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,15)
    + hotk_input_dev = input_allocate_device();
    + if (!hotk_input_dev) {
    + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Couldn't allocate input device for hotkey"));
    + return_VALUE(-ENOMEM);
    + }
    +#else
    + hotk_input_dev = kcalloc(1, sizeof(struct input_dev),GFP_KERNEL);
    + if (hotk_input_dev == NULL) {
    + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Couldn't allocate mem for hotkey"));
    + return_VALUE(-ENOMEM);
    + }
    +#endif
    +
    + pcc_keyinput = kcalloc(1,sizeof(struct pcc_keyinput),GFP_KERNEL);
    +
    + if (pcc_keyinput == NULL) {
    + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Couldn't allocate mem for hotkey"));
    + input_unregister_device(hotk_input_dev);
    + return_VALUE(-ENOMEM);
    + }
    +
    + hotk_input_dev->evbit[0] = BIT(EV_KEY);
    +
    + set_bit(KEY_BRIGHTNESSDOWN, hotk_input_dev->keybit);
    + set_bit(KEY_BRIGHTNESSUP, hotk_input_dev->keybit);
    + set_bit(KEY_MUTE, hotk_input_dev->keybit);
    + set_bit(KEY_VOLUMEDOWN, hotk_input_dev->keybit);
    + set_bit(KEY_VOLUMEUP, hotk_input_dev->keybit);
    + set_bit(KEY_SLEEP, hotk_input_dev->keybit);
    + set_bit(KEY_BATT, hotk_input_dev->keybit);
    + set_bit(KEY_SUSPEND, hotk_input_dev->keybit);
    +
    + hotk_input_dev->name = ACPI_PCC_DRIVER_NAME;
    + hotk_input_dev->phys = ACPI_PCC_INPUT_PHYS;
    + hotk_input_dev->id.bustype = 0x1a; /* XXX FIXME: BUS_I8042? */
    + hotk_input_dev->id.vendor = 0x0001;
    + hotk_input_dev->id.product = 0x0001;
    + hotk_input_dev->id.version = 0x0100;
    +
    + pcc_keyinput->key_mode = 1; /* default on */
    + pcc_keyinput->hotkey = hotkey;
    +
    + input_set_drvdata(hotk_input_dev, pcc_keyinput);
    +
    + hotkey->input_dev = hotk_input_dev;
    +
    +
    + input_register_device(hotk_input_dev);
    +
    + return_VALUE(0);
    +}
    +
    +/* --------------------------------------------------------------------------
    + module init
    + -------------------------------------------------------------------------- */
    +
    +static int acpi_pcc_hotkey_resume(struct acpi_device *device)
    +{
    + struct acpi_hotkey *hotkey = acpi_driver_data(device);
    + acpi_status status = AE_OK;
    +
    + ACPI_FUNCTION_TRACE("acpi_pcc_hotkey_resume");
    +
    + if (device == NULL || hotkey == NULL) { return_VALUE(-EINVAL); }
    +
    + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Sticky mode restore: %d\n", hotkey->sticky_mode));
    +
    + status = acpi_pcc_write_sset(hotkey, SINF_STICKY_KEY, hotkey->sticky_mode);
    +
    + return_VALUE(status == AE_OK ? 0 : -EINVAL);
    +}
    +
    +static int acpi_pcc_hotkey_add (struct acpi_device *device)
    +{
    + acpi_status status = AE_OK;
    + struct acpi_hotkey *hotkey = NULL;
    + int num_sifr, result;
    +
    + ACPI_FUNCTION_TRACE("acpi_pcc_hotkey_add");
    +
    + if (!device) {
    + return_VALUE(-EINVAL);
    + }
    +
    + num_sifr = acpi_pcc_get_sqty(device);
    +
    + if (num_sifr > 255) {
    + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "num_sifr too large"));
    + return_VALUE(-ENODEV);
    + }
    +
    + hotkey = kmalloc(sizeof(struct acpi_hotkey), GFP_KERNEL);
    + if (!hotkey) {
    + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Couldn't allocate mem for hotkey"));
    + return_VALUE(-ENOMEM);
    + }
    +
    + memset(hotkey, 0, sizeof(struct acpi_hotkey));
    +
    + hotkey->device = device;
    + hotkey->handle = device->handle;
    + hotkey->num_sifr = num_sifr;
    + acpi_driver_data(device) = hotkey;
    + strcpy(acpi_device_name(device), ACPI_PCC_DEVICE_NAME);
    + strcpy(acpi_device_class(device), ACPI_PCC_CLASS);
    +
    + status = acpi_install_notify_handler (
    + hotkey->handle,
    + ACPI_DEVICE_NOTIFY,
    + acpi_pcc_hotkey_notify,
    + hotkey);
    +
    + if (ACPI_FAILURE(status)) {
    + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Error installing notify handler\n"));
    + kfree(hotkey);
    + return_VALUE(-ENODEV);
    + }
    +
    + result = acpi_pcc_init_input(hotkey);
    + if (result) {
    + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Error installing keyinput handler\n"));
    + kfree(hotkey);
    + return_VALUE(result);
    + }
    +
    + return_VALUE(acpi_pcc_proc_init(device));
    +}
    +
    +static int __init acpi_pcc_init(void)
    +{
    + int result = 0;
    +
    + ACPI_FUNCTION_TRACE("acpi_pcc_init");
    +
    + if (acpi_disabled) {
    + return_VALUE(-ENODEV);
    + }
    +
    + result = acpi_bus_register_driver(&acpi_pcc_driver);
    + if (result < 0) {
    + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Error registering hotkey driver\n"));
    + return_VALUE(-ENODEV);
    + }
    +
    + return_VALUE(0);
    +}
    +
    +module_init(acpi_pcc_init);
    +
    +static int acpi_pcc_hotkey_remove(struct acpi_device *device, int type)
    +{
    + acpi_status status = AE_OK;
    + struct acpi_hotkey *hotkey = acpi_driver_data(device);
    +
    + ACPI_FUNCTION_TRACE("acpi_pcc_hotkey_remove");
    +
    + if (!device || !hotkey)
    + return_VALUE(-EINVAL);
    +
    + if (hotkey->proc_dir_entry) {
    + acpi_pcc_remove_device(device, pcc_proc_items_sifr, hotkey->num_sifr);
    + acpi_pcc_remove_device(device, pcc_proc_items, sizeof(pcc_proc_items)/sizeof(ProcItem));
    + remove_proc_entry(PROC_PCC, acpi_root_dir);
    + }
    +
    + status = acpi_remove_notify_handler(hotkey->handle,
    + ACPI_DEVICE_NOTIFY, acpi_pcc_hotkey_notify);
    +
    + if (ACPI_FAILURE(status))
    + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Error removing notify handler\n"));
    +
    + input_unregister_device(hotkey->input_dev);
    +
    + kfree(hotkey);
    + return_VALUE(status == AE_OK);
    +}
    +
    +static void __exit acpi_pcc_exit(void)
    +{
    + ACPI_FUNCTION_TRACE("acpi_pcc_exit");
    +
    + acpi_bus_unregister_driver(&acpi_pcc_driver);
    +
    + return_VOID;
    +}
    +
    +module_exit(acpi_pcc_exit);
    --
    1.6.0.2

    --
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

  13. [PATCH 11/42] Staging: wlan-ng: prism2: remove duplicated #include

    From: Huang Weiyi

    Removed duplicated #include "wlan_compat.h" in
    drivers/staging/wlan-ng/prism2mib.c.

    Signed-off-by: Huang Weiyi
    Signed-off-by: Greg Kroah-Hartman
    ---
    drivers/staging/wlan-ng/prism2mib.c | 2 --
    1 files changed, 0 insertions(+), 2 deletions(-)

    diff --git a/drivers/staging/wlan-ng/prism2mib.c b/drivers/staging/wlan-ng/prism2mib.c
    index 268fd9b..eac06f7 100644
    --- a/drivers/staging/wlan-ng/prism2mib.c
    +++ b/drivers/staging/wlan-ng/prism2mib.c
    @@ -90,8 +90,6 @@
    #include
    //#endif

    -#include "wlan_compat.h"
    -
    /*================================================= ===============*/
    /* Project Includes */

    --
    1.6.0.2

    --
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

  14. [PATCH 06/42] staging: fix potential build error in slicoss driver

    From: Mariusz Kozlowski

    This hides under DEBUG_REGISTER_TRACE so probably
    not visible to many people.

    Signed-off-by: Mariusz Kozlowski
    Signed-off-by: Greg Kroah-Hartman
    ---
    drivers/staging/slicoss/slicoss.c | 1 -
    1 files changed, 0 insertions(+), 1 deletions(-)

    diff --git a/drivers/staging/slicoss/slicoss.c b/drivers/staging/slicoss/slicoss.c
    index b61ac4b..47b0ae1 100644
    --- a/drivers/staging/slicoss/slicoss.c
    +++ b/drivers/staging/slicoss/slicoss.c
    @@ -275,7 +275,6 @@ static void slic_dbg_register_trace(struct adapter *adapter,
    card->reg_value[i], card->reg_valueh[i]);
    }
    }
    -}
    #endif

    static void slic_init_adapter(struct net_device *netdev,
    --
    1.6.0.2

    --
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

  15. [PATCH 13/42] Staging: go7007: remove unused #include <version.h>

    From: Huang Weiyi

    The file(s) below do not use LINUX_VERSION_CODE nor KERNEL_VERSION.
    drivers/staging/go7007/go7007-driver.c
    drivers/staging/go7007/go7007-fw.c
    drivers/staging/go7007/go7007-i2c.c
    drivers/staging/go7007/go7007-usb.c
    drivers/staging/go7007/snd-go7007.c
    drivers/staging/go7007/wis-ov7640.c
    drivers/staging/go7007/wis-saa7113.c
    drivers/staging/go7007/wis-saa7115.c
    drivers/staging/go7007/wis-sony-tuner.c
    drivers/staging/go7007/wis-tw2804.c
    drivers/staging/go7007/wis-tw9903.c
    drivers/staging/go7007/wis-uda1342.c

    This patch removes the said #include .

    Signed-off-by: Huang Weiyi
    Signed-off-by: Greg Kroah-Hartman
    ---
    drivers/staging/go7007/go7007-driver.c | 1 -
    drivers/staging/go7007/go7007-fw.c | 1 -
    drivers/staging/go7007/go7007-i2c.c | 1 -
    drivers/staging/go7007/go7007-usb.c | 1 -
    drivers/staging/go7007/snd-go7007.c | 1 -
    drivers/staging/go7007/wis-ov7640.c | 1 -
    drivers/staging/go7007/wis-saa7113.c | 1 -
    drivers/staging/go7007/wis-saa7115.c | 1 -
    drivers/staging/go7007/wis-sony-tuner.c | 1 -
    drivers/staging/go7007/wis-tw2804.c | 1 -
    drivers/staging/go7007/wis-tw9903.c | 1 -
    drivers/staging/go7007/wis-uda1342.c | 1 -
    12 files changed, 0 insertions(+), 12 deletions(-)

    diff --git a/drivers/staging/go7007/go7007-driver.c b/drivers/staging/go7007/go7007-driver.c
    index 81ae4b0..e4ead96 100644
    --- a/drivers/staging/go7007/go7007-driver.c
    +++ b/drivers/staging/go7007/go7007-driver.c
    @@ -16,7 +16,6 @@
    */

    #include
    -#include
    #include
    #include
    #include
    diff --git a/drivers/staging/go7007/go7007-fw.c b/drivers/staging/go7007/go7007-fw.c
    index c2aea10..a0e17b0 100644
    --- a/drivers/staging/go7007/go7007-fw.c
    +++ b/drivers/staging/go7007/go7007-fw.c
    @@ -26,7 +26,6 @@

    #include
    #include
    -#include
    #include
    #include
    #include
    diff --git a/drivers/staging/go7007/go7007-i2c.c b/drivers/staging/go7007/go7007-i2c.c
    index 10baae3..cd55b76 100644
    --- a/drivers/staging/go7007/go7007-i2c.c
    +++ b/drivers/staging/go7007/go7007-i2c.c
    @@ -15,7 +15,6 @@
    * Inc., 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
    */

    -#include
    #include
    #include
    #include
    diff --git a/drivers/staging/go7007/go7007-usb.c b/drivers/staging/go7007/go7007-usb.c
    index d4ed6d2..3f5ee34 100644
    --- a/drivers/staging/go7007/go7007-usb.c
    +++ b/drivers/staging/go7007/go7007-usb.c
    @@ -16,7 +16,6 @@
    */

    #include
    -#include
    #include
    #include
    #include
    diff --git a/drivers/staging/go7007/snd-go7007.c b/drivers/staging/go7007/snd-go7007.c
    index 382740c..a7de401 100644
    --- a/drivers/staging/go7007/snd-go7007.c
    +++ b/drivers/staging/go7007/snd-go7007.c
    @@ -17,7 +17,6 @@

    #include
    #include
    -#include
    #include
    #include
    #include
    diff --git a/drivers/staging/go7007/wis-ov7640.c b/drivers/staging/go7007/wis-ov7640.c
    index f5f11e9..2f9efca 100644
    --- a/drivers/staging/go7007/wis-ov7640.c
    +++ b/drivers/staging/go7007/wis-ov7640.c
    @@ -17,7 +17,6 @@

    #include
    #include
    -#include
    #include
    #include

    diff --git a/drivers/staging/go7007/wis-saa7113.c b/drivers/staging/go7007/wis-saa7113.c
    index c1aff1b..1168972 100644
    --- a/drivers/staging/go7007/wis-saa7113.c
    +++ b/drivers/staging/go7007/wis-saa7113.c
    @@ -17,7 +17,6 @@

    #include
    #include
    -#include
    #include
    #include
    #include
    diff --git a/drivers/staging/go7007/wis-saa7115.c b/drivers/staging/go7007/wis-saa7115.c
    index 5c94c88..59417a7 100644
    --- a/drivers/staging/go7007/wis-saa7115.c
    +++ b/drivers/staging/go7007/wis-saa7115.c
    @@ -17,7 +17,6 @@

    #include
    #include
    -#include
    #include
    #include
    #include
    diff --git a/drivers/staging/go7007/wis-sony-tuner.c b/drivers/staging/go7007/wis-sony-tuner.c
    index 5997fb4..5a91ee4 100644
    --- a/drivers/staging/go7007/wis-sony-tuner.c
    +++ b/drivers/staging/go7007/wis-sony-tuner.c
    @@ -17,7 +17,6 @@

    #include
    #include
    -#include
    #include
    #include
    #include
    diff --git a/drivers/staging/go7007/wis-tw2804.c b/drivers/staging/go7007/wis-tw2804.c
    index 27fe4d0..57b8f2b 100644
    --- a/drivers/staging/go7007/wis-tw2804.c
    +++ b/drivers/staging/go7007/wis-tw2804.c
    @@ -17,7 +17,6 @@

    #include
    #include
    -#include
    #include
    #include
    #include
    diff --git a/drivers/staging/go7007/wis-tw9903.c b/drivers/staging/go7007/wis-tw9903.c
    index d8e4196..40627b2 100644
    --- a/drivers/staging/go7007/wis-tw9903.c
    +++ b/drivers/staging/go7007/wis-tw9903.c
    @@ -17,7 +17,6 @@

    #include
    #include
    -#include
    #include
    #include
    #include
    diff --git a/drivers/staging/go7007/wis-uda1342.c b/drivers/staging/go7007/wis-uda1342.c
    index a0894e3..555645c 100644
    --- a/drivers/staging/go7007/wis-uda1342.c
    +++ b/drivers/staging/go7007/wis-uda1342.c
    @@ -17,7 +17,6 @@

    #include
    #include
    -#include
    #include
    #include
    #include
    --
    1.6.0.2

    --
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

  16. [PATCH 35/42] Staging: sxg: fix up unused function warnings

    These functions aren't used yet, so put them behind the
    proper #define so the compiler doesn't complain about them.

    Signed-off-by: Greg Kroah-Hartman
    ---
    drivers/staging/sxg/sxg.c | 155 +++++++++++++++++++++++----------------------
    1 files changed, 78 insertions(+), 77 deletions(-)

    diff --git a/drivers/staging/sxg/sxg.c b/drivers/staging/sxg/sxg.c
    index 3b05acf..fe935e2 100644
    --- a/drivers/staging/sxg/sxg.c
    +++ b/drivers/staging/sxg/sxg.c
    @@ -112,12 +112,16 @@ static bool sxg_mac_filter(p_adapter_t adapter,
    static struct net_device_stats *sxg_get_stats(p_net_device dev);
    #endif

    +#define XXXTODO 0
    +
    +#if XXXTODO
    static int sxg_mac_set_address(p_net_device dev, void *ptr);
    +static void sxg_mcast_set_list(p_net_device dev);
    +#endif

    static void sxg_adapter_set_hwaddr(p_adapter_t adapter);

    static void sxg_unmap_mmio_space(p_adapter_t adapter);
    -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);
    @@ -132,9 +136,6 @@ static int sxg_write_mdio_reg(p_adapter_t adapter,
    u32 DevAddr, u32 RegAddr, u32 Value);
    static int sxg_read_mdio_reg(p_adapter_t adapter,
    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;
    static char *sxg_banner =
    @@ -2668,38 +2669,6 @@ static int sxg_read_mdio_reg(p_adapter_t adapter,
    }

    /*
    - * Allocate a mcast_address structure to hold the multicast address.
    - * Link it in.
    - */
    -static int sxg_mcast_add_list(p_adapter_t adapter, char *address)
    -{
    - p_mcast_address_t mcaddr, mlist;
    - bool equaladdr;
    -
    - /* Check to see if it already exists */
    - mlist = adapter->mcastaddrs;
    - while (mlist) {
    - ETHER_EQ_ADDR(mlist->address, address, equaladdr);
    - if (equaladdr) {
    - return (STATUS_SUCCESS);
    - }
    - mlist = mlist->next;
    - }
    -
    - /* Doesn't already exist. Allocate a structure to hold it */
    - mcaddr = kmalloc(sizeof(mcast_address_t), GFP_ATOMIC);
    - if (mcaddr == NULL)
    - return 1;
    -
    - memcpy(mcaddr->address, address, 6);
    -
    - mcaddr->next = adapter->mcastaddrs;
    - adapter->mcastaddrs = mcaddr;
    -
    - return (STATUS_SUCCESS);
    -}
    -
    -/*
    * Functions to obtain the CRC corresponding to the destination mac address.
    * This is a standard ethernet CRC in that it is a 32-bit, reflected CRC using
    * the polynomial:
    @@ -2710,7 +2679,6 @@ static int sxg_mcast_add_list(p_adapter_t adapter, char *address)
    *
    */
    static u32 sxg_crc_table[256]; /* Table of CRC's for all possible byte values */
    -static u32 sxg_crc_init; /* Is table initialized */

    /*
    * Contruct the CRC32 table
    @@ -2737,6 +2705,8 @@ static void sxg_mcast_init_crc32(void)
    }
    }

    +#if XXXTODO
    +static u32 sxg_crc_init; /* Is table initialized */
    /*
    * Return the MAC hast as described above.
    */
    @@ -2765,6 +2735,74 @@ static unsigned char sxg_mcast_get_mac_hash(char *macaddr)
    return (machash);
    }

    +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", __func__,
    + adapter->netdev->name, (unsigned int)adapter->MacFilter,
    + adapter->MulticastMask);
    +
    + if (adapter->MacFilter & (MAC_ALLMCAST | MAC_PROMISC)) {
    + /* Turn on all multicast addresses. We have to do this for promiscuous
    + * mode as well as ALLMCAST mode. It saves the Microcode from having
    + * to keep state about the MAC configuration.
    + */
    +/* DBG_ERROR("sxg: %s macopts = MAC_ALLMCAST | MAC_PROMISC\n SLUT MODE!!!\n",__func__); */
    + WRITE_REG(sxg_regs->McastLow, 0xFFFFFFFF, FLUSH);
    + WRITE_REG(sxg_regs->McastHigh, 0xFFFFFFFF, FLUSH);
    +/* DBG_ERROR("%s (%s) WRITE to slic_regs slic_mcastlow&high 0xFFFFFFFF\n",__func__, adapter->netdev->name); */
    +
    + } else {
    + /* Commit our multicast mast to the SLIC by writing to the multicast
    + * address mask registers
    + */
    + DBG_ERROR("%s (%s) WRITE mcastlow[%lx] mcasthigh[%lx]\n",
    + __func__, adapter->netdev->name,
    + ((ulong) (adapter->MulticastMask & 0xFFFFFFFF)),
    + ((ulong)
    + ((adapter->MulticastMask >> 32) & 0xFFFFFFFF)));
    +
    + WRITE_REG(sxg_regs->McastLow,
    + (u32) (adapter->MulticastMask & 0xFFFFFFFF), FLUSH);
    + WRITE_REG(sxg_regs->McastHigh,
    + (u32) ((adapter->
    + MulticastMask >> 32) & 0xFFFFFFFF), FLUSH);
    + }
    +}
    +
    +/*
    + * Allocate a mcast_address structure to hold the multicast address.
    + * Link it in.
    + */
    +static int sxg_mcast_add_list(p_adapter_t adapter, char *address)
    +{
    + p_mcast_address_t mcaddr, mlist;
    + bool equaladdr;
    +
    + /* Check to see if it already exists */
    + mlist = adapter->mcastaddrs;
    + while (mlist) {
    + ETHER_EQ_ADDR(mlist->address, address, equaladdr);
    + if (equaladdr) {
    + return (STATUS_SUCCESS);
    + }
    + mlist = mlist->next;
    + }
    +
    + /* Doesn't already exist. Allocate a structure to hold it */
    + mcaddr = kmalloc(sizeof(mcast_address_t), GFP_ATOMIC);
    + if (mcaddr == NULL)
    + return 1;
    +
    + memcpy(mcaddr->address, address, 6);
    +
    + mcaddr->next = adapter->mcastaddrs;
    + adapter->mcastaddrs = mcaddr;
    +
    + return (STATUS_SUCCESS);
    +}
    +
    static void sxg_mcast_set_bit(p_adapter_t adapter, char *address)
    {
    unsigned char crcpoly;
    @@ -2783,7 +2821,6 @@ static void sxg_mcast_set_bit(p_adapter_t adapter, char *address)

    static void sxg_mcast_set_list(p_net_device dev)
    {
    -#if XXXTODO
    p_adapter_t adapter = (p_adapter_t) netdev_priv(dev);
    int status = STATUS_SUCCESS;
    int i;
    @@ -2835,45 +2872,9 @@ static void sxg_mcast_set_list(p_net_device dev)
    sxg_mcast_set_mask(adapter);
    }
    }
    -#endif
    return;
    }
    -
    -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", __func__,
    - adapter->netdev->name, (unsigned int)adapter->MacFilter,
    - adapter->MulticastMask);
    -
    - if (adapter->MacFilter & (MAC_ALLMCAST | MAC_PROMISC)) {
    - /* Turn on all multicast addresses. We have to do this for promiscuous
    - * mode as well as ALLMCAST mode. It saves the Microcode from having
    - * to keep state about the MAC configuration.
    - */
    -/* DBG_ERROR("sxg: %s macopts = MAC_ALLMCAST | MAC_PROMISC\n SLUT MODE!!!\n",__func__); */
    - WRITE_REG(sxg_regs->McastLow, 0xFFFFFFFF, FLUSH);
    - WRITE_REG(sxg_regs->McastHigh, 0xFFFFFFFF, FLUSH);
    -/* DBG_ERROR("%s (%s) WRITE to slic_regs slic_mcastlow&high 0xFFFFFFFF\n",__func__, adapter->netdev->name); */
    -
    - } else {
    - /* Commit our multicast mast to the SLIC by writing to the multicast
    - * address mask registers
    - */
    - DBG_ERROR("%s (%s) WRITE mcastlow[%lx] mcasthigh[%lx]\n",
    - __func__, adapter->netdev->name,
    - ((ulong) (adapter->MulticastMask & 0xFFFFFFFF)),
    - ((ulong)
    - ((adapter->MulticastMask >> 32) & 0xFFFFFFFF)));
    -
    - WRITE_REG(sxg_regs->McastLow,
    - (u32) (adapter->MulticastMask & 0xFFFFFFFF), FLUSH);
    - WRITE_REG(sxg_regs->McastHigh,
    - (u32) ((adapter->
    - MulticastMask >> 32) & 0xFFFFFFFF), FLUSH);
    - }
    -}
    +#endif

    static void sxg_unmap_mmio_space(p_adapter_t adapter)
    {
    @@ -3267,9 +3268,9 @@ static void sxg_adapter_set_hwaddr(p_adapter_t adapter)

    }

    +#if XXXTODO
    static int sxg_mac_set_address(p_net_device dev, void *ptr)
    {
    -#if XXXTODO
    p_adapter_t adapter = (p_adapter_t) netdev_priv(dev);
    struct sockaddr *addr = ptr;

    @@ -3295,9 +3296,9 @@ static int sxg_mac_set_address(p_net_device dev, void *ptr)
    adapter->currmacaddr[5]);

    sxg_config_set(adapter, TRUE);
    -#endif
    return 0;
    }
    +#endif

    /************************************************** ***************************/
    /************* SXG DRIVER FUNCTIONS (below) ********************************/
    --
    1.6.0.2

    --
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

  17. [PATCH 28/42] Staging: remove remaining uses of __FUNCTION__

    From: Harvey Harrison

    __FUNCTION__ is gcc-specific, use __func__

    Signed-off-by: Harvey Harrison
    Signed-off-by: Greg Kroah-Hartman
    ---
    drivers/staging/usbip/usbip_common.c | 2 +-
    drivers/staging/wlan-ng/wlan_compat.h | 8 ++++----
    2 files changed, 5 insertions(+), 5 deletions(-)

    diff --git a/drivers/staging/usbip/usbip_common.c b/drivers/staging/usbip/usbip_common.c
    index e64918f..72e2092 100644
    --- a/drivers/staging/usbip/usbip_common.c
    +++ b/drivers/staging/usbip/usbip_common.c
    @@ -221,7 +221,7 @@ static void usbip_dump_request_type(__u8 rt)
    static void usbip_dump_usb_ctrlrequest(struct usb_ctrlrequest *cmd)
    {
    if (!cmd) {
    - printk(" %s : null pointer\n", __FUNCTION__);
    + printk(" %s : null pointer\n", __func__);
    return;
    }

    diff --git a/drivers/staging/wlan-ng/wlan_compat.h b/drivers/staging/wlan-ng/wlan_compat.h
    index 1702657..59dfa8f 100644
    --- a/drivers/staging/wlan-ng/wlan_compat.h
    +++ b/drivers/staging/wlan-ng/wlan_compat.h
    @@ -245,11 +245,11 @@ typedef int64_t INT64;
    # define preempt_count() (0UL)
    #endif

    -#define WLAN_LOG_ERROR(x,args...) printk(KERN_ERR "%s: " x , __FUNCTION__ , ##args);
    +#define WLAN_LOG_ERROR(x,args...) printk(KERN_ERR "%s: " x , __func__ , ##args);

    -#define WLAN_LOG_WARNING(x,args...) printk(KERN_WARNING "%s: " x , __FUNCTION__ , ##args);
    +#define WLAN_LOG_WARNING(x,args...) printk(KERN_WARNING "%s: " x , __func__ , ##args);

    -#define WLAN_LOG_NOTICE(x,args...) printk(KERN_NOTICE "%s: " x , __FUNCTION__ , ##args);
    +#define WLAN_LOG_NOTICE(x,args...) printk(KERN_NOTICE "%s: " x , __func__ , ##args);

    #define WLAN_LOG_INFO(args... ) printk(KERN_INFO args)

    @@ -265,7 +265,7 @@ typedef int64_t INT64;
    #define DBFENTER { if ( WLAN_DBVAR >= 5 ){ WLAN_LOG_DEBUG(3,"---->\n"); } }
    #define DBFEXIT { if ( WLAN_DBVAR >= 5 ){ WLAN_LOG_DEBUG(3,"<----\n"); } }

    - #define WLAN_LOG_DEBUG(l,x,args...) if ( WLAN_DBVAR >= (l)) printk(KERN_DEBUG "%s(%lu): " x , __FUNCTION__, (preempt_count() & PREEMPT_MASK), ##args );
    + #define WLAN_LOG_DEBUG(l,x,args...) if ( WLAN_DBVAR >= (l)) printk(KERN_DEBUG "%s(%lu): " x , __func__, (preempt_count() & PREEMPT_MASK), ##args );
    #else
    #define WLAN_ASSERT(c)
    #define WLAN_HEX_DUMP( l, s, p, n)
    --
    1.6.0.2

    --
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

  18. [PATCH 39/42] Staging: w35und: module init cleanup

    From: Pekka Enberg

    This patch cleans up the module init functions a bit and removes the redundant
    device ID check from wb35_probe() function.

    Acked-by: Pavel Machek
    Signed-off-by: Pekka Enberg
    Signed-off-by: Greg Kroah-Hartman
    ---
    drivers/staging/winbond/linux/wbusb.c | 87 ++++++++++++---------------------
    1 files changed, 31 insertions(+), 56 deletions(-)

    diff --git a/drivers/staging/winbond/linux/wbusb.c b/drivers/staging/winbond/linux/wbusb.c
    index e09b272..fb216de 100644
    --- a/drivers/staging/winbond/linux/wbusb.c
    +++ b/drivers/staging/winbond/linux/wbusb.c
    @@ -6,36 +6,23 @@
    #include "sysdef.h"
    #include

    -
    -MODULE_AUTHOR( DRIVER_AUTHOR );
    -MODULE_DESCRIPTION( DRIVER_DESC );
    +MODULE_AUTHOR(DRIVER_AUTHOR);
    +MODULE_DESCRIPTION(DRIVER_DESC);
    MODULE_LICENSE("GPL");
    MODULE_VERSION("0.1");

    -
    -//================================================== ==========
    -// vendor ID and product ID can into here for others
    -//================================================== ==========
    -static struct usb_device_id Id_Table[] =
    -{
    - {USB_DEVICE( 0x0416, 0x0035 )},
    - {USB_DEVICE( 0x18E8, 0x6201 )},
    - {USB_DEVICE( 0x18E8, 0x6206 )},
    - {USB_DEVICE( 0x18E8, 0x6217 )},
    - {USB_DEVICE( 0x18E8, 0x6230 )},
    - {USB_DEVICE( 0x18E8, 0x6233 )},
    - {USB_DEVICE( 0x1131, 0x2035 )},
    - { }
    +static struct usb_device_id wb35_table[] __devinitdata = {
    + {USB_DEVICE(0x0416, 0x0035)},
    + {USB_DEVICE(0x18E8, 0x6201)},
    + {USB_DEVICE(0x18E8, 0x6206)},
    + {USB_DEVICE(0x18E8, 0x6217)},
    + {USB_DEVICE(0x18E8, 0x6230)},
    + {USB_DEVICE(0x18E8, 0x6233)},
    + {USB_DEVICE(0x1131, 0x2035)},
    + {}
    };

    -MODULE_DEVICE_TABLE(usb, Id_Table);
    -
    -static struct usb_driver wb35_driver = {
    - .name = "w35und",
    - .probe = wb35_probe,
    - .disconnect = wb35_disconnect,
    - .id_table = Id_Table,
    -};
    +MODULE_DEVICE_TABLE(usb, wb35_table);

    static const struct ieee80211_rate wbsoft_rates[] = {
    { .bitrate = 10, .flags = IEEE80211_RATE_SHORT_PREAMBLE },
    @@ -187,21 +174,6 @@ struct wbsoft_priv {
    };


    -int __init wb35_init(void)
    -{
    - printk("[w35und]driver init\n");
    - return usb_register(&wb35_driver);
    -}
    -
    -void __exit wb35_exit(void)
    -{
    - printk("[w35und]driver exit\n");
    - usb_deregister( &wb35_driver );
    -}
    -
    -module_init(wb35_init);
    -module_exit(wb35_exit);
    -
    // Usb kernel subsystem will call this function when a new device is plugged into.
    int wb35_probe(struct usb_interface *intf, const struct usb_device_id *id_table)
    {
    @@ -210,7 +182,7 @@ int wb35_probe(struct usb_interface *intf, const struct usb_device_id *id_table)
    PWBUSB pWbUsb;
    struct usb_host_interface *interface;
    struct usb_endpoint_descriptor *endpoint;
    - int i, ret = -1;
    + int ret = -1;
    u32 ltmp;
    struct usb_device *udev = interface_to_usbdev(intf);

    @@ -218,21 +190,6 @@ int wb35_probe(struct usb_interface *intf, const struct usb_device_id *id_table)

    printk("[w35und]wb35_probe ->\n");

    - for (i=0; i<(sizeof(Id_Table)/sizeof(struct usb_device_id)); i++ ) {
    - if ((udev->descriptor.idVendor == Id_Table[i].idVendor) &&
    - (udev->descriptor.idProduct == Id_Table[i].idProduct)) {
    - printk("[w35und]Found supported hardware\n");
    - break;
    - }
    - }
    -
    - if ((i == (sizeof(Id_Table)/sizeof(struct usb_device_id)))) {
    - #ifdef _PE_USB_INI_DUMP_
    - WBDEBUG(("[w35und] This is not the one we are interested about\n"));
    - #endif
    - return -ENODEV;
    - }
    -
    // 20060630.2 Check the device if it already be opened
    ret = usb_control_msg(udev, usb_rcvctrlpipe( udev, 0 ),
    0x01, USB_TYPE_VENDOR|USB_RECIP_DEVICE|USB_DIR_IN,
    @@ -398,4 +355,22 @@ void wb35_disconnect(struct usb_interface *intf)

    }

    +static struct usb_driver wb35_driver = {
    + .name = "w35und",
    + .id_table = wb35_table,
    + .probe = wb35_probe,
    + .disconnect = wb35_disconnect,
    +};
    +
    +static int __init wb35_init(void)
    +{
    + return usb_register(&wb35_driver);
    +}
    +
    +static void __exit wb35_exit(void)
    +{
    + usb_deregister(&wb35_driver);
    +}

    +module_init(wb35_init);
    +module_exit(wb35_exit);
    --
    1.6.0.2

    --
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

  19. [PATCH 18/42] Staging: echo: Export interface functions. Add module headers.

    From: Tzafrir Cohen

    Signed-off-by: Tzafrir Cohen
    Signed-off-by: Greg Kroah-Hartman
    ---
    drivers/staging/echo/echo.c | 13 ++++++++++++-
    1 files changed, 12 insertions(+), 1 deletions(-)

    diff --git a/drivers/staging/echo/echo.c b/drivers/staging/echo/echo.c
    index 4a281b1..0a03eed 100644
    --- a/drivers/staging/echo/echo.c
    +++ b/drivers/staging/echo/echo.c
    @@ -289,6 +289,7 @@ echo_can_state_t *echo_can_create(int len, int adaption_mode)

    return ec;
    }
    +EXPORT_SYMBOL_GPL(echo_can_create);
    /*- End of function --------------------------------------------------------*/

    void echo_can_free(echo_can_state_t *ec)
    @@ -302,12 +303,14 @@ void echo_can_free(echo_can_state_t *ec)
    kfree(ec->snapshot);
    kfree(ec);
    }
    +EXPORT_SYMBOL_GPL(echo_can_free);
    /*- End of function --------------------------------------------------------*/

    void echo_can_adaption_mode(echo_can_state_t *ec, int adaption_mode)
    {
    ec->adaption_mode = adaption_mode;
    }
    +EXPORT_SYMBOL_GPL(echo_can_adaption_mode);
    /*- End of function --------------------------------------------------------*/

    void echo_can_flush(echo_can_state_t *ec)
    @@ -334,11 +337,13 @@ void echo_can_flush(echo_can_state_t *ec)
    ec->curr_pos = ec->taps - 1;
    ec->Pstates = 0;
    }
    +EXPORT_SYMBOL_GPL(echo_can_flush);
    /*- End of function --------------------------------------------------------*/

    void echo_can_snapshot(echo_can_state_t *ec) {
    memcpy(ec->snapshot, ec->fir_taps16[0], ec->taps*sizeof(int16_t));
    }
    +EXPORT_SYMBOL_GPL(echo_can_snapshot);
    /*- End of function --------------------------------------------------------*/

    /* Dual Path Echo Canceller ------------------------------------------------*/
    @@ -584,7 +589,7 @@ int16_t echo_can_update(echo_can_state_t *ec, int16_t tx, int16_t rx)

    return (int16_t) ec->clean_nlp << 1;
    }
    -
    +EXPORT_SYMBOL_GPL(echo_can_update);
    /*- End of function --------------------------------------------------------*/

    /* This function is seperated from the echo canceller is it is usually called
    @@ -630,3 +635,9 @@ int16_t echo_can_hpf_tx(echo_can_state_t *ec, int16_t tx) {

    return tx;
    }
    +EXPORT_SYMBOL_GPL(echo_can_hpf_tx);
    +
    +MODULE_LICENSE("GPL");
    +MODULE_AUTHOR("David Rowe");
    +MODULE_DESCRIPTION("Open Source Line Echo Canceller");
    +MODULE_VERSION("0.3.0");
    --
    1.6.0.2

    --
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

  20. [PATCH 17/42] Staging: echo: A separate oslec.h for external interface

    From: Tzafrir Cohen

    Split out the external interface to a separate file called oslec.h .

    Give the struct a name while we're at it.

    Signed-off-by: Tzafrir Cohen
    Signed-off-by: Greg Kroah-Hartman
    ---
    drivers/staging/echo/echo.h | 53 +------------------------
    drivers/staging/echo/oslec.h | 86 ++++++++++++++++++++++++++++++++++++++++++
    2 files changed, 89 insertions(+), 50 deletions(-)
    create mode 100644 drivers/staging/echo/oslec.h

    diff --git a/drivers/staging/echo/echo.h b/drivers/staging/echo/echo.h
    index 7a91b43..5c8b515 100644
    --- a/drivers/staging/echo/echo.h
    +++ b/drivers/staging/echo/echo.h
    @@ -118,21 +118,13 @@ a minor burden.
    */

    #include "fir.h"
    -
    -/* Mask bits for the adaption mode */
    -#define ECHO_CAN_USE_ADAPTION 0x01
    -#define ECHO_CAN_USE_NLP 0x02
    -#define ECHO_CAN_USE_CNG 0x04
    -#define ECHO_CAN_USE_CLIP 0x08
    -#define ECHO_CAN_USE_TX_HPF 0x10
    -#define ECHO_CAN_USE_RX_HPF 0x20
    -#define ECHO_CAN_DISABLE 0x40
    +#include "oslec.h"

    /*!
    G.168 echo canceller descriptor. This defines the working state for a line
    echo canceller.
    */
    -typedef struct
    +struct echo_can_state
    {
    int16_t tx,rx;
    int16_t clean;
    @@ -176,45 +168,6 @@ typedef struct

    /* snapshot sample of coeffs used for development */
    int16_t *snapshot;
    -} echo_can_state_t;
    -
    -/*! Create a voice echo canceller context.
    - \param len The length of the canceller, in samples.
    - \return The new canceller context, or NULL if the canceller could not be created.
    -*/
    -echo_can_state_t *echo_can_create(int len, int adaption_mode);
    -
    -/*! Free a voice echo canceller context.
    - \param ec The echo canceller context.
    -*/
    -void echo_can_free(echo_can_state_t *ec);
    -
    -/*! Flush (reinitialise) a voice echo canceller context.
    - \param ec The echo canceller context.
    -*/
    -void echo_can_flush(echo_can_state_t *ec);
    -
    -/*! Set the adaption mode of a voice echo canceller context.
    - \param ec The echo canceller context.
    - \param adapt The mode.
    -*/
    -void echo_can_adaption_mode(echo_can_state_t *ec, int adaption_mode);
    -
    -void echo_can_snapshot(echo_can_state_t *ec);
    -
    -/*! Process a sample through a voice echo canceller.
    - \param ec The echo canceller context.
    - \param tx The transmitted audio sample.
    - \param rx The received audio sample.
    - \return The clean (echo cancelled) received sample.
    -*/
    -int16_t echo_can_update(echo_can_state_t *ec, int16_t tx, int16_t rx);
    -
    -/*! Process to high pass filter the tx signal.
    - \param ec The echo canceller context.
    - \param tx The transmitted auio sample.
    - \return The HP filtered transmit sample, send this to your D/A.
    -*/
    -int16_t echo_can_hpf_tx(echo_can_state_t *ec, int16_t tx);
    +};

    #endif /* __ECHO_H */
    diff --git a/drivers/staging/echo/oslec.h b/drivers/staging/echo/oslec.h
    new file mode 100644
    index 0000000..913fc51
    --- /dev/null
    +++ b/drivers/staging/echo/oslec.h
    @@ -0,0 +1,86 @@
    +/*
    + * OSLEC - A line echo canceller. This code is being developed
    + * against and partially complies with G168. Using code from SpanDSP
    + *
    + * Written by Steve Underwood
    + * and David Rowe
    + *
    + * Copyright (C) 2001 Steve Underwood and 2007-2008 David Rowe
    + *
    + * All rights reserved.
    + *
    + * This program is free software; you can redistribute it and/or modify
    + * it under the terms of the GNU General Public License version 2, as
    + * published by the Free Software Foundation.
    + *
    + * 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.
    + *
    + */
    +
    +#ifndef __OSLEC_H
    +#define __OSLEC_H
    +
    +/* TODO: document interface */
    +
    +/* Mask bits for the adaption mode */
    +#define ECHO_CAN_USE_ADAPTION 0x01
    +#define ECHO_CAN_USE_NLP 0x02
    +#define ECHO_CAN_USE_CNG 0x04
    +#define ECHO_CAN_USE_CLIP 0x08
    +#define ECHO_CAN_USE_TX_HPF 0x10
    +#define ECHO_CAN_USE_RX_HPF 0x20
    +#define ECHO_CAN_DISABLE 0x40
    +
    +/*!
    + G.168 echo canceller descriptor. This defines the working state for a line
    + echo canceller.
    +*/
    +typedef struct echo_can_state echo_can_state_t;
    +
    +/*! Create a voice echo canceller context.
    + \param len The length of the canceller, in samples.
    + \return The new canceller context, or NULL if the canceller could not be created.
    +*/
    +echo_can_state_t *echo_can_create(int len, int adaption_mode);
    +
    +/*! Free a voice echo canceller context.
    + \param ec The echo canceller context.
    +*/
    +void echo_can_free(echo_can_state_t *ec);
    +
    +/*! Flush (reinitialise) a voice echo canceller context.
    + \param ec The echo canceller context.
    +*/
    +void echo_can_flush(echo_can_state_t *ec);
    +
    +/*! Set the adaption mode of a voice echo canceller context.
    + \param ec The echo canceller context.
    + \param adapt The mode.
    +*/
    +void echo_can_adaption_mode(echo_can_state_t *ec, int adaption_mode);
    +
    +void echo_can_snapshot(echo_can_state_t *ec);
    +
    +/*! Process a sample through a voice echo canceller.
    + \param ec The echo canceller context.
    + \param tx The transmitted audio sample.
    + \param rx The received audio sample.
    + \return The clean (echo cancelled) received sample.
    +*/
    +int16_t echo_can_update(echo_can_state_t *ec, int16_t tx, int16_t rx);
    +
    +/*! Process to high pass filter the tx signal.
    + \param ec The echo canceller context.
    + \param tx The transmitted auio sample.
    + \return The HP filtered transmit sample, send this to your D/A.
    +*/
    +int16_t echo_can_hpf_tx(echo_can_state_t *ec, int16_t tx);
    +
    +#endif /* __OSLEC_H */
    --
    1.6.0.2

    --
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

+ Reply to Thread
Page 1 of 3 1 2 3 LastLast