Re: [PATCH V2] staging: dgnc: Remove dgnc_ports_state_show
On Thu, Oct 08, 2015 at 07:26:37AM +0100, Salah Triki wrote: > dgnc_ports_state_show is removed, since it exposes ports status which help an > adversary to > plan an attack. No. It doesn't export anything harmful and it only is readable by root. regards, dan carpenter ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 1/3] staging: sm750fb: merge calcPLL and getPllValue into getChipClock
On Tue, Oct 06, 2015 at 09:42:15AM +0100, Mike Rapoport wrote: > The getChipClock function is used only to get MXCLK frequency, which > makes most of getPllValue function unused and thus. The detection of > MXCLK frequency may be implemented directly in getChipClock rendering > getPllValue and calcPLL unused. > > Signed-off-by: Mike Rapoport > --- You have also missed saving the values in pPLL->inputFreq and pPLL->clockType = clockType. Both have been used later. Is it ok to remove the PLL calculation of all the different type of display devices? Currently only PANEL_PLL_CTRL is being used for calculation and ofcourse we also donot keep in kernel that we donot use. Maybe we can do some thing like: diff --git a/drivers/staging/sm750fb/ddk750_chip.c b/drivers/staging/sm750fb/ddk750_chip.c index ad2f1c0..4b60894 100644 --- a/drivers/staging/sm750fb/ddk750_chip.c +++ b/drivers/staging/sm750fb/ddk750_chip.c @@ -39,11 +39,17 @@ static unsigned int getChipClock(void) { unsigned int pll_reg; unsigned int M, N, OD, POD; + clock_type_t clk_type = PANEL_PLL_CTRL; + /* +* Different register location based on display device type: +* MXCLK_PLL_CTRL, PANEL_PLL_CTRL, CRT_PLL_CTRL, VGA_PLL0_CTRL, +* VGA_PLL1_CTRL +*/ if (getChipType() == SM750LE) return MHz(130); - pll_reg = PEEK32(MXCLK_PLL_CTRL); + pll_reg = PEEK32(clk_type); M = FIELD_GET(pll_reg, PANEL_PLL_CTRL, M); N = FIELD_GET(pll_reg, PANEL_PLL_CTRL, N); OD = FIELD_GET(pll_reg, PANEL_PLL_CTRL, OD); --- This is on top of your patch. So now we have the different possible values in the comments, so whenever, if anyone is working on a different device atleast they will not have to search and find out what the other values can be. regards sudip ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 2/3] staging: android: ion: Add ion driver for Hi6220 SoC platform
Signed-off-by: Chen Feng Signed-off-by: Yu Dongbin --- drivers/staging/android/ion/Kconfig| 7 + drivers/staging/android/ion/Makefile | 1 + drivers/staging/android/ion/hisilicon/Kconfig | 5 + drivers/staging/android/ion/hisilicon/Makefile | 1 + drivers/staging/android/ion/hisilicon/hi6220_ion.c | 201 + 5 files changed, 215 insertions(+) create mode 100644 drivers/staging/android/ion/hisilicon/Kconfig create mode 100644 drivers/staging/android/ion/hisilicon/Makefile create mode 100644 drivers/staging/android/ion/hisilicon/hi6220_ion.c diff --git a/drivers/staging/android/ion/Kconfig b/drivers/staging/android/ion/Kconfig index 3452346..19c1572 100644 --- a/drivers/staging/android/ion/Kconfig +++ b/drivers/staging/android/ion/Kconfig @@ -33,3 +33,10 @@ config ION_TEGRA help Choose this option if you wish to use ion on an nVidia Tegra. +config ION_HISI + tristate "Ion for Hisilicon" + depends on ARCH_HISI && ION + help + Choose this option if you wish to use ion on Hisilicon Platform. + +source "drivers/staging/android/ion/hisilicon/Kconfig" diff --git a/drivers/staging/android/ion/Makefile b/drivers/staging/android/ion/Makefile index b56fd2b..18cc2aa 100644 --- a/drivers/staging/android/ion/Makefile +++ b/drivers/staging/android/ion/Makefile @@ -7,4 +7,5 @@ endif obj-$(CONFIG_ION_DUMMY) += ion_dummy_driver.o obj-$(CONFIG_ION_TEGRA) += tegra/ +obj-$(CONFIG_ION_HISI) += hisilicon/ diff --git a/drivers/staging/android/ion/hisilicon/Kconfig b/drivers/staging/android/ion/hisilicon/Kconfig new file mode 100644 index 000..2b4bd07 --- /dev/null +++ b/drivers/staging/android/ion/hisilicon/Kconfig @@ -0,0 +1,5 @@ +config HI6220_ION +bool "Hi6220 ION Driver" +depends on ARCH_HISI && ION +help + Build the Hisilicon Hi6220 ion driver. diff --git a/drivers/staging/android/ion/hisilicon/Makefile b/drivers/staging/android/ion/hisilicon/Makefile new file mode 100644 index 000..2a89414 --- /dev/null +++ b/drivers/staging/android/ion/hisilicon/Makefile @@ -0,0 +1 @@ +obj-$(CONFIG_HI6220_ION) += hi6220_ion.o diff --git a/drivers/staging/android/ion/hisilicon/hi6220_ion.c b/drivers/staging/android/ion/hisilicon/hi6220_ion.c new file mode 100644 index 000..b7d39b8 --- /dev/null +++ b/drivers/staging/android/ion/hisilicon/hi6220_ion.c @@ -0,0 +1,201 @@ +#define pr_fmt(fmt) "Ion: " fmt + +#include +#include +#include +#include +#include +#include "../ion_priv.h" +#include "../ion.h" + +struct hi6220_ion_type_table { + const char *name; + enum ion_heap_type type; +}; + +static struct hi6220_ion_type_table ion_type_table[] = { + {"ion_system", ION_HEAP_TYPE_SYSTEM}, + {"ion_system_contig", ION_HEAP_TYPE_SYSTEM_CONTIG}, + {"ion_carveout", ION_HEAP_TYPE_CARVEOUT}, + {"ion_chunk", ION_HEAP_TYPE_CHUNK}, + {"ion_dma", ION_HEAP_TYPE_DMA}, + {"ion_custom", ION_HEAP_TYPE_CUSTOM}, +}; + +static struct ion_device *idev; +static int num_heaps; +static struct ion_heap **heaps; +static struct ion_platform_heap **heaps_data; + +static int get_type_by_name(const char *name, enum ion_heap_type *type) +{ + int i, n; + + n = ARRAY_SIZE(ion_type_table); + for (i = 0; i < n; i++) { + if (strncmp(name, ion_type_table[i].name, strlen(name))) + continue; + + *type = ion_type_table[i].type; + return 0; + } + + return -1; +} + +static int hi6220_set_platform_data(struct platform_device *pdev) +{ + unsigned int base; + unsigned int size; + unsigned int id; + const char *heap_name; + const char *type_name; + enum ion_heap_type type; + int ret; + struct device_node *np; + struct ion_platform_heap *p_data; + const struct device_node *dt_node = pdev->dev.of_node; + int index = 0; + + for_each_child_of_node(dt_node, np) + num_heaps++; + + heaps_data = devm_kzalloc(&pdev->dev, + sizeof(struct ion_platform_heap *) * num_heaps, + GFP_KERNEL); + + for_each_child_of_node(dt_node, np) { + p_data = devm_kzalloc(&pdev->dev, + sizeof(struct ion_platform_heap), + GFP_KERNEL); + + ret = of_property_read_string(np, "heap-name", &heap_name); + if (ret < 0) { + pr_err("check the name of node %s\n", np->name); + continue; + } + + ret = of_property_read_u32(np, "heap-id", &id); + if (ret < 0) { + pr_err("check the id %s\n", np->name); + continue; + } + + ret = of_property_read_u32(np, "heap-base", &base); + if (ret < 0) { +
[PATCH 3/3] arm64: dts: Add dts files to enable ION on Hi6220 SoC.
Add ION node to enable ION on hi6220 SoC platform Signed-off-by: Chen Feng Signed-off-by: Yu Dongbin --- arch/arm64/boot/dts/hisilicon/hi6220-hikey.dts | 1 + arch/arm64/boot/dts/hisilicon/hi6220-ion.dtsi | 23 +++ 2 files changed, 24 insertions(+) create mode 100644 arch/arm64/boot/dts/hisilicon/hi6220-ion.dtsi diff --git a/arch/arm64/boot/dts/hisilicon/hi6220-hikey.dts b/arch/arm64/boot/dts/hisilicon/hi6220-hikey.dts index e36a539..44b75d2 100644 --- a/arch/arm64/boot/dts/hisilicon/hi6220-hikey.dts +++ b/arch/arm64/boot/dts/hisilicon/hi6220-hikey.dts @@ -11,6 +11,7 @@ /memreserve/ 0x05e0 0x0010; #include "hi6220.dtsi" +#include "hi6220-ion.dtsi" / { model = "HiKey Development Board"; diff --git a/arch/arm64/boot/dts/hisilicon/hi6220-ion.dtsi b/arch/arm64/boot/dts/hisilicon/hi6220-ion.dtsi new file mode 100644 index 000..24d3722 --- /dev/null +++ b/arch/arm64/boot/dts/hisilicon/hi6220-ion.dtsi @@ -0,0 +1,23 @@ +/ { + hi6220-ion { + compatible = "hisilicon,hi6220-ion"; + + heap_sys_user@0 { + heap-name = "sys_user"; + heap-id = <0x0>; + heap-base = <0x0>; + heap-size = <0x0>; + heap-type = "ion_system"; + }; + + heap_sys_contig@0 { + heap-name = "sys_contig"; + heap-id = <0x1>; + heap-base = <0x0>; + heap-size = <0x0>; + heap-type = "ion_system_contig"; + }; + }; + +}; + -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 1/3] docs: dts: Add documentation for hi6220 SoC ION node
Documentation for hi6220 SoC ION node Signed-off-by: Chen Feng Signed-off-by: Yu Dongbin --- .../devicetree/bindings/staging/ion/hi6220-ion.txt | 27 ++ 1 file changed, 27 insertions(+) create mode 100644 Documentation/devicetree/bindings/staging/ion/hi6220-ion.txt diff --git a/Documentation/devicetree/bindings/staging/ion/hi6220-ion.txt b/Documentation/devicetree/bindings/staging/ion/hi6220-ion.txt new file mode 100644 index 000..5f969d7 --- /dev/null +++ b/Documentation/devicetree/bindings/staging/ion/hi6220-ion.txt @@ -0,0 +1,27 @@ +Hi6220 SoC ION + +Required properties: +- compatible : "hisilicon,hi6220-ion" +- list of the ION heaps + +Example: +hi6220-ion { +compatible = "hisilicon,hi6220-ion"; + +heap_sys_user@0 { +heap-name = "sys_user"; +heap-id = <0x0>; +heap-base = <0x0>; +heap-size = <0x0>; +heap-type = "ion_system"; +}; + +heap_sys_contig@0 { +heap-name = "sys_contig"; +heap-id = <0x1>; +heap-base = <0x0>; +heap-size = <0x0>; +heap-type = "ion_system_contig"; +}; +}; + -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 02/11] staging: wilc1000: rename pstrCfgParamVal in struct cfg_param_attr
This patch renames a variable of struct cfg_param_val in struct cfg_param_attr, pstrCfgParamVal to cfg_attr_info to avoid CamelCase naming convention. Signed-off-by: Tony Cho --- drivers/staging/wilc1000/host_interface.c | 144 +++--- 1 file changed, 72 insertions(+), 72 deletions(-) diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c index 1a21d19..0d4b076 100644 --- a/drivers/staging/wilc1000/host_interface.c +++ b/drivers/staging/wilc1000/host_interface.c @@ -72,7 +72,7 @@ extern u8 g_wilc_initialized; * @version 1.0 */ struct cfg_param_attr { - struct cfg_param_val pstrCfgParamVal; + struct cfg_param_val cfg_attr_info; }; /*! @@ -846,19 +846,19 @@ static s32 Handle_CfgParam(struct host_if_drv *hif_drv, PRINT_D(HOSTINF_DBG, "Setting CFG params\n"); - if (strHostIFCfgParamAttr->pstrCfgParamVal.u32SetCfgFlag & BSS_TYPE) { + if (strHostIFCfgParamAttr->cfg_attr_info.u32SetCfgFlag & BSS_TYPE) { /*--*/ /*Input Value: INFRASTRUCTURE = 1, */ /* INDEPENDENT= 2, */ /* ANY_BSS= 3 */ /*--*/ /* validate input then copy>> need to check value 4 and 5 */ - if (strHostIFCfgParamAttr->pstrCfgParamVal.bss_type < 6) { + if (strHostIFCfgParamAttr->cfg_attr_info.bss_type < 6) { strWIDList[u8WidCnt].id = WID_BSS_TYPE; - strWIDList[u8WidCnt].val = (s8 *)&strHostIFCfgParamAttr->pstrCfgParamVal.bss_type; + strWIDList[u8WidCnt].val = (s8 *)&strHostIFCfgParamAttr->cfg_attr_info.bss_type; strWIDList[u8WidCnt].type = WID_CHAR; strWIDList[u8WidCnt].size = sizeof(char); - hif_drv->strCfgValues.bss_type = (u8)strHostIFCfgParamAttr->pstrCfgParamVal.bss_type; + hif_drv->strCfgValues.bss_type = (u8)strHostIFCfgParamAttr->cfg_attr_info.bss_type; } else { PRINT_ER("check value 6 over\n"); s32Error = -EINVAL; @@ -866,19 +866,19 @@ static s32 Handle_CfgParam(struct host_if_drv *hif_drv, } u8WidCnt++; } - if (strHostIFCfgParamAttr->pstrCfgParamVal.u32SetCfgFlag & AUTH_TYPE) { + if (strHostIFCfgParamAttr->cfg_attr_info.u32SetCfgFlag & AUTH_TYPE) { /*--*/ /*Input Values: OPEN_SYSTEM = 0, */ /* SHARED_KEY = 1, */ /* ANY = 2 */ /*--*/ /*validate Possible values*/ - if ((strHostIFCfgParamAttr->pstrCfgParamVal.auth_type) == 1 || (strHostIFCfgParamAttr->pstrCfgParamVal.auth_type) == 2 || (strHostIFCfgParamAttr->pstrCfgParamVal.auth_type) == 5) { + if ((strHostIFCfgParamAttr->cfg_attr_info.auth_type) == 1 || (strHostIFCfgParamAttr->cfg_attr_info.auth_type) == 2 || (strHostIFCfgParamAttr->cfg_attr_info.auth_type) == 5) { strWIDList[u8WidCnt].id = WID_AUTH_TYPE; - strWIDList[u8WidCnt].val = (s8 *)&strHostIFCfgParamAttr->pstrCfgParamVal.auth_type; + strWIDList[u8WidCnt].val = (s8 *)&strHostIFCfgParamAttr->cfg_attr_info.auth_type; strWIDList[u8WidCnt].type = WID_CHAR; strWIDList[u8WidCnt].size = sizeof(char); - hif_drv->strCfgValues.auth_type = (u8)strHostIFCfgParamAttr->pstrCfgParamVal.auth_type; + hif_drv->strCfgValues.auth_type = (u8)strHostIFCfgParamAttr->cfg_attr_info.auth_type; } else { PRINT_ER("Impossible value \n"); s32Error = -EINVAL; @@ -886,14 +886,14 @@ static s32 Handle_CfgParam(struct host_if_drv *hif_drv, } u8WidCnt++; } - if (strHostIFCfgParamAttr->pstrCfgParamVal.u32SetCfgFlag & AUTHEN_TIMEOUT) { + if (strHostIFCfgParamAttr->cfg_attr_info.u32SetCfgFlag & AUTHEN_TIMEOUT) { /* range is 1 to 65535. */ - if (strHostIFCfgParamAttr->pstrCfgParamVal.auth_timeout > 0 && strHostIFCfgParamAttr->pstrCfgParamVal.auth_timeout < 65536) { + i
[PATCH 03/11] staging: wilc1000: rename u32SetCfgFlag of struct cfg_param_val
This patch renames u32SetCfgFlag of struct cfg_param_val to flag to avoid CamelCase naming convention. Signed-off-by: Tony Cho --- drivers/staging/wilc1000/host_interface.c | 36 +++ drivers/staging/wilc1000/host_interface.h | 2 +- drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 10 +++ 3 files changed, 24 insertions(+), 24 deletions(-) diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c index 0d4b076..67b7f0b 100644 --- a/drivers/staging/wilc1000/host_interface.c +++ b/drivers/staging/wilc1000/host_interface.c @@ -846,7 +846,7 @@ static s32 Handle_CfgParam(struct host_if_drv *hif_drv, PRINT_D(HOSTINF_DBG, "Setting CFG params\n"); - if (strHostIFCfgParamAttr->cfg_attr_info.u32SetCfgFlag & BSS_TYPE) { + if (strHostIFCfgParamAttr->cfg_attr_info.flag & BSS_TYPE) { /*--*/ /*Input Value: INFRASTRUCTURE = 1, */ /* INDEPENDENT= 2, */ @@ -866,7 +866,7 @@ static s32 Handle_CfgParam(struct host_if_drv *hif_drv, } u8WidCnt++; } - if (strHostIFCfgParamAttr->cfg_attr_info.u32SetCfgFlag & AUTH_TYPE) { + if (strHostIFCfgParamAttr->cfg_attr_info.flag & AUTH_TYPE) { /*--*/ /*Input Values: OPEN_SYSTEM = 0, */ /* SHARED_KEY = 1, */ @@ -886,7 +886,7 @@ static s32 Handle_CfgParam(struct host_if_drv *hif_drv, } u8WidCnt++; } - if (strHostIFCfgParamAttr->cfg_attr_info.u32SetCfgFlag & AUTHEN_TIMEOUT) { + if (strHostIFCfgParamAttr->cfg_attr_info.flag & AUTHEN_TIMEOUT) { /* range is 1 to 65535. */ if (strHostIFCfgParamAttr->cfg_attr_info.auth_timeout > 0 && strHostIFCfgParamAttr->cfg_attr_info.auth_timeout < 65536) { strWIDList[u8WidCnt].id = WID_AUTH_TIMEOUT; @@ -901,7 +901,7 @@ static s32 Handle_CfgParam(struct host_if_drv *hif_drv, } u8WidCnt++; } - if (strHostIFCfgParamAttr->cfg_attr_info.u32SetCfgFlag & POWER_MANAGEMENT) { + if (strHostIFCfgParamAttr->cfg_attr_info.flag & POWER_MANAGEMENT) { /*---*/ /*Input Values: NO_POWERSAVE = 0, */ /* MIN_FAST_PS = 1, */ @@ -922,7 +922,7 @@ static s32 Handle_CfgParam(struct host_if_drv *hif_drv, } u8WidCnt++; } - if (strHostIFCfgParamAttr->cfg_attr_info.u32SetCfgFlag & RETRY_SHORT) { + if (strHostIFCfgParamAttr->cfg_attr_info.flag & RETRY_SHORT) { /* range from 1 to 256 */ if ((strHostIFCfgParamAttr->cfg_attr_info.short_retry_limit > 0) && (strHostIFCfgParamAttr->cfg_attr_info.short_retry_limit < 256)) { strWIDList[u8WidCnt].id = WID_SHORT_RETRY_LIMIT; @@ -937,7 +937,7 @@ static s32 Handle_CfgParam(struct host_if_drv *hif_drv, } u8WidCnt++; } - if (strHostIFCfgParamAttr->cfg_attr_info.u32SetCfgFlag & RETRY_LONG) { + if (strHostIFCfgParamAttr->cfg_attr_info.flag & RETRY_LONG) { /* range from 1 to 256 */ if ((strHostIFCfgParamAttr->cfg_attr_info.long_retry_limit > 0) && (strHostIFCfgParamAttr->cfg_attr_info.long_retry_limit < 256)) { strWIDList[u8WidCnt].id = WID_LONG_RETRY_LIMIT; @@ -953,7 +953,7 @@ static s32 Handle_CfgParam(struct host_if_drv *hif_drv, } u8WidCnt++; } - if (strHostIFCfgParamAttr->cfg_attr_info.u32SetCfgFlag & FRAG_THRESHOLD) { + if (strHostIFCfgParamAttr->cfg_attr_info.flag & FRAG_THRESHOLD) { if (strHostIFCfgParamAttr->cfg_attr_info.frag_threshold > 255 && strHostIFCfgParamAttr->cfg_attr_info.frag_threshold < 7937) { strWIDList[u8WidCnt].id = WID_FRAG_THRESHOLD; @@ -968,7 +968,7 @@ static s32 Handle_CfgParam(struct host_if_drv *hif_drv, } u8WidCnt++; } - if (strHostIFCfgParamAttr->cfg_attr_info.u32SetCfgFlag & RTS_THRESHOLD) { + if (strHostIFCfgParamAttr->cfg_attr_info.flag & RTS_THRESHOLD) { /* range 256 to 65535 */ if (strHostIFCfgParamAttr->cfg_attr_info.rts_threshold > 255 && strHostIFCfgParamAttr->cfg_attr_info.rts_threshold < 65536) { strWIDL
[PATCH 04/11] staging: wilc1000: rename strHostIFwepAttr of union host_if_key_attr
This patch renames strHostIFwepAttr of union host_if_key_attr to wep to avoid CamelCase naming convention. Signed-off-by: Tony Cho --- drivers/staging/wilc1000/host_interface.c | 70 ++- 1 file changed, 31 insertions(+), 39 deletions(-) diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c index 67b7f0b..7d05754 100644 --- a/drivers/staging/wilc1000/host_interface.c +++ b/drivers/staging/wilc1000/host_interface.c @@ -125,7 +125,7 @@ struct host_if_wep_attr { * @version 1.0 */ union host_if_key_attr { - struct host_if_wep_attr strHostIFwepAttr; + struct host_if_wep_attr wep; struct host_if_wpa_attr strHostIFwpaAttr; struct host_if_pmkid_attr strHostIFpmkidAttr; }; @@ -2350,25 +2350,25 @@ static int Handle_Key(struct host_if_drv *hif_drv, if (pstrHostIFkeyAttr->u8KeyAction & ADDKEY_AP) { PRINT_D(HOSTINF_DBG, "Handling WEP key\n"); - PRINT_D(GENERIC_DBG, "ID Hostint is %d\n", (pstrHostIFkeyAttr->uniHostIFkeyAttr.strHostIFwepAttr.u8Wepidx)); + PRINT_D(GENERIC_DBG, "ID Hostint is %d\n", (pstrHostIFkeyAttr->uniHostIFkeyAttr.wep.u8Wepidx)); strWIDList[0].id = (u16)WID_11I_MODE; strWIDList[0].type = WID_CHAR; strWIDList[0].size = sizeof(char); - strWIDList[0].val = (s8 *)(&(pstrHostIFkeyAttr->uniHostIFkeyAttr.strHostIFwepAttr.u8mode)); + strWIDList[0].val = (s8 *)(&(pstrHostIFkeyAttr->uniHostIFkeyAttr.wep.u8mode)); strWIDList[1].id = WID_AUTH_TYPE; strWIDList[1].type = WID_CHAR; strWIDList[1].size = sizeof(char); - strWIDList[1].val = (s8 *)(&(pstrHostIFkeyAttr->uniHostIFkeyAttr.strHostIFwepAttr.tenuAuth_type)); + strWIDList[1].val = (s8 *)(&(pstrHostIFkeyAttr->uniHostIFkeyAttr.wep.tenuAuth_type)); strWIDList[2].id = (u16)WID_KEY_ID; strWIDList[2].type = WID_CHAR; - strWIDList[2].val = (s8 *)(&(pstrHostIFkeyAttr->uniHostIFkeyAttr.strHostIFwepAttr.u8Wepidx)); + strWIDList[2].val = (s8 *)(&(pstrHostIFkeyAttr->uniHostIFkeyAttr.wep.u8Wepidx)); strWIDList[2].size = sizeof(char); - pu8keybuf = kmalloc(pstrHostIFkeyAttr->uniHostIFkeyAttr.strHostIFwepAttr.u8WepKeylen, GFP_KERNEL); + pu8keybuf = kmalloc(pstrHostIFkeyAttr->uniHostIFkeyAttr.wep.u8WepKeylen, GFP_KERNEL); if (pu8keybuf == NULL) { @@ -2376,15 +2376,15 @@ static int Handle_Key(struct host_if_drv *hif_drv, return -1; } - memcpy(pu8keybuf, pstrHostIFkeyAttr->uniHostIFkeyAttr.strHostIFwepAttr.pu8WepKey, - pstrHostIFkeyAttr->uniHostIFkeyAttr.strHostIFwepAttr.u8WepKeylen); + memcpy(pu8keybuf, pstrHostIFkeyAttr->uniHostIFkeyAttr.wep.pu8WepKey, + pstrHostIFkeyAttr->uniHostIFkeyAttr.wep.u8WepKeylen); - kfree(pstrHostIFkeyAttr->uniHostIFkeyAttr.strHostIFwepAttr.pu8WepKey); + kfree(pstrHostIFkeyAttr->uniHostIFkeyAttr.wep.pu8WepKey); strWIDList[3].id = (u16)WID_WEP_KEY_VALUE; strWIDList[3].type = WID_STR; - strWIDList[3].size = pstrHostIFkeyAttr->uniHostIFkeyAttr.strHostIFwepAttr.u8WepKeylen; + strWIDList[3].size = pstrHostIFkeyAttr->uniHostIFkeyAttr.wep.u8WepKeylen; strWIDList[3].val = (s8 *)pu8keybuf; @@ -2397,24 +2397,24 @@ static int Handle_Key(struct host_if_drv *hif_drv, if (pstrHostIFkeyAttr->u8KeyAction & ADDKEY) { PRINT_D(HOSTINF_DBG, "Handling WEP key\n"); - pu8keybuf = kmalloc(pstrHostIFkeyAttr->uniHostIFkeyAttr.strHostIFwepAttr.u8WepKeylen + 2, GFP_KERNEL); + pu8keybuf = kmalloc(pstrHostIFkeyAttr->uniHostIFkeyAttr.wep.u8WepKeylen + 2, GFP_KERNEL); if (pu8keybuf == NULL) { PRINT_ER("No buffer to send Key\n"); return -1; } - pu8keybuf[0] = pstrHostIFkeyAttr->uniHostIFkeyAttr.strHostIFwepAttr.u8Wepidx; + pu8keybuf[0] = pstrHostIFkeyAttr->uniHostIFkeyAttr.wep.u8Wepidx; - memcpy(pu8keybuf + 1, &pstrHostIFkeyAttr->uniHostIFkeyAttr.strHostIFwepAttr.u8WepKeylen, 1); + memcpy(pu8keybuf + 1, &pstrHostIFkeyAttr->uniHostIFkeyAttr.wep.u8WepKeylen, 1); - memcpy(pu8keybuf + 2, pstrHo
[PATCH 01/11] staging: wilc1000: replace drvHandler and hWFIDrv with hif_drv
This patch replaces the variable names of struct host_if_drv used as the functions' input parameter, drvHandler and hWFIDrv with hif_drv. In addition, the local variable declared in many functions, pstrWFIDrv is removed and hif_drv is directly used. A debug message printing pstrWFIDrv is deleted while removing the local variable because it is not useful as well. Signed-off-by: Tony Cho --- drivers/staging/wilc1000/host_interface.c | 1264 + 1 file changed, 573 insertions(+), 691 deletions(-) diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c index b8b39b2..1a21d19 100644 --- a/drivers/staging/wilc1000/host_interface.c +++ b/drivers/staging/wilc1000/host_interface.c @@ -553,13 +553,12 @@ static struct host_if_drv *get_handler_from_id(int id) * @date * @version 1.0 */ -static s32 Handle_SetChannel(struct host_if_drv *drvHandler, +static s32 Handle_SetChannel(struct host_if_drv *hif_drv, struct channel_attr *pstrHostIFSetChan) { s32 s32Error = 0; struct wid strWID; - struct host_if_drv *pstrWFIDrv = (struct host_if_drv *)drvHandler; /*prepare configuration packet*/ strWID.id = (u16)WID_CURRENT_CHANNEL; @@ -570,7 +569,7 @@ static s32 Handle_SetChannel(struct host_if_drv *drvHandler, PRINT_D(HOSTINF_DBG, "Setting channel\n"); /*Sending Cfg*/ s32Error = send_config_pkt(SET_CFG, &strWID, 1, - get_id_from_handler(pstrWFIDrv)); + get_id_from_handler(hif_drv)); if (s32Error) { PRINT_ER("Failed to set channel\n"); return -EINVAL; @@ -588,14 +587,12 @@ static s32 Handle_SetChannel(struct host_if_drv *drvHandler, * @date * @version 1.0 */ -static s32 Handle_SetWfiDrvHandler(struct host_if_drv *drvHandler, +static s32 Handle_SetWfiDrvHandler(struct host_if_drv *hif_drv, struct drv_handler *pstrHostIfSetDrvHandler) { s32 s32Error = 0; struct wid strWID; - struct host_if_drv *pstrWFIDrv = drvHandler; - /*prepare configuration packet*/ strWID.id = (u16)WID_SET_DRV_HANDLER; @@ -608,7 +605,7 @@ static s32 Handle_SetWfiDrvHandler(struct host_if_drv *drvHandler, s32Error = send_config_pkt(SET_CFG, &strWID, 1, pstrHostIfSetDrvHandler->u32Address); - if (pstrWFIDrv == NULL) + if (!hif_drv) up(&hSemDeinitDrvHandle); @@ -629,14 +626,12 @@ static s32 Handle_SetWfiDrvHandler(struct host_if_drv *drvHandler, * @date * @version 1.0 */ -static s32 Handle_SetOperationMode(struct host_if_drv *drvHandler, +static s32 Handle_SetOperationMode(struct host_if_drv *hif_drv, struct op_mode *pstrHostIfSetOperationMode) { s32 s32Error = 0; struct wid strWID; - struct host_if_drv *pstrWFIDrv = (struct host_if_drv *)drvHandler; - /*prepare configuration packet*/ strWID.id = (u16)WID_SET_OPERATION_MODE; @@ -644,11 +639,8 @@ static s32 Handle_SetOperationMode(struct host_if_drv *drvHandler, strWID.val = (s8 *)&(pstrHostIfSetOperationMode->u32Mode); strWID.size = sizeof(u32); - /*Sending Cfg*/ - PRINT_INFO(HOSTINF_DBG, "pstrWFIDrv= %p\n", pstrWFIDrv); - s32Error = send_config_pkt(SET_CFG, &strWID, 1, - get_id_from_handler(pstrWFIDrv)); + get_id_from_handler(hif_drv)); if ((pstrHostIfSetOperationMode->u32Mode) == IDLE_MODE) @@ -672,13 +664,12 @@ static s32 Handle_SetOperationMode(struct host_if_drv *drvHandler, * @date * @version 1.0 */ -s32 Handle_set_IPAddress(struct host_if_drv *drvHandler, u8 *pu8IPAddr, u8 idx) +s32 Handle_set_IPAddress(struct host_if_drv *hif_drv, u8 *pu8IPAddr, u8 idx) { s32 s32Error = 0; struct wid strWID; char firmwareIPAddress[4] = {0}; - struct host_if_drv *pstrWFIDrv = (struct host_if_drv *)drvHandler; if (pu8IPAddr[0] < 192) pu8IPAddr[0] = 0; @@ -694,10 +685,10 @@ s32 Handle_set_IPAddress(struct host_if_drv *drvHandler, u8 *pu8IPAddr, u8 idx) strWID.size = IP_ALEN; s32Error = send_config_pkt(SET_CFG, &strWID, 1, - get_id_from_handler(pstrWFIDrv)); + get_id_from_handler(hif_drv)); - host_int_get_ipaddress(drvHandler, firmwareIPAddress, idx); + host_int_get_ipaddress(hif_drv, firmwareIPAddress, idx); if (s32Error) { PRINT_ER("Failed to set IP address\n"); @@ -719,12 +710,11 @@ s32 Handle_set_IPAddress(struct host_if_drv *drvHandler, u8 *pu8IPAddr, u8 idx) * @date * @version 1.0 */ -s32 Handle_get_IPAddress(struct host_if_drv *drvHandler, u8 *pu8IPAddr, u8 idx) +s32 Han
[PATCH 05/11] staging: wilc1000: rename strHostIFwpaAttr of union host_if_key_attr
This patch renames strHostIFwpaAttr of union host_if_key_attr to wpa to avoid CamelCase naming convention. Signed-off-by: Tony Cho --- drivers/staging/wilc1000/host_interface.c | 95 ++- 1 file changed, 44 insertions(+), 51 deletions(-) diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c index 7d05754..b8899d7 100644 --- a/drivers/staging/wilc1000/host_interface.c +++ b/drivers/staging/wilc1000/host_interface.c @@ -126,7 +126,7 @@ struct host_if_wep_attr { */ union host_if_key_attr { struct host_if_wep_attr wep; - struct host_if_wpa_attr strHostIFwpaAttr; + struct host_if_wpa_attr wpa; struct host_if_pmkid_attr strHostIFpmkidAttr; }; @@ -2464,21 +2464,21 @@ static int Handle_Key(struct host_if_drv *hif_drv, - if (pstrHostIFkeyAttr->uniHostIFkeyAttr.strHostIFwpaAttr.pu8seq != NULL) - memcpy(pu8keybuf + 6, pstrHostIFkeyAttr->uniHostIFkeyAttr.strHostIFwpaAttr.pu8seq, 8); + if (pstrHostIFkeyAttr->uniHostIFkeyAttr.wpa.pu8seq != NULL) + memcpy(pu8keybuf + 6, pstrHostIFkeyAttr->uniHostIFkeyAttr.wpa.pu8seq, 8); - memcpy(pu8keybuf + 14, &pstrHostIFkeyAttr->uniHostIFkeyAttr.strHostIFwpaAttr.u8keyidx, 1); + memcpy(pu8keybuf + 14, &pstrHostIFkeyAttr->uniHostIFkeyAttr.wpa.u8keyidx, 1); - memcpy(pu8keybuf + 15, &pstrHostIFkeyAttr->uniHostIFkeyAttr.strHostIFwpaAttr.u8Keylen, 1); + memcpy(pu8keybuf + 15, &pstrHostIFkeyAttr->uniHostIFkeyAttr.wpa.u8Keylen, 1); - memcpy(pu8keybuf + 16, pstrHostIFkeyAttr->uniHostIFkeyAttr.strHostIFwpaAttr.pu8key, - pstrHostIFkeyAttr->uniHostIFkeyAttr.strHostIFwpaAttr.u8Keylen); + memcpy(pu8keybuf + 16, pstrHostIFkeyAttr->uniHostIFkeyAttr.wpa.pu8key, + pstrHostIFkeyAttr->uniHostIFkeyAttr.wpa.u8Keylen); /* pstrHostIFkeyAttr->uniHostIFkeyAttr.strHostIFwpaAttr.u8Ciphermode = 0X51; */ strWIDList[0].id = (u16)WID_11I_MODE; strWIDList[0].type = WID_CHAR; strWIDList[0].size = sizeof(char); - strWIDList[0].val = (s8 *)(&(pstrHostIFkeyAttr->uniHostIFkeyAttr.strHostIFwpaAttr.u8Ciphermode)); + strWIDList[0].val = (s8 *)(&(pstrHostIFkeyAttr->uniHostIFkeyAttr.wpa.u8Ciphermode)); strWIDList[1].id = (u16)WID_ADD_RX_GTK; strWIDList[1].type = WID_STR; @@ -2518,13 +2518,13 @@ static int Handle_Key(struct host_if_drv *hif_drv, else PRINT_ER("Couldn't handle WPARxGtk while enuHostIFstate is not HOST_IF_CONNECTED\n"); - memcpy(pu8keybuf + 6, pstrHostIFkeyAttr->uniHostIFkeyAttr.strHostIFwpaAttr.pu8seq, 8); + memcpy(pu8keybuf + 6, pstrHostIFkeyAttr->uniHostIFkeyAttr.wpa.pu8seq, 8); - memcpy(pu8keybuf + 14, &pstrHostIFkeyAttr->uniHostIFkeyAttr.strHostIFwpaAttr.u8keyidx, 1); + memcpy(pu8keybuf + 14, &pstrHostIFkeyAttr->uniHostIFkeyAttr.wpa.u8keyidx, 1); - memcpy(pu8keybuf + 15, &pstrHostIFkeyAttr->uniHostIFkeyAttr.strHostIFwpaAttr.u8Keylen, 1); - memcpy(pu8keybuf + 16, pstrHostIFkeyAttr->uniHostIFkeyAttr.strHostIFwpaAttr.pu8key, - pstrHostIFkeyAttr->uniHostIFkeyAttr.strHostIFwpaAttr.u8Keylen); + memcpy(pu8keybuf + 15, &pstrHostIFkeyAttr->uniHostIFkeyAttr.wpa.u8Keylen, 1); + memcpy(pu8keybuf + 16, pstrHostIFkeyAttr->uniHostIFkeyAttr.wpa.pu8key, + pstrHostIFkeyAttr->uniHostIFkeyAttr.wpa.u8Keylen); strWID.id = (u16)WID_ADD_RX_GTK; strWID.type = WID_STR; @@ -2541,8 +2541,8 @@ static int Handle_Key(struct host_if_drv *hif_drv, /* / */ } _WPARxGtk_end_case_: - kfree(pstrHostIFkeyAttr->uniHostIFkeyAttr.strHostIFwpaAttr.pu8key); - kfree(pstrHostIFkeyAttr->uniHostIFkeyAttr.strHostIFwpaAttr.pu8seq); + kfree(pstrHostIFkeyAttr->uniHostIFkeyAttr.wpa.pu8key); + kfree(pstrHostIFkeyAttr->uniHostIFkeyAttr.wpa.pu8seq); if (ret == -1) return ret; @@ -2569,19 +2569,19 @@ _WPARxGtk_end_case_: | 6 bytes|1 byte| 1byte | 16 bytes|8 bytes |8 bytes| |-|*/ - memcpy(pu8keybuf, pstrHostIF
[PATCH 09/11] staging: wilc1000: rename u8Wepidx of struct host_if_wep_attr
This patch renames u8Wepidx of struct host_if_wep_attr to index to avoid CamelCase naming convention. Signed-off-by: Tony Cho --- drivers/staging/wilc1000/host_interface.c | 20 ++-- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c index 7919851..e99db7d 100644 --- a/drivers/staging/wilc1000/host_interface.c +++ b/drivers/staging/wilc1000/host_interface.c @@ -109,7 +109,7 @@ struct host_if_wpa_attr { struct host_if_wep_attr { u8 *key; u8 key_len; - u8 u8Wepidx; + u8 index; u8 u8mode; enum AUTHTYPE tenuAuth_type; }; @@ -2350,7 +2350,7 @@ static int Handle_Key(struct host_if_drv *hif_drv, if (pstrHostIFkeyAttr->u8KeyAction & ADDKEY_AP) { PRINT_D(HOSTINF_DBG, "Handling WEP key\n"); - PRINT_D(GENERIC_DBG, "ID Hostint is %d\n", (pstrHostIFkeyAttr->uniHostIFkeyAttr.wep.u8Wepidx)); + PRINT_D(GENERIC_DBG, "ID Hostint is %d\n", (pstrHostIFkeyAttr->uniHostIFkeyAttr.wep.index)); strWIDList[0].id = (u16)WID_11I_MODE; strWIDList[0].type = WID_CHAR; strWIDList[0].size = sizeof(char); @@ -2364,7 +2364,7 @@ static int Handle_Key(struct host_if_drv *hif_drv, strWIDList[2].id = (u16)WID_KEY_ID; strWIDList[2].type = WID_CHAR; - strWIDList[2].val = (s8 *)(&(pstrHostIFkeyAttr->uniHostIFkeyAttr.wep.u8Wepidx)); + strWIDList[2].val = (s8 *)(&(pstrHostIFkeyAttr->uniHostIFkeyAttr.wep.index)); strWIDList[2].size = sizeof(char); @@ -2402,7 +2402,7 @@ static int Handle_Key(struct host_if_drv *hif_drv, PRINT_ER("No buffer to send Key\n"); return -1; } - pu8keybuf[0] = pstrHostIFkeyAttr->uniHostIFkeyAttr.wep.u8Wepidx; + pu8keybuf[0] = pstrHostIFkeyAttr->uniHostIFkeyAttr.wep.index; memcpy(pu8keybuf + 1, &pstrHostIFkeyAttr->uniHostIFkeyAttr.wep.key_len, 1); @@ -2425,7 +2425,7 @@ static int Handle_Key(struct host_if_drv *hif_drv, strWID.id = (u16)WID_REMOVE_WEP_KEY; strWID.type = WID_STR; - s8idxarray[0] = (s8)pstrHostIFkeyAttr->uniHostIFkeyAttr.wep.u8Wepidx; + s8idxarray[0] = (s8)pstrHostIFkeyAttr->uniHostIFkeyAttr.wep.index; strWID.val = s8idxarray; strWID.size = 1; @@ -2434,7 +2434,7 @@ static int Handle_Key(struct host_if_drv *hif_drv, } else { strWID.id = (u16)WID_KEY_ID; strWID.type = WID_CHAR; - strWID.val = (s8 *)(&(pstrHostIFkeyAttr->uniHostIFkeyAttr.wep.u8Wepidx)); + strWID.val = (s8 *)(&(pstrHostIFkeyAttr->uniHostIFkeyAttr.wep.index)); strWID.size = sizeof(char); PRINT_D(HOSTINF_DBG, "Setting default key index\n"); @@ -4099,7 +4099,7 @@ s32 host_int_remove_wep_key(struct host_if_drv *hif_drv, u8 u8keyIdx) - msg.body.key_info.uniHostIFkeyAttr.wep.u8Wepidx = u8keyIdx; + msg.body.key_info.uniHostIFkeyAttr.wep.index = u8keyIdx; /* send the message */ s32Error = wilc_mq_send(&gMsgQHostIF, &msg, sizeof(struct host_if_msg)); @@ -4144,7 +4144,7 @@ s32 host_int_set_WEPDefaultKeyID(struct host_if_drv *hif_drv, u8 u8Index) msg.drv = hif_drv; - msg.body.key_info.uniHostIFkeyAttr.wep.u8Wepidx = u8Index; + msg.body.key_info.uniHostIFkeyAttr.wep.index = u8Index; /* send the message */ s32Error = wilc_mq_send(&gMsgQHostIF, &msg, sizeof(struct host_if_msg)); @@ -4208,7 +4208,7 @@ s32 host_int_add_wep_key_bss_sta(struct host_if_drv *hif_drv, msg.body.key_info.uniHostIFkeyAttr.wep.key_len = (u8WepKeylen); - msg.body.key_info.uniHostIFkeyAttr.wep.u8Wepidx = u8Keyidx; + msg.body.key_info.uniHostIFkeyAttr.wep.index = u8Keyidx; /* send the message */ s32Error = wilc_mq_send(&gMsgQHostIF, &msg, sizeof(struct host_if_msg)); @@ -4277,7 +4277,7 @@ s32 host_int_add_wep_key_bss_ap(struct host_if_drv *hif_drv, msg.body.key_info.uniHostIFkeyAttr.wep.key_len = (u8WepKeylen); - msg.body.key_info.uniHostIFkeyAttr.wep.u8Wepidx = u8Keyidx; + msg.body.key_info.uniHostIFkeyAttr.wep.index = u8Keyidx; msg.body.key_info.uniHostIFkeyAttr.wep.u8mode = u8mode; -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 07/11] staging: wilc1000: rename pu8WepKey of struct host_if_wep_attr
This patch renames pu8WepKey of struct host_if_wep_attr to key in order to avoid CamelCase naming convention. Signed-off-by: Tony Cho --- drivers/staging/wilc1000/host_interface.c | 18 +- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c index 31c6644..931dcb5 100644 --- a/drivers/staging/wilc1000/host_interface.c +++ b/drivers/staging/wilc1000/host_interface.c @@ -107,7 +107,7 @@ struct host_if_wpa_attr { * @version 1.0 */ struct host_if_wep_attr { - u8 *pu8WepKey; + u8 *key; u8 u8WepKeylen; u8 u8Wepidx; u8 u8mode; @@ -2376,11 +2376,11 @@ static int Handle_Key(struct host_if_drv *hif_drv, return -1; } - memcpy(pu8keybuf, pstrHostIFkeyAttr->uniHostIFkeyAttr.wep.pu8WepKey, + memcpy(pu8keybuf, pstrHostIFkeyAttr->uniHostIFkeyAttr.wep.key, pstrHostIFkeyAttr->uniHostIFkeyAttr.wep.u8WepKeylen); - kfree(pstrHostIFkeyAttr->uniHostIFkeyAttr.wep.pu8WepKey); + kfree(pstrHostIFkeyAttr->uniHostIFkeyAttr.wep.key); strWIDList[3].id = (u16)WID_WEP_KEY_VALUE; strWIDList[3].type = WID_STR; @@ -2406,10 +2406,10 @@ static int Handle_Key(struct host_if_drv *hif_drv, memcpy(pu8keybuf + 1, &pstrHostIFkeyAttr->uniHostIFkeyAttr.wep.u8WepKeylen, 1); - memcpy(pu8keybuf + 2, pstrHostIFkeyAttr->uniHostIFkeyAttr.wep.pu8WepKey, + memcpy(pu8keybuf + 2, pstrHostIFkeyAttr->uniHostIFkeyAttr.wep.key, pstrHostIFkeyAttr->uniHostIFkeyAttr.wep.u8WepKeylen); - kfree(pstrHostIFkeyAttr->uniHostIFkeyAttr.wep.pu8WepKey); + kfree(pstrHostIFkeyAttr->uniHostIFkeyAttr.wep.key); strWID.id = (u16)WID_ADD_WEP_KEY; strWID.type = WID_STR; @@ -4200,9 +4200,9 @@ s32 host_int_add_wep_key_bss_sta(struct host_if_drv *hif_drv, msg.body.key_info. - uniHostIFkeyAttr.wep.pu8WepKey = kmalloc(u8WepKeylen, GFP_KERNEL); + uniHostIFkeyAttr.wep.key = kmalloc(u8WepKeylen, GFP_KERNEL); - memcpy(msg.body.key_info.uniHostIFkeyAttr.wep.pu8WepKey, + memcpy(msg.body.key_info.uniHostIFkeyAttr.wep.key, pu8WepKey, u8WepKeylen); @@ -4268,10 +4268,10 @@ s32 host_int_add_wep_key_bss_ap(struct host_if_drv *hif_drv, msg.body.key_info. - uniHostIFkeyAttr.wep.pu8WepKey = kmalloc(u8WepKeylen, GFP_KERNEL); + uniHostIFkeyAttr.wep.key = kmalloc(u8WepKeylen, GFP_KERNEL); - memcpy(msg.body.key_info.uniHostIFkeyAttr.wep.pu8WepKey, + memcpy(msg.body.key_info.uniHostIFkeyAttr.wep.key, pu8WepKey, (u8WepKeylen)); -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 08/11] staging: wilc1000: rename u8WepKeylen of struct host_if_wep_attr
This patch renames u8WepKeylen of struct host_if_wep_attr to key_len to avoid CamelCase naming convention. Signed-off-by: Tony Cho --- drivers/staging/wilc1000/host_interface.c | 20 ++-- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c index 931dcb5..7919851 100644 --- a/drivers/staging/wilc1000/host_interface.c +++ b/drivers/staging/wilc1000/host_interface.c @@ -108,7 +108,7 @@ struct host_if_wpa_attr { */ struct host_if_wep_attr { u8 *key; - u8 u8WepKeylen; + u8 key_len; u8 u8Wepidx; u8 u8mode; enum AUTHTYPE tenuAuth_type; @@ -2368,7 +2368,7 @@ static int Handle_Key(struct host_if_drv *hif_drv, strWIDList[2].size = sizeof(char); - pu8keybuf = kmalloc(pstrHostIFkeyAttr->uniHostIFkeyAttr.wep.u8WepKeylen, GFP_KERNEL); + pu8keybuf = kmalloc(pstrHostIFkeyAttr->uniHostIFkeyAttr.wep.key_len, GFP_KERNEL); if (pu8keybuf == NULL) { @@ -2377,14 +2377,14 @@ static int Handle_Key(struct host_if_drv *hif_drv, } memcpy(pu8keybuf, pstrHostIFkeyAttr->uniHostIFkeyAttr.wep.key, - pstrHostIFkeyAttr->uniHostIFkeyAttr.wep.u8WepKeylen); + pstrHostIFkeyAttr->uniHostIFkeyAttr.wep.key_len); kfree(pstrHostIFkeyAttr->uniHostIFkeyAttr.wep.key); strWIDList[3].id = (u16)WID_WEP_KEY_VALUE; strWIDList[3].type = WID_STR; - strWIDList[3].size = pstrHostIFkeyAttr->uniHostIFkeyAttr.wep.u8WepKeylen; + strWIDList[3].size = pstrHostIFkeyAttr->uniHostIFkeyAttr.wep.key_len; strWIDList[3].val = (s8 *)pu8keybuf; @@ -2397,24 +2397,24 @@ static int Handle_Key(struct host_if_drv *hif_drv, if (pstrHostIFkeyAttr->u8KeyAction & ADDKEY) { PRINT_D(HOSTINF_DBG, "Handling WEP key\n"); - pu8keybuf = kmalloc(pstrHostIFkeyAttr->uniHostIFkeyAttr.wep.u8WepKeylen + 2, GFP_KERNEL); + pu8keybuf = kmalloc(pstrHostIFkeyAttr->uniHostIFkeyAttr.wep.key_len + 2, GFP_KERNEL); if (pu8keybuf == NULL) { PRINT_ER("No buffer to send Key\n"); return -1; } pu8keybuf[0] = pstrHostIFkeyAttr->uniHostIFkeyAttr.wep.u8Wepidx; - memcpy(pu8keybuf + 1, &pstrHostIFkeyAttr->uniHostIFkeyAttr.wep.u8WepKeylen, 1); + memcpy(pu8keybuf + 1, &pstrHostIFkeyAttr->uniHostIFkeyAttr.wep.key_len, 1); memcpy(pu8keybuf + 2, pstrHostIFkeyAttr->uniHostIFkeyAttr.wep.key, - pstrHostIFkeyAttr->uniHostIFkeyAttr.wep.u8WepKeylen); + pstrHostIFkeyAttr->uniHostIFkeyAttr.wep.key_len); kfree(pstrHostIFkeyAttr->uniHostIFkeyAttr.wep.key); strWID.id = (u16)WID_ADD_WEP_KEY; strWID.type = WID_STR; strWID.val = (s8 *)pu8keybuf; - strWID.size = pstrHostIFkeyAttr->uniHostIFkeyAttr.wep.u8WepKeylen + 2; + strWID.size = pstrHostIFkeyAttr->uniHostIFkeyAttr.wep.key_len + 2; s32Error = send_config_pkt(SET_CFG, &strWID, 1, get_id_from_handler(hif_drv)); @@ -4206,7 +4206,7 @@ s32 host_int_add_wep_key_bss_sta(struct host_if_drv *hif_drv, pu8WepKey, u8WepKeylen); - msg.body.key_info.uniHostIFkeyAttr.wep.u8WepKeylen = (u8WepKeylen); + msg.body.key_info.uniHostIFkeyAttr.wep.key_len = (u8WepKeylen); msg.body.key_info.uniHostIFkeyAttr.wep.u8Wepidx = u8Keyidx; @@ -4275,7 +4275,7 @@ s32 host_int_add_wep_key_bss_ap(struct host_if_drv *hif_drv, pu8WepKey, (u8WepKeylen)); - msg.body.key_info.uniHostIFkeyAttr.wep.u8WepKeylen = (u8WepKeylen); + msg.body.key_info.uniHostIFkeyAttr.wep.key_len = (u8WepKeylen); msg.body.key_info.uniHostIFkeyAttr.wep.u8Wepidx = u8Keyidx; -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 10/11] staging: wilc1000: rename u8mode of struct host_if_wep_attr
This patch renames u8mode of struct host_if_wep_attr to mode to avoid CamelCase naming convention. Signed-off-by: Tony Cho --- drivers/staging/wilc1000/host_interface.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c index e99db7d..97290c8 100644 --- a/drivers/staging/wilc1000/host_interface.c +++ b/drivers/staging/wilc1000/host_interface.c @@ -110,7 +110,7 @@ struct host_if_wep_attr { u8 *key; u8 key_len; u8 index; - u8 u8mode; + u8 mode; enum AUTHTYPE tenuAuth_type; }; @@ -2354,7 +2354,7 @@ static int Handle_Key(struct host_if_drv *hif_drv, strWIDList[0].id = (u16)WID_11I_MODE; strWIDList[0].type = WID_CHAR; strWIDList[0].size = sizeof(char); - strWIDList[0].val = (s8 *)(&(pstrHostIFkeyAttr->uniHostIFkeyAttr.wep.u8mode)); + strWIDList[0].val = (s8 *)(&(pstrHostIFkeyAttr->uniHostIFkeyAttr.wep.mode)); strWIDList[1].id = WID_AUTH_TYPE; strWIDList[1].type = WID_CHAR; @@ -4279,7 +4279,7 @@ s32 host_int_add_wep_key_bss_ap(struct host_if_drv *hif_drv, msg.body.key_info.uniHostIFkeyAttr.wep.index = u8Keyidx; - msg.body.key_info.uniHostIFkeyAttr.wep.u8mode = u8mode; + msg.body.key_info.uniHostIFkeyAttr.wep.mode = u8mode; msg.body.key_info.uniHostIFkeyAttr.wep.tenuAuth_type = tenuAuth_type; /* send the message */ -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 11/11] staging: wilc1000: rename tenuAuth_type of struct host_if_wep_attr
This patch renames tenuAuth_type of struct host_if_wep_attr to auth_type to avoid CamelCase naming convention. Signed-off-by: Tony Cho --- drivers/staging/wilc1000/host_interface.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c index 97290c8..8afaa633 100644 --- a/drivers/staging/wilc1000/host_interface.c +++ b/drivers/staging/wilc1000/host_interface.c @@ -111,7 +111,7 @@ struct host_if_wep_attr { u8 key_len; u8 index; u8 mode; - enum AUTHTYPE tenuAuth_type; + enum AUTHTYPE auth_type; }; /*! @@ -2359,7 +2359,7 @@ static int Handle_Key(struct host_if_drv *hif_drv, strWIDList[1].id = WID_AUTH_TYPE; strWIDList[1].type = WID_CHAR; strWIDList[1].size = sizeof(char); - strWIDList[1].val = (s8 *)(&(pstrHostIFkeyAttr->uniHostIFkeyAttr.wep.tenuAuth_type)); + strWIDList[1].val = (s8 *)(&(pstrHostIFkeyAttr->uniHostIFkeyAttr.wep.auth_type)); strWIDList[2].id = (u16)WID_KEY_ID; strWIDList[2].type = WID_CHAR; @@ -4281,7 +4281,7 @@ s32 host_int_add_wep_key_bss_ap(struct host_if_drv *hif_drv, msg.body.key_info.uniHostIFkeyAttr.wep.mode = u8mode; - msg.body.key_info.uniHostIFkeyAttr.wep.tenuAuth_type = tenuAuth_type; + msg.body.key_info.uniHostIFkeyAttr.wep.auth_type = tenuAuth_type; /* send the message */ s32Error = wilc_mq_send(&gMsgQHostIF, &msg, sizeof(struct host_if_msg)); -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 06/11] staging: wilc1000: rename strHostIFpmkidAttr of union host_if_key_attr
This patch renames strHostIFpmkidAttr of union host_if_key_attr to pmkid to avoid CamelCase naming convention. Signed-off-by: Tony Cho --- drivers/staging/wilc1000/host_interface.c | 18 +- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c index b8899d7..31c6644 100644 --- a/drivers/staging/wilc1000/host_interface.c +++ b/drivers/staging/wilc1000/host_interface.c @@ -127,7 +127,7 @@ struct host_if_wep_attr { union host_if_key_attr { struct host_if_wep_attr wep; struct host_if_wpa_attr wpa; - struct host_if_pmkid_attr strHostIFpmkidAttr; + struct host_if_pmkid_attr pmkid; }; /*! @@ -2650,24 +2650,24 @@ _WPAPtk_end_case_: PRINT_D(HOSTINF_DBG, "Handling PMKSA key\n"); - pu8keybuf = kmalloc((pstrHostIFkeyAttr->uniHostIFkeyAttr.strHostIFpmkidAttr.numpmkid * PMKSA_KEY_LEN) + 1, GFP_KERNEL); + pu8keybuf = kmalloc((pstrHostIFkeyAttr->uniHostIFkeyAttr.pmkid.numpmkid * PMKSA_KEY_LEN) + 1, GFP_KERNEL); if (pu8keybuf == NULL) { PRINT_ER("No buffer to send PMKSA Key\n"); return -1; } - pu8keybuf[0] = pstrHostIFkeyAttr->uniHostIFkeyAttr.strHostIFpmkidAttr.numpmkid; + pu8keybuf[0] = pstrHostIFkeyAttr->uniHostIFkeyAttr.pmkid.numpmkid; - for (i = 0; i < pstrHostIFkeyAttr->uniHostIFkeyAttr.strHostIFpmkidAttr.numpmkid; i++) { + for (i = 0; i < pstrHostIFkeyAttr->uniHostIFkeyAttr.pmkid.numpmkid; i++) { - memcpy(pu8keybuf + ((PMKSA_KEY_LEN * i) + 1), pstrHostIFkeyAttr->uniHostIFkeyAttr.strHostIFpmkidAttr.pmkidlist[i].bssid, ETH_ALEN); - memcpy(pu8keybuf + ((PMKSA_KEY_LEN * i) + ETH_ALEN + 1), pstrHostIFkeyAttr->uniHostIFkeyAttr.strHostIFpmkidAttr.pmkidlist[i].pmkid, PMKID_LEN); + memcpy(pu8keybuf + ((PMKSA_KEY_LEN * i) + 1), pstrHostIFkeyAttr->uniHostIFkeyAttr.pmkid.pmkidlist[i].bssid, ETH_ALEN); + memcpy(pu8keybuf + ((PMKSA_KEY_LEN * i) + ETH_ALEN + 1), pstrHostIFkeyAttr->uniHostIFkeyAttr.pmkid.pmkidlist[i].pmkid, PMKID_LEN); } strWID.id = (u16)WID_PMKID_INFO; strWID.type = WID_STR; strWID.val = (s8 *)pu8keybuf; - strWID.size = (pstrHostIFkeyAttr->uniHostIFkeyAttr.strHostIFpmkidAttr.numpmkid * PMKSA_KEY_LEN) + 1; + strWID.size = (pstrHostIFkeyAttr->uniHostIFkeyAttr.pmkid.numpmkid * PMKSA_KEY_LEN) + 1; s32Error = send_config_pkt(SET_CFG, &strWID, 1, get_id_from_handler(hif_drv)); @@ -4525,10 +4525,10 @@ s32 host_int_set_pmkid_info(struct host_if_drv *hif_drv, struct host_if_pmkid_at for (i = 0; i < pu8PmkidInfoArray->numpmkid; i++) { - memcpy(msg.body.key_info.uniHostIFkeyAttr.strHostIFpmkidAttr.pmkidlist[i].bssid, &pu8PmkidInfoArray->pmkidlist[i].bssid, + memcpy(msg.body.key_info.uniHostIFkeyAttr.pmkid.pmkidlist[i].bssid, &pu8PmkidInfoArray->pmkidlist[i].bssid, ETH_ALEN); - memcpy(msg.body.key_info.uniHostIFkeyAttr.strHostIFpmkidAttr.pmkidlist[i].pmkid, &pu8PmkidInfoArray->pmkidlist[i].pmkid, + memcpy(msg.body.key_info.uniHostIFkeyAttr.pmkid.pmkidlist[i].pmkid, &pu8PmkidInfoArray->pmkidlist[i].pmkid, PMKID_LEN); } -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging: rtl8188eu: ARRAY_SIZE instead of sizeof/sizeof used
> Signed-off-by: Ivan Safonov The commit message cannot be empty. Please include a brief description of what you're doing in the patch. Also, if you're redoing a patch you've already sent before, make sure you mark it as [PATCH v2] and that you include a changelog below the "---" mark so that reviewers know what's happening without digging through your previous messages. And if you're sending multiple patches for the same driver, make sure to do it as a patch series. In short, if you haven't read Documentation/SubmittingPatches yet, you might find it enlightening. > --- > drivers/staging/rtl8188eu/hal/bb_cfg.c | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff --git a/drivers/staging/rtl8188eu/hal/bb_cfg.c > b/drivers/staging/rtl8188eu/hal/bb_cfg.c > index fa461b4..ff5b15e 100644 > --- a/drivers/staging/rtl8188eu/hal/bb_cfg.c > +++ b/drivers/staging/rtl8188eu/hal/bb_cfg.c > @@ -158,7 +158,7 @@ static u32 array_agc_tab_1t_8188e[] = { > static bool set_baseband_agc_config(struct adapter *adapt) > { > u32 i; > - u32 arraylen = sizeof(array_agc_tab_1t_8188e)/sizeof(u32); > + const u32 arraylen = ARRAY_SIZE(array_agc_tab_1t_8188e); Neither your subject nor your (non-existent) commit message mentions the const qualifier. This should be done in a separate patch, however you might first want to ponder whether those arraylen variables are needed at all. -- Best regards, Michał Kępień ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 2/3] staging: android: ion: Add ion driver for Hi6220 SoC platform
On Thu, Oct 08, 2015 at 03:55:12PM +0800, Chen Feng wrote: > Signed-off-by: Chen Feng > Signed-off-by: Yu Dongbin I can't take a patch with no changelog entry at all, sorry. You are going to have to at least explain what this driver is, what it does, and what hardware it supports. thanks, ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 2/4] staging: comedi: ii_pci20kc: only bipolar ao ranges are 2's complement
On 07/10/15 19:09, H Hartley Sweeten wrote: According the the PCI-2006M user's manual, bipolar ranges use 2's complement coding and unipolar ranges are straight binary. Fix ii20k_ao_insn_write() to use the correct coding based on the range. For aesthetics, use the comedi_offset_munge() helper to handle the munging of the data. Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/ii_pci20kc.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/staging/comedi/drivers/ii_pci20kc.c b/drivers/staging/comedi/drivers/ii_pci20kc.c index 4d3f89c..6e2ce93 100644 --- a/drivers/staging/comedi/drivers/ii_pci20kc.c +++ b/drivers/staging/comedi/drivers/ii_pci20kc.c @@ -146,6 +146,7 @@ static int ii20k_ao_insn_write(struct comedi_device *dev, { void __iomem *iobase = ii20k_module_iobase(dev, s); unsigned int chan = CR_CHAN(insn->chanspec); + unsigned int range = CR_RANGE(insn->chanspec); int i; for (i = 0; i < insn->n; i++) { @@ -153,9 +154,9 @@ static int ii20k_ao_insn_write(struct comedi_device *dev, s->readback[chan] = val; - /* munge data */ - val += ((s->maxdata + 1) >> 1); - val &= s->maxdata; + /* munge the offset binary to 2's complement if needed */ + if (comedi_range_is_bipolar(s, range)) + val = comedi_offset_munge(s, val); writeb(val & 0xff, iobase + II20K_AO_LSB_REG(chan)); writeb((val >> 8) & 0xff, iobase + II20K_AO_MSB_REG(chan)); I'm not sure about that as there are discrepancies in the manual. The one I found was at: https://www.uni-due.de/~hp0259/agwiki/lib/exe/fetch.php?media=anleitungen:pci-20006m.pdf In "5. Specifications" it has: CODE UNIPOLARBinary BIPOLAR Complementary Binary But then under "D/A Codes" it has: OUTDATA Volts Unipolar Volts Bipolar --- -- - 32767 +Full Scale -1 LSB * 0 +½ Full Scale 0 -1 +½ F.S. - 1 LSB -1 LSB -32768 0 -Full Scale ± 5V Range: OUTDATA = VOLTS * (65536 / 10) ± 10V Range: OUTDATA = VOLTS * (65536 / 20) 0 to 10V Range: OUTDATA = (VOLTS * (65536 / 10)) - 32768 * I think that's a typo and should be "+Full Scale - 1 LSB". The table (with typo corrected) and formulae indicate that for both unipolar and bipolar, -32768 is the lowest voltage and +32767 is the highest voltage, so we should munge comedi sample values regardless of range. -- -=( Ian Abbott @ MEV Ltd.E-mail: )=- -=( Web: http://www.mev.co.uk/ )=- ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 1/6] staging: wilc1000: remove typedef from tstrWILC_WFIDrv
On Mon, Oct 05, 2015 at 07:28:09PM +0900, Tony Cho wrote: > From: Leo Kim > > This patch removes typedef from the struct tstrWILC_WFIDrv and > rename it to host_if_drv. > This patch includes the removal of the comment for tstrWILC_WFIDrv as well. > > Signed-off-by: Leo Kim > Signed-off-by: Tony Cho > --- > drivers/staging/wilc1000/host_interface.c | 362 > +++--- > drivers/staging/wilc1000/host_interface.h | 108 +++ > drivers/staging/wilc1000/linux_wlan.c | 16 +- > drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 24 +- > drivers/staging/wilc1000/wilc_wfi_netdevice.h | 4 +- > 5 files changed, 253 insertions(+), 261 deletions(-) This patch fails to apply :( Please rebase and resend the whole series. thanks, greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging: comedi: gsc_hpdi: use preferred kernel types
On 07/10/15 23:31, H Hartley Sweeten wrote: Fix the checkpatch.pl issues about: CHECK: Prefer kernel type 'u32' over 'uint32_t' CHECK: Prefer kernel type 'u8' over 'uint8_t' Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/gsc_hpdi.c | 28 ++-- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/drivers/staging/comedi/drivers/gsc_hpdi.c b/drivers/staging/comedi/drivers/gsc_hpdi.c index e929618..46ca5d9 100644 --- a/drivers/staging/comedi/drivers/gsc_hpdi.c +++ b/drivers/staging/comedi/drivers/gsc_hpdi.c @@ -125,7 +125,7 @@ struct hpdi_private { void __iomem *plx9080_mmio; - uint32_t *dio_buffer[NUM_DMA_BUFFERS]; /* dma buffers */ + u32 *dio_buffer[NUM_DMA_BUFFERS]; /* dma buffers */ /* physical addresses of dma buffers */ dma_addr_t dio_buffer_phys_addr[NUM_DMA_BUFFERS]; /* @@ -137,7 +137,7 @@ struct hpdi_private { dma_addr_t dma_desc_phys_addr; unsigned int num_dma_descriptors; /* pointer to start of buffers indexed by descriptor */ - uint32_t *desc_dio_buffer[NUM_DMA_DESCRIPTORS]; + u32 *desc_dio_buffer[NUM_DMA_DESCRIPTORS]; /* index of the dma descriptor that is currently being used */ unsigned int dma_desc_index; unsigned int tx_fifo_size; @@ -169,7 +169,7 @@ static void gsc_hpdi_drain_dma(struct comedi_device *dev, unsigned int channel) for (desc = 0; (next < start || next >= start + devpriv->block_size) && desc < devpriv->num_dma_descriptors; desc++) { /* transfer data from dma buffer to comedi buffer */ - size = devpriv->block_size / sizeof(uint32_t); + size = devpriv->block_size / sizeof(u32); if (cmd->stop_src == TRIG_COUNT) { if (size > devpriv->dio_count) size = devpriv->dio_count; @@ -192,10 +192,10 @@ static irqreturn_t gsc_hpdi_interrupt(int irq, void *d) struct hpdi_private *devpriv = dev->private; struct comedi_subdevice *s = dev->read_subdev; struct comedi_async *async = s->async; - uint32_t hpdi_intr_status, hpdi_board_status; - uint32_t plx_status; - uint32_t plx_bits; - uint8_t dma0_status, dma1_status; + u32 hpdi_intr_status, hpdi_board_status; + u32 plx_status; + u32 plx_bits; + u8 dma0_status, dma1_status; unsigned long flags; if (!dev->attached) @@ -290,7 +290,7 @@ static int gsc_hpdi_cmd(struct comedi_device *dev, struct comedi_async *async = s->async; struct comedi_cmd *cmd = &async->cmd; unsigned long flags; - uint32_t bits; + u32 bits; if (s->io_bits) return -EINVAL; @@ -424,15 +424,15 @@ static int gsc_hpdi_setup_dma_descriptors(struct comedi_device *dev, { struct hpdi_private *devpriv = dev->private; dma_addr_t phys_addr = devpriv->dma_desc_phys_addr; - uint32_t next_bits = PLX_DESC_IN_PCI_BIT | PLX_INTR_TERM_COUNT | -PLX_XFER_LOCAL_TO_PCI; + u32 next_bits = PLX_DESC_IN_PCI_BIT | PLX_INTR_TERM_COUNT | + PLX_XFER_LOCAL_TO_PCI; unsigned int offset = 0; unsigned int idx = 0; unsigned int i; if (len > DMA_BUFFER_SIZE) len = DMA_BUFFER_SIZE; - len -= len % sizeof(uint32_t); + len -= len % sizeof(u32); if (len == 0) return -EINVAL; @@ -445,7 +445,7 @@ static int gsc_hpdi_setup_dma_descriptors(struct comedi_device *dev, (i + 1) * sizeof(devpriv->dma_desc[0])) | next_bits); devpriv->desc_dio_buffer[i] = devpriv->dio_buffer[idx] + - (offset / sizeof(uint32_t)); + (offset / sizeof(u32)); offset += len; if (len + offset > DMA_BUFFER_SIZE) { @@ -516,7 +516,7 @@ static void gsc_hpdi_free_dma(struct comedi_device *dev) static int gsc_hpdi_init(struct comedi_device *dev) { struct hpdi_private *devpriv = dev->private; - uint32_t plx_intcsr_bits; + u32 plx_intcsr_bits; /* wait 10usec after reset before accessing fifos */ writel(BOARD_RESET_BIT, dev->mmio + BOARD_CONTROL_REG); @@ -546,7 +546,7 @@ static int gsc_hpdi_init(struct comedi_device *dev) static void gsc_hpdi_init_plx9080(struct comedi_device *dev) { struct hpdi_private *devpriv = dev->private; - uint32_t bits; + u32 bits; void __iomem *plx_iobase = devpriv->plx9080_mmio; #ifdef __BIG_ENDIAN Reviewed-by: Ian Abbott -- -=( Ian Abbott @ MEV Ltd.E-mail: )=- -=( Web: http://www.mev.co.uk/ )=- ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxd
Re: [PATCH] staging: comedi: fl512: usleep_range is preferred over udelay
On 07/10/15 23:43, H Hartley Sweeten wrote: Fix checkpatch.pl issue: CHECK: usleep_range is preferred over udelay; see Documentation/timers/timers-howto.txt Replace the udelay() with usleep_range() with a reasonable upper limit. Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/fl512.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/comedi/drivers/fl512.c b/drivers/staging/comedi/drivers/fl512.c index 55cae61..0f278ff 100644 --- a/drivers/staging/comedi/drivers/fl512.c +++ b/drivers/staging/comedi/drivers/fl512.c @@ -71,7 +71,7 @@ static int fl512_ai_insn_read(struct comedi_device *dev, outb(0, dev->iobase + FL512_AI_START_CONV_REG); /* XXX should test "done" flag instead of delay */ - udelay(30); + usleep_range(30, 100); val = inb(dev->iobase + FL512_AI_LSB_REG); val |= (inb(dev->iobase + FL512_AI_MSB_REG) << 8); Reviewed-by: Ian Abbott -- -=( Ian Abbott @ MEV Ltd.E-mail: )=- -=( Web: http://www.mev.co.uk/ )=- ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 01/14] staging: wilc1000: remove typedef from tstrWILC_UsrScanReq
On Thu, Oct 08, 2015 at 10:49:08AM +0900, Tony Cho wrote: > From: Leo Kim > > This patch removes typedef from the struct tstrWILC_UsrScanReq with > related comments and renames it to user_scan_req. > > Signed-off-by: Leo Kim > Signed-off-by: Tony Cho > --- > drivers/staging/wilc1000/host_interface.h | 7 +++ > 1 file changed, 3 insertions(+), 4 deletions(-) This series also didn't apply :( ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 01/11] staging: wilc1000: replace drvHandler and hWFIDrv with hif_drv
On Thu, Oct 08, 2015 at 06:10:46PM +0900, Tony Cho wrote: > This patch replaces the variable names of struct host_if_drv used as the > functions' input parameter, drvHandler and hWFIDrv with hif_drv. In > addition, the local variable declared in many functions, pstrWFIDrv is > removed and hif_drv is directly used. A debug message printing pstrWFIDrv is > deleted while removing the local variable because it is not useful as well. > > Signed-off-by: Tony Cho > --- > drivers/staging/wilc1000/host_interface.c | 1264 > + > 1 file changed, 573 insertions(+), 691 deletions(-) And of course, this one didn't apply either :( ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 01/10] staging: wilc1000: remove typedef from tstrWID
On Tue, Oct 06, 2015 at 06:42:12PM +0900, Tony Cho wrote: > From: Leo Kim > > This patch removes typedef from the struct tstrWID and > rename it to wid. > > Signed-off-by: Leo Kim > Signed-off-by: Tony Cho > --- > drivers/staging/wilc1000/coreconfigurator.c | 2 +- > drivers/staging/wilc1000/coreconfigurator.h | 7 +-- > drivers/staging/wilc1000/host_interface.c | 92 > ++--- > 3 files changed, 50 insertions(+), 51 deletions(-) This series also did not apply :( ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 0/3] staging: comedi: dt9812: minor cleanup
On 07/10/15 23:58, H Hartley Sweeten wrote: Fix the checkpatch.pl issues in this driver. H Hartley Sweeten (3): staging: comedi: dt9812: tidy up multi-line comment staging: comedi: dt9812: rename F020_MASK_DACxCN_DACxEN staging: comedi: dt9812: reword comments to fix checkpatch.pl issues drivers/staging/comedi/drivers/dt9812.c | 38 - 1 file changed, 18 insertions(+), 20 deletions(-) Thanks! Reviewed-by: Ian Abbott -- -=( Ian Abbott @ MEV Ltd.E-mail: )=- -=( Web: http://www.mev.co.uk/ )=- ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 10/10] drivers:hv: Define the channel type for Hyper-V PCI Express pass-through
"K. Y. Srinivasan" writes: > From: Jake Oshins > > This defines the channel type for PCI front-ends in Hyper-V VMs. > > Signed-off-by: Jake Oshins > Signed-off-by: K. Y. Srinivasan > --- > drivers/hv/channel_mgmt.c |3 +++ > include/linux/hyperv.h| 11 +++ > 2 files changed, 14 insertions(+), 0 deletions(-) > > diff --git a/drivers/hv/channel_mgmt.c b/drivers/hv/channel_mgmt.c > index 652afd1..1ae615b 100644 > --- a/drivers/hv/channel_mgmt.c > +++ b/drivers/hv/channel_mgmt.c > @@ -358,6 +358,7 @@ enum { > SCSI, > NIC, > ND_NIC, > + HV_PCIE, > MAX_PERF_CHN, > }; It seems all other members of the enum don't have HV_ prefix... should we add it there or remove it from HV_PCIE? > > @@ -375,6 +376,8 @@ static const struct hv_vmbus_device_id hp_devs[] = { > { HV_NIC_GUID, }, > /* NetworkDirect Guest RDMA */ > { HV_ND_GUID, }, > + /* PCI Express Pass Through */ > + { HV_PCIE_GUID, }, > }; And here everything is prefixed with HV_ ... so I'd say we add HV_ to all members of the previously mentioned enum. [...] -- Vitaly ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 09/14] staging: comedi: dt3000: the dt3002 board does not have analog outputs
On 08/10/15 02:26, H Hartley Sweeten wrote: According to the boardinfo, the dt3002 board does not have analog outputs. The rest of the board have two 12-bit analog output channels. Replace the 'dachan' and 'dabits' members of the boardinfo with a bit- field flag 'has_ao'. Use the new member to conditionally initialize the analog output subdevice. Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/dt3000.c | 40 +++-- 1 file changed, 18 insertions(+), 22 deletions(-) diff --git a/drivers/staging/comedi/drivers/dt3000.c b/drivers/staging/comedi/drivers/dt3000.c index 8d6d344..12cf65a 100644 --- a/drivers/staging/comedi/drivers/dt3000.c +++ b/drivers/staging/comedi/drivers/dt3000.c [snip] @@ -681,15 +674,18 @@ static int dt3000_auto_attach(struct comedi_device *dev, s->cancel= dt3k_ai_cancel; } + /* Analog Output subdevice */ s = &dev->subdevices[1]; - /* ao subsystem */ - s->type = COMEDI_SUBD_AO; - s->subdev_flags = SDF_WRITABLE; - s->n_chan= 2; - s->maxdata = (1 << board->dabits) - 1; - s->len_chanlist = 1; - s->range_table = &range_bipolar10; - s->insn_write= dt3k_ao_insn_write; + if (board->has_ao) { + s->type = COMEDI_SUBD_AO; + s->subdev_flags = SDF_WRITABLE; + s->n_chan= 2; + s->maxdata = 0x0fff; + s->range_table = &range_bipolar10; + s->insn_write= dt3k_ao_insn_write; + } else { + s->type = COMEDI_SUBD_UNUSED; + } ret = comedi_alloc_subdev_readback(s); if (ret) The comedi_alloc_subdev_readback() needs moving into the `if (board->has_ao)` block. -- -=( Ian Abbott @ MEV Ltd.E-mail: )=- -=( Web: http://www.mev.co.uk/ )=- ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 00/17] staging: comedi: icp_multi: cleanup driver
On 07/10/15 22:52, H Hartley Sweeten wrote: Fix the checkpatch.pl issues and tidy up this driver a bit. H Hartley Sweeten (17): staging: comedi: icp_multi: tidy up multi-line comments staging: comedi: icp_multi: tidy up the ADC command/status register bits staging: comedi: icp_multi: tidy up the DAC command/status register bits staging: comedi: icp_multi: tidy up the interrupt enable/status register bits staging: comedi: icp_multi: rename static variable 'range_analog' staging: comedi: icp_multi: remove unnecessary block comment staging: comedi: icp_multi: remove unused members from private data staging: comedi: icp_multi: absorb setup_channel_list() staging: comedi: icp_multi: remove interrupt support staging: comedi: icp_multi: remove useless interrupt disable code staging: comedi: icp_multi: remove check_channel_list() staging: comedi: icp_multi: remove private data member 'DacCmdStatus' staging: comedi: icp_multi: fix clock comment CodingStyle staging: comedi: icp_multi: remove counter subdevice staging: comedi: icp_multi: tidy up subdevice init staging: comedi: icp_multi: remove board reset during (*detach) staging: comedi: icp_multi: update the MODULE_DESCRIPTION drivers/staging/comedi/drivers/icp_multi.c | 517 - 1 file changed, 147 insertions(+), 370 deletions(-) Thanks! Reviewed-by: Ian Abbott -- -=( Ian Abbott @ MEV Ltd.E-mail: )=- -=( Web: http://www.mev.co.uk/ )=- ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 2/3] staging: android: ion: Add ion driver for Hi6220 SoC platform
Hi Chen, [auto build test WARNING on v4.3-rc4 -- if it's inappropriate base, please ignore] config: arm-allyesconfig (attached as .config) reproduce: wget https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross # save the attached .config to linux build tree make.cross ARCH=arm All warnings (new ones prefixed by >>): >> WARNING: drivers/built-in.o(.data+0x7f8f14): Section mismatch in reference >> from the variable hi6220_ion_driver to the function >> .init.text:hi6220_ion_probe() The variable hi6220_ion_driver references the function __init hi6220_ion_probe() If the reference is valid then annotate the variable with or __refdata (see linux/init.h) or name the variable: --- 0-DAY kernel test infrastructureOpen Source Technology Center https://lists.01.org/pipermail/kbuild-all Intel Corporation .config.gz Description: Binary data ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 01/10] Drivers: hv: util: Increase the timeout for util services
On Wed, Oct 07, K. Y. Srinivasan wrote: > Util services such as KVP and FCOPY need assistance from daemon's running > in user space. Increase the timeout so we don't prematurely terminate > the transaction in the kernel. Is this an arbitrary number, or does the host allow such a large delay for the response? Olaf ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 02/10] Drivers: hv: utils: run polling callback always in interrupt context
"K. Y. Srinivasan" writes: > From: Olaf Hering > > All channel interrupts are bound to specific VCPUs in the guest > at the point channel is created. While currently, we invoke the > polling function on the correct CPU (the CPU to which the channel > is bound to) in some cases we may run the polling function in > a non-interrupt context. This potentially can cause an issue as the > polling function can be interrupted by the channel callback function. > Fix the issue by running the polling function on the appropriate CPU > at interrupt level. Additional details of the issue being addressed by > this patch are given below: > > Currently hv_fcopy_onchannelcallback is called from interrupts and also > via the ->write function of hv_utils. Since the used global variables to > maintain state are not thread safe the state can get out of sync. > This affects the variable state as well as the channel inbound buffer. > > As suggested by KY adjust hv_poll_channel to always run the given > callback on the cpu which the channel is bound to. This avoids the need > for locking because all the util services are single threaded and only > one transaction is active at any given point in time. > > Additionally, remove the context variable, they will always be the same as > recv_channel. > > Signed-off-by: Olaf Hering > Signed-off-by: K. Y. Srinivasan > --- > drivers/hv/hv_fcopy.c | 37 + > drivers/hv/hv_kvp.c | 28 ++-- > drivers/hv/hv_snapshot.c | 29 +++-- > drivers/hv/hyperv_vmbus.h |6 +- > 4 files changed, 35 insertions(+), 65 deletions(-) > > diff --git a/drivers/hv/hv_fcopy.c b/drivers/hv/hv_fcopy.c > index bbdec50..4eab465 100644 > --- a/drivers/hv/hv_fcopy.c > +++ b/drivers/hv/hv_fcopy.c > @@ -51,7 +51,6 @@ static struct { > struct hv_fcopy_hdr *fcopy_msg; /* current message */ > struct vmbus_channel *recv_channel; /* chn we got the request */ > u64 recv_req_id; /* request ID. */ > - void *fcopy_context; /* for the channel callback */ > } fcopy_transaction; > > static void fcopy_respond_to_host(int error); > @@ -67,6 +66,13 @@ static struct hvutil_transport *hvt; > */ > static int dm_reg_value; > > +static void fcopy_poll_wrapper(void *channel) > +{ > + /* Transaction is finished, reset the state here to avoid races. */ > + fcopy_transaction.state = HVUTIL_READY; > + hv_fcopy_onchannelcallback(channel); > +} > + > static void fcopy_timeout_func(struct work_struct *dummy) > { > /* > @@ -74,13 +80,7 @@ static void fcopy_timeout_func(struct work_struct *dummy) >* process the pending transaction. >*/ > fcopy_respond_to_host(HV_E_FAIL); > - > - /* Transaction is finished, reset the state. */ > - if (fcopy_transaction.state > HVUTIL_READY) > - fcopy_transaction.state = HVUTIL_READY; > - > - hv_poll_channel(fcopy_transaction.fcopy_context, > - hv_fcopy_onchannelcallback); > + hv_poll_channel(fcopy_transaction.recv_channel, fcopy_poll_wrapper); > } > > static int fcopy_handle_handshake(u32 version) > @@ -108,9 +108,9 @@ static int fcopy_handle_handshake(u32 version) > return -EINVAL; > } > pr_debug("FCP: userspace daemon ver. %d registered\n", version); > + /* Forward state for hv_fcopy_onchannelcallback */ > fcopy_transaction.state = HVUTIL_READY; > - hv_poll_channel(fcopy_transaction.fcopy_context, > - hv_fcopy_onchannelcallback); > + hv_poll_channel(fcopy_transaction.recv_channel, fcopy_poll_wrapper); > return 0; > } > > @@ -227,15 +227,8 @@ void hv_fcopy_onchannelcallback(void *context) > int util_fw_version; > int fcopy_srv_version; > > - if (fcopy_transaction.state > HVUTIL_READY) { > - /* > - * We will defer processing this callback once > - * the current transaction is complete. > - */ > - fcopy_transaction.fcopy_context = context; > + if (fcopy_transaction.state > HVUTIL_READY) > return; > - } > - fcopy_transaction.fcopy_context = NULL; > > vmbus_recvpacket(channel, recv_buffer, PAGE_SIZE * 2, &recvlen, >&requestid); > @@ -295,9 +288,6 @@ static int fcopy_on_msg(void *msg, int len) > if (fcopy_transaction.state == HVUTIL_DEVICE_INIT) > return fcopy_handle_handshake(*val); > > - if (fcopy_transaction.state != HVUTIL_USERSPACE_REQ) > - return -EINVAL; > - This particular change seems unrelated and I'm unsure it's safe to remove this check. It is meant to protect against daemon screwing the protocol and writing to the device when it wasn't requested for an action. It is correct to propagate -EINVAL in this case. Or am I missing something and the check is redundant now? Thanks, [...] -- Vitaly ___ de
Re: [PATCH 02/10] Drivers: hv: utils: run polling callback always in interrupt context
On Thu, Oct 08, Vitaly Kuznetsov wrote: > > @@ -295,9 +288,6 @@ static int fcopy_on_msg(void *msg, int len) > > if (fcopy_transaction.state == HVUTIL_DEVICE_INIT) > > return fcopy_handle_handshake(*val); > > > > - if (fcopy_transaction.state != HVUTIL_USERSPACE_REQ) > > - return -EINVAL; > > - > > This particular change seems unrelated and I'm unsure it's safe to > remove this check. It is meant to protect against daemon screwing the > protocol and writing to the device when it wasn't requested for an > action. It is correct to propagate -EINVAL in this case. Or am I missing > something and the check is redundant now? What can happen if there is an odd write request? If there is a timeout scheduled some return value will be sent to the host. Then the state is set to RESET and eventually vmbus_recvpacket will receive something. That something will be processed and passed to the daemon. If there was no timeout scheduled the write will just return. Olaf ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 02/10] Drivers: hv: utils: run polling callback always in interrupt context
Olaf Hering writes: > On Thu, Oct 08, Vitaly Kuznetsov wrote: > >> > @@ -295,9 +288,6 @@ static int fcopy_on_msg(void *msg, int len) >> >if (fcopy_transaction.state == HVUTIL_DEVICE_INIT) >> >return fcopy_handle_handshake(*val); >> > >> > - if (fcopy_transaction.state != HVUTIL_USERSPACE_REQ) >> > - return -EINVAL; >> > - >> >> This particular change seems unrelated and I'm unsure it's safe to >> remove this check. It is meant to protect against daemon screwing the >> protocol and writing to the device when it wasn't requested for an >> action. It is correct to propagate -EINVAL in this case. Or am I missing >> something and the check is redundant now? > > What can happen if there is an odd write request? I think we don't want to propagate misbehaving daemon's data to the host -- let's cut it here. E.g. imagine there is no communication going on and daemon starts writing something to the device. In case we remove the check we'll be doing fcopy_respond_to_host() for each daemon's write flooding the host. > If there is a timeout > scheduled some return value will be sent to the host. Then the state is > set to RESET and eventually vmbus_recvpacket will receive something. > That something will be processed and passed to the daemon. > > If there was no timeout scheduled the write will just return. yes, but after doing fcopy_respond_to_host(). I'd suggest we leave the check in place, better safe than sorry. -- Vitaly ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
RE: [PATCH 01/10] Drivers: hv: util: Increase the timeout for util services
> -Original Message- > From: Olaf Hering [mailto:o...@aepfle.de] > Sent: Thursday, October 8, 2015 6:24 AM > To: KY Srinivasan > Cc: gre...@linuxfoundation.org; linux-ker...@vger.kernel.org; > de...@linuxdriverproject.org; a...@canonical.com; vkuzn...@redhat.com; > jasow...@redhat.com > Subject: Re: [PATCH 01/10] Drivers: hv: util: Increase the timeout for util > services > > On Wed, Oct 07, K. Y. Srinivasan wrote: > > > Util services such as KVP and FCOPY need assistance from daemon's > running > > in user space. Increase the timeout so we don't prematurely terminate > > the transaction in the kernel. > > Is this an arbitrary number, or does the host allow such a large delay > for the response? Checked with the host guys and it looks like host sets up a 60 second timeout for each transaction and if it times out; it may retry. Anything below 60 seconds should work for us. I will add this to the commit log. K. Y > > Olaf ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
RE: [PATCH 02/10] Drivers: hv: utils: run polling callback always in interrupt context
> -Original Message- > From: Vitaly Kuznetsov [mailto:vkuzn...@redhat.com] > Sent: Thursday, October 8, 2015 6:53 AM > To: Olaf Hering > Cc: KY Srinivasan ; gre...@linuxfoundation.org; linux- > ker...@vger.kernel.org; de...@linuxdriverproject.org; a...@canonical.com; > jasow...@redhat.com > Subject: Re: [PATCH 02/10] Drivers: hv: utils: run polling callback always in > interrupt context > > Olaf Hering writes: > > > On Thu, Oct 08, Vitaly Kuznetsov wrote: > > > >> > @@ -295,9 +288,6 @@ static int fcopy_on_msg(void *msg, int len) > >> > if (fcopy_transaction.state == HVUTIL_DEVICE_INIT) > >> > return fcopy_handle_handshake(*val); > >> > > >> > -if (fcopy_transaction.state != HVUTIL_USERSPACE_REQ) > >> > -return -EINVAL; > >> > - > >> > >> This particular change seems unrelated and I'm unsure it's safe to > >> remove this check. It is meant to protect against daemon screwing the > >> protocol and writing to the device when it wasn't requested for an > >> action. It is correct to propagate -EINVAL in this case. Or am I missing > >> something and the check is redundant now? > > > > What can happen if there is an odd write request? > > I think we don't want to propagate misbehaving daemon's data to the > host -- let's cut it here. E.g. imagine there is no communication going > on and daemon starts writing something to the device. In case we remove > the check we'll be doing fcopy_respond_to_host() for each daemon's write > flooding the host. > > > If there is a timeout > > scheduled some return value will be sent to the host. Then the state is > > set to RESET and eventually vmbus_recvpacket will receive something. > > That something will be processed and passed to the daemon. > > > > If there was no timeout scheduled the write will just return. > > yes, but after doing fcopy_respond_to_host(). I'd suggest we leave the > check in place, better safe than sorry. Agreed; Olaf, if it is ok with you, I can fix it up and send. Regards, K. Y > > -- > Vitaly ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2 0/3] staging: rtl8188eu: ARRAY_SIZE instead of sizeof/sizeof and some code cleanups
This patchset: - removes unused macro read_nexp_pair, - inserts ARRAY_SIZE instead of sizeof(type array[])/sizeof(type), - inserts spaces preferred around that '+' found by checkpatch. --- Changes in v2: - some patches aggregated into this patchset - added description to all patches Ivan Safonov (3): staging: rtl8188eu: unused macro read_nexp_pair removed staging: rtl8188eu: ARRAY_SIZE instead of sizeof/sizeof used staging: rtl8188eu: spaces preferred around that + inserted drivers/staging/rtl8188eu/hal/bb_cfg.c | 24 1 file changed, 8 insertions(+), 16 deletions(-) -- 2.4.9 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2 1/3] staging: rtl8188eu: unused macro read_nexp_pair removed
This patch removes unused macro read_nexp_pair. --- Changes in v2: - added description to this patch. Signed-off-by: Ivan Safonov --- drivers/staging/rtl8188eu/hal/bb_cfg.c | 8 1 file changed, 8 deletions(-) diff --git a/drivers/staging/rtl8188eu/hal/bb_cfg.c b/drivers/staging/rtl8188eu/hal/bb_cfg.c index 9c7e626..fa461b4 100644 --- a/drivers/staging/rtl8188eu/hal/bb_cfg.c +++ b/drivers/staging/rtl8188eu/hal/bb_cfg.c @@ -22,14 +22,6 @@ #include -#define read_next_pair(array, v1, v2, i) \ -do { \ - i += 2; \ - v1 = array[i]; \ - v2 = array[i+1];\ -} while (0) - - /* AGC_TAB_1T.TXT */ static u32 array_agc_tab_1t_8188e[] = { -- 2.4.9 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2 2/3] staging: rtl8188eu: ARRAY_SIZE instead of sizeof/sizeof used
This patch inserts ARRAY_SIZE instead of sizeof(type array[])/sizeof(type). --- Changes in v2: - inserted description to this patch Signed-off-by: Ivan Safonov --- drivers/staging/rtl8188eu/hal/bb_cfg.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/staging/rtl8188eu/hal/bb_cfg.c b/drivers/staging/rtl8188eu/hal/bb_cfg.c index fa461b4..88c3ad7 100644 --- a/drivers/staging/rtl8188eu/hal/bb_cfg.c +++ b/drivers/staging/rtl8188eu/hal/bb_cfg.c @@ -158,7 +158,7 @@ static u32 array_agc_tab_1t_8188e[] = { static bool set_baseband_agc_config(struct adapter *adapt) { u32 i; - u32 arraylen = sizeof(array_agc_tab_1t_8188e)/sizeof(u32); + const u32 arraylen = ARRAY_SIZE(array_agc_tab_1t_8188e); u32 *array = array_agc_tab_1t_8188e; for (i = 0; i < arraylen; i += 2) { @@ -393,7 +393,7 @@ static void rtl_bb_delay(struct adapter *adapt, u32 addr, u32 data) static bool set_baseband_phy_config(struct adapter *adapt) { u32 i; - u32 arraylen = sizeof(array_phy_reg_1t_8188e)/sizeof(u32); + const u32 arraylen = ARRAY_SIZE(array_phy_reg_1t_8188e); u32 *array = array_phy_reg_1t_8188e; for (i = 0; i < arraylen; i += 2) { @@ -574,8 +574,8 @@ static void rtl_addr_delay(struct adapter *adapt, static bool config_bb_with_pgheader(struct adapter *adapt) { - u32 i = 0; - u32 arraylen = sizeof(array_phy_reg_pg_8188e) / sizeof(u32); + u32 i; + const u32 arraylen = ARRAY_SIZE(array_phy_reg_pg_8188e); u32 *array = array_phy_reg_pg_8188e; for (i = 0; i < arraylen; i += 3) { -- 2.4.9 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2 3/3] staging: rtl8188eu: spaces preferred around that + inserted
This patch inserts spaces preferred around that '+' found by checkpatch. --- Changes in v2: - inserted description to this patch. --- drivers/staging/rtl8188eu/hal/bb_cfg.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/staging/rtl8188eu/hal/bb_cfg.c b/drivers/staging/rtl8188eu/hal/bb_cfg.c index 88c3ad7..4eb982b 100644 --- a/drivers/staging/rtl8188eu/hal/bb_cfg.c +++ b/drivers/staging/rtl8188eu/hal/bb_cfg.c @@ -163,7 +163,7 @@ static bool set_baseband_agc_config(struct adapter *adapt) for (i = 0; i < arraylen; i += 2) { u32 v1 = array[i]; - u32 v2 = array[i+1]; + u32 v2 = array[i + 1]; if (v1 < 0xCDCDCDCD) { phy_set_bb_reg(adapt, v1, bMaskDWord, v2); @@ -398,7 +398,7 @@ static bool set_baseband_phy_config(struct adapter *adapt) for (i = 0; i < arraylen; i += 2) { u32 v1 = array[i]; - u32 v2 = array[i+1]; + u32 v2 = array[i + 1]; if (v1 < 0xCDCDCDCD) rtl_bb_delay(adapt, v1, v2); @@ -580,8 +580,8 @@ static bool config_bb_with_pgheader(struct adapter *adapt) for (i = 0; i < arraylen; i += 3) { u32 v1 = array[i]; - u32 v2 = array[i+1]; - u32 v3 = array[i+2]; + u32 v2 = array[i + 1]; + u32 v3 = array[i + 2]; if (v1 < 0xCDCDCDCD) rtl_addr_delay(adapt, v1, v2, v3); -- 2.4.9 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
RE: [PATCH 2/4] staging: comedi: ii_pci20kc: only bipolar ao ranges are 2's complement
On Thursday, October 08, 2015 3:03 AM, Ian Abbott wrote: > On 07/10/15 19:09, H Hartley Sweeten wrote: >> According the the PCI-2006M user's manual, bipolar ranges use 2's >> complement coding and unipolar ranges are straight binary. Fix >> ii20k_ao_insn_write() to use the correct coding based on the range. >> >> For aesthetics, use the comedi_offset_munge() helper to handle the >> munging of the data. >> >> Signed-off-by: H Hartley Sweeten >> Cc: Ian Abbott >> Cc: Greg Kroah-Hartman >> --- >> drivers/staging/comedi/drivers/ii_pci20kc.c | 7 --- >> 1 file changed, 4 insertions(+), 3 deletions(-) >> >> diff --git a/drivers/staging/comedi/drivers/ii_pci20kc.c >> b/drivers/staging/comedi/drivers/ii_pci20kc.c >> index 4d3f89c..6e2ce93 100644 >> --- a/drivers/staging/comedi/drivers/ii_pci20kc.c >> +++ b/drivers/staging/comedi/drivers/ii_pci20kc.c >> @@ -146,6 +146,7 @@ static int ii20k_ao_insn_write(struct comedi_device *dev, >> { >> void __iomem *iobase = ii20k_module_iobase(dev, s); >> unsigned int chan = CR_CHAN(insn->chanspec); >> +unsigned int range = CR_RANGE(insn->chanspec); >> int i; >> >> for (i = 0; i < insn->n; i++) { >> @@ -153,9 +154,9 @@ static int ii20k_ao_insn_write(struct comedi_device *dev, >> >> s->readback[chan] = val; >> >> -/* munge data */ >> -val += ((s->maxdata + 1) >> 1); >> -val &= s->maxdata; >> +/* munge the offset binary to 2's complement if needed */ >> +if (comedi_range_is_bipolar(s, range)) >> +val = comedi_offset_munge(s, val); >> >> writeb(val & 0xff, iobase + II20K_AO_LSB_REG(chan)); >> writeb((val >> 8) & 0xff, iobase + II20K_AO_MSB_REG(chan)); >> > > I'm not sure about that as there are discrepancies in the manual. The > one I found was at: > > https://www.uni-due.de/~hp0259/agwiki/lib/exe/fetch.php?media=anleitungen:pci-20006m.pdf I have the same manual. > In "5. Specifications" it has: > > CODE > UNIPOLARBinary > BIPOLAR Complementary Binary > I saw this part. > But then under "D/A Codes" it has: > > OUTDATA Volts Unipolar Volts Bipolar > --- -- - > 32767 +Full Scale -1 LSB * > 0 +½ Full Scale 0 > -1+½ F.S. - 1 LSB -1 LSB > -327680 -Full Scale > > ± 5V Range: OUTDATA = VOLTS * (65536 / 10) > ± 10V Range: OUTDATA = VOLTS * (65536 / 20) > 0 to 10V Range: OUTDATA = (VOLTS * (65536 / 10)) - 32768 Missed this part... > * I think that's a typo and should be "+Full Scale - 1 LSB". > > The table (with typo corrected) and formulae indicate that for both > unipolar and bipolar, -32768 is the lowest voltage and +32767 is the > highest voltage, so we should munge comedi sample values regardless of > range. Looks like you are probably correct. I'll fix the patch and repost the series. Thanks. Hartley ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 07/10] drivers/hv: cleanup synic msrs if vmbus connect failed
On 10/08/2015 05:01 AM, K. Y. Srinivasan wrote: From: Denis V. Lunev K.Y., there is one subtle thing in this submission. You have changed "From:" field in comparison with the original letter. I have submitted the patch with "From: Andrey Smetanin " In this case Author: in the resulted git mainstream commit will be Andrey. With your submission the resulted Author will be I. This was already happened once with commit cc2dd4027a43bb36c846f195a764edabc0828602 Author: Denis V. Lunev Date: Sat Aug 1 16:08:20 2015 -0700 mshyperv: fix recognition of Hyper-V guest crash MSR's The situation looks a bit unfair. Can we do something with that now/next time? Den Before vmbus_connect() synic is setup per vcpu - this means hypervisor receives writes at synic msr's and probably allocate hypervisor resources per synic setup. If vmbus_connect() failed for some reason it's neccessary to cleanup synic setup by call hv_synic_cleanup() at each vcpu to get a chance to free allocated resources by hypervisor per synic. This patch does appropriate cleanup in case of vmbus_connect() failure. Signed-off-by: Andrey Smetanin Signed-off-by: Denis V. Lunev Reviewed-by: Vitaly Kuznetsov CC: "K. Y. Srinivasan" CC: Haiyang Zhang CC: Vitaly Kuznetsov Signed-off-by: K. Y. Srinivasan --- drivers/hv/vmbus_drv.c |4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/drivers/hv/vmbus_drv.c b/drivers/hv/vmbus_drv.c index f19b6f7..3297731 100644 --- a/drivers/hv/vmbus_drv.c +++ b/drivers/hv/vmbus_drv.c @@ -867,7 +867,7 @@ static int vmbus_bus_init(int irq) on_each_cpu(hv_synic_init, NULL, 1); ret = vmbus_connect(); if (ret) - goto err_alloc; + goto err_connect; if (vmbus_proto_version > VERSION_WIN7) cpu_hotplug_disable(); @@ -885,6 +885,8 @@ static int vmbus_bus_init(int irq) return 0; +err_connect: + on_each_cpu(hv_synic_cleanup, NULL, 1); err_alloc: hv_synic_free(); hv_remove_vmbus_irq(); ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
RE: [PATCH 07/10] drivers/hv: cleanup synic msrs if vmbus connect failed
> -Original Message- > From: Denis V. Lunev [mailto:d...@openvz.org] > Sent: Thursday, October 8, 2015 10:20 AM > To: KY Srinivasan ; gre...@linuxfoundation.org; linux- > ker...@vger.kernel.org; de...@linuxdriverproject.org; o...@aepfle.de; > a...@canonical.com; vkuzn...@redhat.com; jasow...@redhat.com > Cc: Andrey Smetanin ; Haiyang Zhang > > Subject: Re: [PATCH 07/10] drivers/hv: cleanup synic msrs if vmbus connect > failed > > On 10/08/2015 05:01 AM, K. Y. Srinivasan wrote: > > From: Denis V. Lunev > > K.Y., > > there is one subtle thing in this submission. You have changed "From:" > field in comparison with the original letter. I have submitted > the patch with "From: Andrey Smetanin " > In this case Author: in the resulted git mainstream commit will > be Andrey. With your submission the resulted Author will be I. > > This was already happened once with > > commit cc2dd4027a43bb36c846f195a764edabc0828602 > Author: Denis V. Lunev > Date: Sat Aug 1 16:08:20 2015 -0700 > > mshyperv: fix recognition of Hyper-V guest crash MSR's > > The situation looks a bit unfair. > > Can we do something with that now/next time? I am going to be resubmitting this series. I will fix it up. Regards, K. Y > > Den > > > Before vmbus_connect() synic is setup per vcpu - this means > > hypervisor receives writes at synic msr's and probably allocate > > hypervisor resources per synic setup. > > > > If vmbus_connect() failed for some reason it's neccessary to cleanup > > synic setup by call hv_synic_cleanup() at each vcpu to get a chance > > to free allocated resources by hypervisor per synic. > > > > This patch does appropriate cleanup in case of vmbus_connect() failure. > > > > Signed-off-by: Andrey Smetanin > > Signed-off-by: Denis V. Lunev > > Reviewed-by: Vitaly Kuznetsov > > CC: "K. Y. Srinivasan" > > CC: Haiyang Zhang > > CC: Vitaly Kuznetsov > > Signed-off-by: K. Y. Srinivasan > > --- > > drivers/hv/vmbus_drv.c |4 +++- > > 1 files changed, 3 insertions(+), 1 deletions(-) > > > > diff --git a/drivers/hv/vmbus_drv.c b/drivers/hv/vmbus_drv.c > > index f19b6f7..3297731 100644 > > --- a/drivers/hv/vmbus_drv.c > > +++ b/drivers/hv/vmbus_drv.c > > @@ -867,7 +867,7 @@ static int vmbus_bus_init(int irq) > > on_each_cpu(hv_synic_init, NULL, 1); > > ret = vmbus_connect(); > > if (ret) > > - goto err_alloc; > > + goto err_connect; > > > > if (vmbus_proto_version > VERSION_WIN7) > > cpu_hotplug_disable(); > > @@ -885,6 +885,8 @@ static int vmbus_bus_init(int irq) > > > > return 0; > > > > +err_connect: > > + on_each_cpu(hv_synic_cleanup, NULL, 1); > > err_alloc: > > hv_synic_free(); > > hv_remove_vmbus_irq(); ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 07/10] drivers/hv: cleanup synic msrs if vmbus connect failed
On 10/08/2015 08:28 PM, KY Srinivasan wrote: -Original Message- From: Denis V. Lunev [mailto:d...@openvz.org] Sent: Thursday, October 8, 2015 10:20 AM To: KY Srinivasan ; gre...@linuxfoundation.org; linux- ker...@vger.kernel.org; de...@linuxdriverproject.org; o...@aepfle.de; a...@canonical.com; vkuzn...@redhat.com; jasow...@redhat.com Cc: Andrey Smetanin ; Haiyang Zhang Subject: Re: [PATCH 07/10] drivers/hv: cleanup synic msrs if vmbus connect failed On 10/08/2015 05:01 AM, K. Y. Srinivasan wrote: From: Denis V. Lunev K.Y., there is one subtle thing in this submission. You have changed "From:" field in comparison with the original letter. I have submitted the patch with "From: Andrey Smetanin " In this case Author: in the resulted git mainstream commit will be Andrey. With your submission the resulted Author will be I. This was already happened once with commit cc2dd4027a43bb36c846f195a764edabc0828602 Author: Denis V. Lunev Date: Sat Aug 1 16:08:20 2015 -0700 mshyperv: fix recognition of Hyper-V guest crash MSR's The situation looks a bit unfair. Can we do something with that now/next time? I am going to be resubmitting this series. I will fix it up. thank you very much :) Den ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2 0/3] staging: comedi: ii_pci20kc: cleanup driver
Fix a minor checkpatch.pl issue and cleanup this driver a bit. v2: as Ian abbott pointed out, it appears that the analog output data always needs munging to 2's complement. Fix patch 2 and merge with patch 3. H Hartley Sweeten (3): staging: comedi: ii_pci20kc: prefer using the BIT macro staging: comedi: ii_pci20kc: use comedi_offset_munge() staging: comedi: ii_pci20kc: update the MODULE_DESCRIPTION drivers/staging/comedi/drivers/ii_pci20kc.c | 84 ++--- 1 file changed, 40 insertions(+), 44 deletions(-) -- 2.5.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2 1/3] staging: comedi: ii_pci20kc: prefer using the BIT macro
As suggested by checkpatch.pl, use the BIT macro to define the register bits. Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/ii_pci20kc.c | 70 ++--- 1 file changed, 35 insertions(+), 35 deletions(-) diff --git a/drivers/staging/comedi/drivers/ii_pci20kc.c b/drivers/staging/comedi/drivers/ii_pci20kc.c index 14ef1f6..4d3f89c 100644 --- a/drivers/staging/comedi/drivers/ii_pci20kc.c +++ b/drivers/staging/comedi/drivers/ii_pci20kc.c @@ -37,37 +37,37 @@ #define II20K_SIZE 0x400 #define II20K_MOD_OFFSET 0x100 #define II20K_ID_REG 0x00 -#define II20K_ID_MOD1_EMPTY(1 << 7) -#define II20K_ID_MOD2_EMPTY(1 << 6) -#define II20K_ID_MOD3_EMPTY(1 << 5) +#define II20K_ID_MOD1_EMPTYBIT(7) +#define II20K_ID_MOD2_EMPTYBIT(6) +#define II20K_ID_MOD3_EMPTYBIT(5) #define II20K_ID_MASK 0x1f #define II20K_ID_PCI20001C_1A 0x1b/* no on-board DIO */ #define II20K_ID_PCI20001C_2A 0x1d/* on-board DIO */ #define II20K_MOD_STATUS_REG 0x40 -#define II20K_MOD_STATUS_IRQ_MOD1 (1 << 7) -#define II20K_MOD_STATUS_IRQ_MOD2 (1 << 6) -#define II20K_MOD_STATUS_IRQ_MOD3 (1 << 5) +#define II20K_MOD_STATUS_IRQ_MOD1 BIT(7) +#define II20K_MOD_STATUS_IRQ_MOD2 BIT(6) +#define II20K_MOD_STATUS_IRQ_MOD3 BIT(5) #define II20K_DIO0_REG 0x80 #define II20K_DIO1_REG 0x81 #define II20K_DIR_ENA_REG 0x82 -#define II20K_DIR_DIO3_OUT (1 << 7) -#define II20K_DIR_DIO2_OUT (1 << 6) -#define II20K_BUF_DISAB_DIO3 (1 << 5) -#define II20K_BUF_DISAB_DIO2 (1 << 4) -#define II20K_DIR_DIO1_OUT (1 << 3) -#define II20K_DIR_DIO0_OUT (1 << 2) -#define II20K_BUF_DISAB_DIO1 (1 << 1) -#define II20K_BUF_DISAB_DIO0 (1 << 0) +#define II20K_DIR_DIO3_OUT BIT(7) +#define II20K_DIR_DIO2_OUT BIT(6) +#define II20K_BUF_DISAB_DIO3 BIT(5) +#define II20K_BUF_DISAB_DIO2 BIT(4) +#define II20K_DIR_DIO1_OUT BIT(3) +#define II20K_DIR_DIO0_OUT BIT(2) +#define II20K_BUF_DISAB_DIO1 BIT(1) +#define II20K_BUF_DISAB_DIO0 BIT(0) #define II20K_CTRL01_REG 0x83 -#define II20K_CTRL01_SET (1 << 7) -#define II20K_CTRL01_DIO0_IN (1 << 4) -#define II20K_CTRL01_DIO1_IN (1 << 1) +#define II20K_CTRL01_SET BIT(7) +#define II20K_CTRL01_DIO0_IN BIT(4) +#define II20K_CTRL01_DIO1_IN BIT(1) #define II20K_DIO2_REG 0xc0 #define II20K_DIO3_REG 0xc1 #define II20K_CTRL23_REG 0xc3 -#define II20K_CTRL23_SET (1 << 7) -#define II20K_CTRL23_DIO2_IN (1 << 4) -#define II20K_CTRL23_DIO3_IN (1 << 1) +#define II20K_CTRL23_SET BIT(7) +#define II20K_CTRL23_DIO2_IN BIT(4) +#define II20K_CTRL23_DIO3_IN BIT(1) #define II20K_ID_PCI20006M_1 0xe2/* 1 AO channels */ #define II20K_ID_PCI20006M_2 0xe3/* 2 AO channels */ @@ -78,27 +78,27 @@ #define II20K_ID_PCI20341M_1 0x77/* 4 AI channels */ #define II20K_AI_STATUS_CMD_REG0x01 -#define II20K_AI_STATUS_CMD_BUSY (1 << 7) -#define II20K_AI_STATUS_CMD_HW_ENA (1 << 1) -#define II20K_AI_STATUS_CMD_EXT_START (1 << 0) +#define II20K_AI_STATUS_CMD_BUSY BIT(7) +#define II20K_AI_STATUS_CMD_HW_ENA BIT(1) +#define II20K_AI_STATUS_CMD_EXT_START BIT(0) #define II20K_AI_LSB_REG 0x02 #define II20K_AI_MSB_REG 0x03 #define II20K_AI_PACER_RESET_REG 0x04 #define II20K_AI_16BIT_DATA_REG0x06 #define II20K_AI_CONF_REG 0x10 -#define II20K_AI_CONF_ENA (1 << 2) +#define II20K_AI_CONF_ENA BIT(2) #define II20K_AI_OPT_REG 0x11 -#define II20K_AI_OPT_TRIG_ENA (1 << 5) -#define II20K_AI_OPT_TRIG_INV (1 << 4) +#define II20K_AI_OPT_TRIG_ENA BIT(5) +#define II20K_AI_OPT_TRIG_INV BIT(4) #define II20K_AI_OPT_TIMEBASE(x) (((x) & 0x3) << 1) -#define II20K_AI_OPT_BURST_MODE(1 << 0) +#define II20K_AI_OPT_BURST_MODEBIT(0) #define II20K_AI_STATUS_REG0x12 -#define II20K_AI_STATUS_INT(1 << 7) -#define II20K_AI_STATUS_TRIG (1 << 6) -#define II20K_AI_STATUS_TRIG_ENA (1 << 5) -#define II20K_AI_STATUS_PACER_ERR (1 << 2) -#define II20K_AI_STATUS_DATA_ERR (1 << 1) -#define II20K_AI_STATUS_SET_TIME_ERR (1 << 0) +#define II20K_AI_STATUS_INTBIT(7) +#define II20K_AI_STATUS_TRIG BIT(6) +#define II20K_AI_STATUS_TRIG_ENA BIT(5) +#define II20K_AI_STATUS_PACER_ERR BIT(2) +#define II20K_AI_STATUS
[PATCH v2 2/3] staging: comedi: ii_pci20kc: use comedi_offset_munge()
For aesthetics, use the helper function to handle the munging of the analog output data from offset binary to 2's complement and the analog input data from 2's complement to offset binary. Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-Hartman --- v2: as Ian abbott pointed out, it appears that the analog output data always needs munging to 2's complement. Fix patch 2 and merge with patch 3. drivers/staging/comedi/drivers/ii_pci20kc.c | 12 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/drivers/staging/comedi/drivers/ii_pci20kc.c b/drivers/staging/comedi/drivers/ii_pci20kc.c index 4d3f89c..1f3eaf6 100644 --- a/drivers/staging/comedi/drivers/ii_pci20kc.c +++ b/drivers/staging/comedi/drivers/ii_pci20kc.c @@ -153,9 +153,8 @@ static int ii20k_ao_insn_write(struct comedi_device *dev, s->readback[chan] = val; - /* munge data */ - val += ((s->maxdata + 1) >> 1); - val &= s->maxdata; + /* munge the offset binary data to 2's complement */ + val = comedi_offset_munge(s, val); writeb(val & 0xff, iobase + II20K_AO_LSB_REG(chan)); writeb((val >> 8) & 0xff, iobase + II20K_AO_MSB_REG(chan)); @@ -243,11 +242,8 @@ static int ii20k_ai_insn_read(struct comedi_device *dev, val = readb(iobase + II20K_AI_LSB_REG); val |= (readb(iobase + II20K_AI_MSB_REG) << 8); - /* munge two's complement data */ - val += ((s->maxdata + 1) >> 1); - val &= s->maxdata; - - data[i] = val; + /* munge the 2's complement data to offset binary */ + data[i] = comedi_offset_munge(s, val); } return insn->n; -- 2.5.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2 3/3] staging: comedi: ii_pci20kc: update the MODULE_DESCRIPTION
Change the MODULE_DESCRIPTION to something more useful than the generic "Comedi low-level driver". Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/ii_pci20kc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/comedi/drivers/ii_pci20kc.c b/drivers/staging/comedi/drivers/ii_pci20kc.c index 1f3eaf6..77e1d89 100644 --- a/drivers/staging/comedi/drivers/ii_pci20kc.c +++ b/drivers/staging/comedi/drivers/ii_pci20kc.c @@ -519,5 +519,5 @@ static struct comedi_driver ii20k_driver = { module_comedi_driver(ii20k_driver); MODULE_AUTHOR("Comedi http://www.comedi.org";); -MODULE_DESCRIPTION("Comedi low-level driver"); +MODULE_DESCRIPTION("Comedi driver for Intelligent Instruments PCI-20001C"); MODULE_LICENSE("GPL"); -- 2.5.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2 3/3] staging: rtl8188eu: spaces preferred around that + inserted
This patch inserts spaces preferred around that '+' found by checkpatch. --- Changes in v2: - inserted description to this patch, - added Signed-off record. Signed-off-by: Ivan Safonov --- drivers/staging/rtl8188eu/hal/bb_cfg.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/staging/rtl8188eu/hal/bb_cfg.c b/drivers/staging/rtl8188eu/hal/bb_cfg.c index 88c3ad7..4eb982b 100644 --- a/drivers/staging/rtl8188eu/hal/bb_cfg.c +++ b/drivers/staging/rtl8188eu/hal/bb_cfg.c @@ -163,7 +163,7 @@ static bool set_baseband_agc_config(struct adapter *adapt) for (i = 0; i < arraylen; i += 2) { u32 v1 = array[i]; - u32 v2 = array[i+1]; + u32 v2 = array[i + 1]; if (v1 < 0xCDCDCDCD) { phy_set_bb_reg(adapt, v1, bMaskDWord, v2); @@ -398,7 +398,7 @@ static bool set_baseband_phy_config(struct adapter *adapt) for (i = 0; i < arraylen; i += 2) { u32 v1 = array[i]; - u32 v2 = array[i+1]; + u32 v2 = array[i + 1]; if (v1 < 0xCDCDCDCD) rtl_bb_delay(adapt, v1, v2); @@ -580,8 +580,8 @@ static bool config_bb_with_pgheader(struct adapter *adapt) for (i = 0; i < arraylen; i += 3) { u32 v1 = array[i]; - u32 v2 = array[i+1]; - u32 v3 = array[i+2]; + u32 v2 = array[i + 1]; + u32 v3 = array[i + 2]; if (v1 < 0xCDCDCDCD) rtl_addr_delay(adapt, v1, v2, v3); -- 2.4.9 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
RE: [PATCH 09/14] staging: comedi: dt3000: the dt3002 board does not have analog outputs
On Thursday, October 08, 2015 3:38 AM, Ian Abbott wrote: > On 08/10/15 02:26, H Hartley Sweeten wrote: >> According to the boardinfo, the dt3002 board does not have analog outputs. >> The rest of the board have two 12-bit analog output channels. >> >> Replace the 'dachan' and 'dabits' members of the boardinfo with a bit- >> field flag 'has_ao'. Use the new member to conditionally initialize >> the analog output subdevice. >> >> Signed-off-by: H Hartley Sweeten >> Cc: Ian Abbott >> Cc: Greg Kroah-Hartman >> --- >> drivers/staging/comedi/drivers/dt3000.c | 40 >> +++-- >> 1 file changed, 18 insertions(+), 22 deletions(-) >> >> diff --git a/drivers/staging/comedi/drivers/dt3000.c >> b/drivers/staging/comedi/drivers/dt3000.c >> index 8d6d344..12cf65a 100644 >> --- a/drivers/staging/comedi/drivers/dt3000.c >> +++ b/drivers/staging/comedi/drivers/dt3000.c > [snip] >> @@ -681,15 +674,18 @@ static int dt3000_auto_attach(struct comedi_device >> *dev, >> s->cancel = dt3k_ai_cancel; >> } >> >> +/* Analog Output subdevice */ >> s = &dev->subdevices[1]; >> -/* ao subsystem */ >> -s->type = COMEDI_SUBD_AO; >> -s->subdev_flags = SDF_WRITABLE; >> -s->n_chan = 2; >> -s->maxdata = (1 << board->dabits) - 1; >> -s->len_chanlist = 1; >> -s->range_table = &range_bipolar10; >> -s->insn_write = dt3k_ao_insn_write; >> +if (board->has_ao) { >> +s->type = COMEDI_SUBD_AO; >> +s->subdev_flags = SDF_WRITABLE; >> +s->n_chan = 2; >> +s->maxdata = 0x0fff; >> +s->range_table = &range_bipolar10; >> +s->insn_write = dt3k_ao_insn_write; >> +} else { >> +s->type = COMEDI_SUBD_UNUSED; >> +} >> >> ret = comedi_alloc_subdev_readback(s); >> if (ret) >> > > The comedi_alloc_subdev_readback() needs moving into the `if > (board->has_ao)` block. Ugh.. overlooked that. I'll post an updated series shortly. Thanks, Hartley ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2 02/14] staging: comedi: dt3000: rename dual-ported RAM location defines
Rename these CamelCase defines and fix the checkpatch.pl issues: CHECK: Avoid CamelCase: CHECK: spaces preferred around that '*' (ctx:VxV) CHECK: spaces preferred around that '+' (ctx:VxV) For aesthetics, move the defines to after the includes. Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/dt3000.c | 111 1 file changed, 56 insertions(+), 55 deletions(-) diff --git a/drivers/staging/comedi/drivers/dt3000.c b/drivers/staging/comedi/drivers/dt3000.c index a229b73..8a20094 100644 --- a/drivers/staging/comedi/drivers/dt3000.c +++ b/drivers/staging/comedi/drivers/dt3000.c @@ -55,6 +55,26 @@ #include "../comedi_pci.h" +/* + * PCI BAR0 - dual-ported RAM location definitions (dev->mmio) + */ +#define DPR_DAC_BUFFER (4 * 0x000) +#define DPR_ADC_BUFFER (4 * 0x800) +#define DPR_COMMAND(4 * 0xfd3) +#define DPR_SUBSYS (4 * 0xfd3) +#define DPR_ENCODE (4 * 0xfd4) +#define DPR_PARAMS(x) (4 * (0xfd5 + (x))) +#define DPR_TICK_REG_LO(4 * 0xff5) +#define DPR_TICK_REG_HI(4 * 0xff6) +#define DPR_DA_BUF_FRONT (4 * 0xff7) +#define DPR_DA_BUF_REAR(4 * 0xff8) +#define DPR_AD_BUF_FRONT (4 * 0xff9) +#define DPR_AD_BUF_REAR(4 * 0xffa) +#define DPR_INT_MASK (4 * 0xffb) +#define DPR_INTR_FLAG (4 * 0xffc) +#define DPR_RESPONSE_MBX (4 * 0xffe) +#define DPR_COMMAND_MBX(4 * 0xfff) + static const struct comedi_lrange range_dt3000_ai = { 4, { BIP_RANGE(10), @@ -157,25 +177,6 @@ static const struct dt3k_boardtype dt3k_boardtypes[] = { }, }; -/* dual-ported RAM location definitions */ - -#define DPR_DAC_buffer (4*0x000) -#define DPR_ADC_buffer (4*0x800) -#define DPR_Command(4*0xfd3) -#define DPR_SubSys (4*0xfd3) -#define DPR_Encode (4*0xfd4) -#define DPR_Params(a) (4*(0xfd5+(a))) -#define DPR_Tick_Reg_Lo(4*0xff5) -#define DPR_Tick_Reg_Hi(4*0xff6) -#define DPR_DA_Buf_Front (4*0xff7) -#define DPR_DA_Buf_Rear(4*0xff8) -#define DPR_AD_Buf_Front (4*0xff9) -#define DPR_AD_Buf_Rear(4*0xffa) -#define DPR_Int_Mask (4*0xffb) -#define DPR_Intr_Flag (4*0xffc) -#define DPR_Response_Mbx (4*0xffe) -#define DPR_Command_Mbx(4*0xfff) - #define AI_FIFO_DEPTH 2003 #define AO_FIFO_DEPTH 2048 @@ -254,10 +255,10 @@ static void dt3k_send_cmd(struct comedi_device *dev, unsigned int cmd) int i; unsigned int status = 0; - writew(cmd, dev->mmio + DPR_Command_Mbx); + writew(cmd, dev->mmio + DPR_COMMAND_MBX); for (i = 0; i < TIMEOUT; i++) { - status = readw(dev->mmio + DPR_Command_Mbx); + status = readw(dev->mmio + DPR_COMMAND_MBX); if ((status & DT3000_COMPLETION_MASK) != DT3000_NOTPROCESSED) break; udelay(1); @@ -272,24 +273,24 @@ static unsigned int dt3k_readsingle(struct comedi_device *dev, unsigned int subsys, unsigned int chan, unsigned int gain) { - writew(subsys, dev->mmio + DPR_SubSys); + writew(subsys, dev->mmio + DPR_SUBSYS); - writew(chan, dev->mmio + DPR_Params(0)); - writew(gain, dev->mmio + DPR_Params(1)); + writew(chan, dev->mmio + DPR_PARAMS(0)); + writew(gain, dev->mmio + DPR_PARAMS(1)); dt3k_send_cmd(dev, CMD_READSINGLE); - return readw(dev->mmio + DPR_Params(2)); + return readw(dev->mmio + DPR_PARAMS(2)); } static void dt3k_writesingle(struct comedi_device *dev, unsigned int subsys, unsigned int chan, unsigned int data) { - writew(subsys, dev->mmio + DPR_SubSys); + writew(subsys, dev->mmio + DPR_SUBSYS); - writew(chan, dev->mmio + DPR_Params(0)); - writew(0, dev->mmio + DPR_Params(1)); - writew(data, dev->mmio + DPR_Params(2)); + writew(chan, dev->mmio + DPR_PARAMS(0)); + writew(0, dev->mmio + DPR_PARAMS(1)); + writew(data, dev->mmio + DPR_PARAMS(2)); dt3k_send_cmd(dev, CMD_WRITESINGLE); } @@ -304,7 +305,7 @@ static void dt3k_ai_empty_fifo(struct comedi_device *dev, int i; unsigned short data; - front = readw(dev->mmio + DPR_AD_Buf_Front); + front = readw(dev->mmio + DPR_AD_BUF_FRONT); count = front - devpriv->ai_front; if (count < 0) count += AI_FIFO_DEPTH; @@ -312,7 +313,7 @@ static void dt3k_ai_empty_fifo(struct comedi_device *dev, rear = devpriv->ai_rear; for (i = 0; i < count; i++) { - data = readw(dev->mmio + DPR_ADC_buffer + rear); + data = readw(dev->mmio + DPR_ADC_BUFFER + rear);
[PATCH v2 00/14] staging: comedi: dt3000: cleanup driver
This series fixes all the checkpatch.pl issues and cleans up the driver a bit. There are still some issues with this driver but I have not been able to locate a datasheet... :-( v2: fix patch 9 as pointed out by Ian Abbott The comedi_alloc_subdev_readback() also needs to be moved into the if block. H Hartley Sweeten (14): staging: comedi: dt3000: tidy up multi-line comments staging: comedi: dt3000: rename dual-ported RAM location defines staging: comedi: dt3000: tidy up the command mailbox defines staging: comedi: dt3000: rename the SUBS_* defines staging: comedi: dt3000: rename the interrupt flag defines staging: comedi: dt3000: tidy up remaining defines staging: comedi: dt3000: remove proc subdevice staging: comedi: dt3000: refactor 'adbits' boardinfo staging: comedi: dt3000: the dt3002 board does not have analog outputs staging: comedi: dt3000: rename dt3k_ai_insn() staging: comedi: dt3000: tidy up digital i/o subdevice init staging: comedi: dt3000: tidy up memory subdevice init staging: comedi: dt3000: remove #if 0'ed out code staging: comedi: dt3000: update the MODULE_DESCRIPTION drivers/staging/comedi/drivers/dt3000.c | 466 +++- 1 file changed, 224 insertions(+), 242 deletions(-) -- 2.5.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2 01/14] staging: comedi: dt3000: tidy up multi-line comments
Reformat the multi-line comments in the kernel CodingStyle. Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/dt3000.c | 91 + 1 file changed, 46 insertions(+), 45 deletions(-) diff --git a/drivers/staging/comedi/drivers/dt3000.c b/drivers/staging/comedi/drivers/dt3000.c index 8c4f284..a229b73 100644 --- a/drivers/staging/comedi/drivers/dt3000.c +++ b/drivers/staging/comedi/drivers/dt3000.c @@ -1,52 +1,53 @@ /* -comedi/drivers/dt3000.c -Data Translation DT3000 series driver - -COMEDI - Linux Control and Measurement Device Interface -Copyright (C) 1999 David A. Schleef - -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. -*/ -/* -Driver: dt3000 -Description: Data Translation DT3000 series -Author: ds -Devices: [Data Translation] DT3001 (dt3000), DT3001-PGL, DT3002, DT3003, - DT3003-PGL, DT3004, DT3005, DT3004-200 -Updated: Mon, 14 Apr 2008 15:41:24 +0100 -Status: works - -Configuration Options: not applicable, uses PCI auto config + * dt3000.c + * Data Translation DT3000 series driver + * + * COMEDI - Linux Control and Measurement Device Interface + * Copyright (C) 1999 David A. Schleef + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + */ -There is code to support AI commands, but it may not work. - -AO commands are not supported. -*/ +/* + * Driver: dt3000 + * Description: Data Translation DT3000 series + * Devices: [Data Translation] DT3001 (dt3000), DT3001-PGL, DT3002, DT3003, + * DT3003-PGL, DT3004, DT3005, DT3004-200 + * Author: ds + * Updated: Mon, 14 Apr 2008 15:41:24 +0100 + * Status: works + * + * Configuration Options: not applicable, uses PCI auto config + * + * There is code to support AI commands, but it may not work. + * + * AO commands are not supported. + */ /* - The DT3000 series is Data Translation's attempt to make a PCI - data acquisition board. The design of this series is very nice, - since each board has an on-board DSP (Texas Instruments TMS320C52). - However, a few details are a little annoying. The boards lack - bus-mastering DMA, which eliminates them from serious work. - They also are not capable of autocalibration, which is a common - feature in modern hardware. The default firmware is pretty bad, - making it nearly impossible to write an RT compatible driver. - It would make an interesting project to write a decent firmware - for these boards. - - Data Translation originally wanted an NDA for the documentation - for the 3k series. However, if you ask nicely, they might send - you the docs without one, also. -*/ + * The DT3000 series is Data Translation's attempt to make a PCI + * data acquisition board. The design of this series is very nice, + * since each board has an on-board DSP (Texas Instruments TMS320C52). + * However, a few details are a little annoying. The boards lack + * bus-mastering DMA, which eliminates them from serious work. + * They also are not capable of autocalibration, which is a common + * feature in modern hardware. The default firmware is pretty bad, + * making it nearly impossible to write an RT compatible driver. + * It would make an interesting project to write a decent firmware + * for these boards. + * + * Data Translation originally wanted an NDA for the documentation + * for the 3k series. However, if you ask nicely, they might send + * you the docs without one, also. + */ #include #include -- 2.5.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2 03/14] staging: comedi: dt3000: tidy up the command mailbox defines
For aesthetics, rename these defines so they are associated with the register. Move the defines closer to the register define. Define some macros for the "completion" and "cmd" bits. Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/dt3000.c | 85 - 1 file changed, 42 insertions(+), 43 deletions(-) diff --git a/drivers/staging/comedi/drivers/dt3000.c b/drivers/staging/comedi/drivers/dt3000.c index 8a20094..f9626e8 100644 --- a/drivers/staging/comedi/drivers/dt3000.c +++ b/drivers/staging/comedi/drivers/dt3000.c @@ -73,7 +73,36 @@ #define DPR_INT_MASK (4 * 0xffb) #define DPR_INTR_FLAG (4 * 0xffc) #define DPR_RESPONSE_MBX (4 * 0xffe) -#define DPR_COMMAND_MBX(4 * 0xfff) +#define DPR_CMD_MBX(4 * 0xfff) +#define DPR_CMD_COMPLETION(x) ((x) << 8) +#define DPR_CMD_NOTPROCESSED DPR_CMD_COMPLETION(0x00) +#define DPR_CMD_NOERRORDPR_CMD_COMPLETION(0x55) +#define DPR_CMD_ERROR DPR_CMD_COMPLETION(0xaa) +#define DPR_CMD_NOTSUPPORTED DPR_CMD_COMPLETION(0xff) +#define DPR_CMD_COMPLETION_MASKDPR_CMD_COMPLETION(0xff) +#define DPR_CMD(x) ((x) << 0) +#define DPR_CMD_GETBRDINFO DPR_CMD(0) +#define DPR_CMD_CONFIG DPR_CMD(1) +#define DPR_CMD_GETCONFIG DPR_CMD(2) +#define DPR_CMD_START DPR_CMD(3) +#define DPR_CMD_STOP DPR_CMD(4) +#define DPR_CMD_READSINGLE DPR_CMD(5) +#define DPR_CMD_WRITESINGLEDPR_CMD(6) +#define DPR_CMD_CALCCLOCK DPR_CMD(7) +#define DPR_CMD_READEVENTS DPR_CMD(8) +#define DPR_CMD_WRITECTCTRLDPR_CMD(16) +#define DPR_CMD_READCTCTRL DPR_CMD(17) +#define DPR_CMD_WRITECTDPR_CMD(18) +#define DPR_CMD_READCT DPR_CMD(19) +#define DPR_CMD_WRITEDATA DPR_CMD(32) +#define DPR_CMD_READDATA DPR_CMD(33) +#define DPR_CMD_WRITEIODPR_CMD(34) +#define DPR_CMD_READIO DPR_CMD(35) +#define DPR_CMD_WRITECODE DPR_CMD(36) +#define DPR_CMD_READCODE DPR_CMD(37) +#define DPR_CMD_EXECUTEDPR_CMD(38) +#define DPR_CMD_HALT DPR_CMD(48) +#define DPR_CMD_MASK DPR_CMD(0xff) static const struct comedi_lrange range_dt3000_ai = { 4, { @@ -180,30 +209,6 @@ static const struct dt3k_boardtype dt3k_boardtypes[] = { #define AI_FIFO_DEPTH 2003 #define AO_FIFO_DEPTH 2048 -/* command list */ - -#define CMD_GETBRDINFO 0 -#define CMD_CONFIG 1 -#define CMD_GETCONFIG 2 -#define CMD_START 3 -#define CMD_STOP 4 -#define CMD_READSINGLE 5 -#define CMD_WRITESINGLE6 -#define CMD_CALCCLOCK 7 -#define CMD_READEVENTS 8 -#define CMD_WRITECTCTRL16 -#define CMD_READCTCTRL 17 -#define CMD_WRITECT18 -#define CMD_READCT 19 -#define CMD_WRITEDATA 32 -#define CMD_READDATA 33 -#define CMD_WRITEIO34 -#define CMD_READIO 35 -#define CMD_WRITECODE 36 -#define CMD_READCODE 37 -#define CMD_EXECUTE38 -#define CMD_HALT 48 - #define SUBS_AI0 #define SUBS_AO1 #define SUBS_DIN 2 @@ -221,13 +226,6 @@ static const struct dt3k_boardtype dt3k_boardtypes[] = { #define DT3000_ADSWERR 0x02 #define DT3000_ADFULL 0x01 -#define DT3000_COMPLETION_MASK 0xff00 -#define DT3000_COMMAND_MASK0x00ff -#define DT3000_NOTPROCESSED0x -#define DT3000_NOERROR 0x5500 -#define DT3000_ERROR 0xaa00 -#define DT3000_NOTSUPPORTED0xff00 - #define DT3000_EXTERNAL_CLOCK 1 #define DT3000_RISING_EDGE 2 @@ -255,16 +253,17 @@ static void dt3k_send_cmd(struct comedi_device *dev, unsigned int cmd) int i; unsigned int status = 0; - writew(cmd, dev->mmio + DPR_COMMAND_MBX); + writew(cmd, dev->mmio + DPR_CMD_MBX); for (i = 0; i < TIMEOUT; i++) { - status = readw(dev->mmio + DPR_COMMAND_MBX); - if ((status & DT3000_COMPLETION_MASK) != DT3000_NOTPROCESSED) + status = readw(dev->mmio + DPR_CMD_MBX); + status &= DPR_CMD_COMPLETION_MASK; + if (status != DPR_CMD_NOTPROCESSED) break; udelay(1); } - if ((status & DT3000_COMPLETION_MASK) != DT3000_NOERROR) + if (status != DPR_CMD_NOERROR) dev_dbg(dev->class_dev, "%s: timeout/error status=0x%04x\n", __func__, status); } @@ -278,7 +277,7 @@ static unsigned int dt3k_readsingle(struct comedi_device *dev, writew(chan, dev->mmio + DPR_PARAMS(0)); writew(gain, dev->mmio + DPR_PARAMS(1)); - dt3k_send_cmd(dev, CMD_READSINGLE); + dt3k_send_cmd(dev, DPR_CMD_READSINGLE); return readw(dev->mmio + DPR_PARAMS(2)); } @@ -292,7 +291,7 @@ static void
[PATCH v2 06/14] staging: comedi: dt3000: tidy up remaining defines
Move the remaining defines and prefix them with 'DPR_' for consistency. Define a macro to set the analog input trigger bits to fix the checkpatch.pl issues about: CHECK: spaces preferred around that '<<' (ctx:VxV) CHECK: Prefer using the BIT macro Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/dt3000.c | 51 + 1 file changed, 26 insertions(+), 25 deletions(-) diff --git a/drivers/staging/comedi/drivers/dt3000.c b/drivers/staging/comedi/drivers/dt3000.c index f674ca7..9ff7e95 100644 --- a/drivers/staging/comedi/drivers/dt3000.c +++ b/drivers/staging/comedi/drivers/dt3000.c @@ -118,6 +118,25 @@ #define DPR_CMD_HALT DPR_CMD(48) #define DPR_CMD_MASK DPR_CMD(0xff) +#define DPR_PARAM5_AD_TRIG(x) (((x) & 0x7) << 2) +#define DPR_PARAM5_AD_TRIG_INT DPR_PARAM5_AD_TRIG(0) +#define DPR_PARAM5_AD_TRIG_EXT DPR_PARAM5_AD_TRIG(1) +#define DPR_PARAM5_AD_TRIG_INT_RETRIG DPR_PARAM5_AD_TRIG(2) +#define DPR_PARAM5_AD_TRIG_EXT_RETRIG DPR_PARAM5_AD_TRIG(3) +#define DPR_PARAM5_AD_TRIG_INT_RETRIG2 DPR_PARAM5_AD_TRIG(4) + +#define DPR_PARAM6_AD_DIFF BIT(0) + +#define DPR_AI_FIFO_DEPTH 2003 +#define DPR_AO_FIFO_DEPTH 2048 + +#define DPR_EXTERNAL_CLOCK 1 +#define DPR_RISING_EDGE2 + +#define DPR_TMODE_MASK 0x1c + +#define DPR_CMD_TIMEOUT100 + static const struct comedi_lrange range_dt3000_ai = { 4, { BIP_RANGE(10), @@ -220,31 +239,12 @@ static const struct dt3k_boardtype dt3k_boardtypes[] = { }, }; -#define AI_FIFO_DEPTH 2003 -#define AO_FIFO_DEPTH 2048 - -#define DT3000_EXTERNAL_CLOCK 1 -#define DT3000_RISING_EDGE 2 - -#define TMODE_MASK 0x1c - -#define DT3000_AD_TRIG_INTERNAL(0<<2) -#define DT3000_AD_TRIG_EXTERNAL(1<<2) -#define DT3000_AD_RETRIG_INTERNAL (2<<2) -#define DT3000_AD_RETRIG_EXTERNAL (3<<2) -#define DT3000_AD_EXTRETRIG(4<<2) - -#define DT3000_CHANNEL_MODE_SE 0 -#define DT3000_CHANNEL_MODE_DI 1 - struct dt3k_private { unsigned int lock; unsigned int ai_front; unsigned int ai_rear; }; -#define TIMEOUT 100 - static void dt3k_send_cmd(struct comedi_device *dev, unsigned int cmd) { int i; @@ -252,7 +252,7 @@ static void dt3k_send_cmd(struct comedi_device *dev, unsigned int cmd) writew(cmd, dev->mmio + DPR_CMD_MBX); - for (i = 0; i < TIMEOUT; i++) { + for (i = 0; i < DPR_CMD_TIMEOUT; i++) { status = readw(dev->mmio + DPR_CMD_MBX); status &= DPR_CMD_COMPLETION_MASK; if (status != DPR_CMD_NOTPROCESSED) @@ -304,7 +304,7 @@ static void dt3k_ai_empty_fifo(struct comedi_device *dev, front = readw(dev->mmio + DPR_AD_BUF_FRONT); count = front - devpriv->ai_front; if (count < 0) - count += AI_FIFO_DEPTH; + count += DPR_AI_FIFO_DEPTH; rear = devpriv->ai_rear; @@ -312,7 +312,7 @@ static void dt3k_ai_empty_fifo(struct comedi_device *dev, data = readw(dev->mmio + DPR_ADC_BUFFER + rear); comedi_buf_write_samples(s, &data, 1); rear++; - if (rear >= AI_FIFO_DEPTH) + if (rear >= DPR_AI_FIFO_DEPTH) rear = 0; } @@ -503,10 +503,11 @@ static int dt3k_ai_cmd(struct comedi_device *dev, struct comedi_subdevice *s) writew((tscandiv & 0x), dev->mmio + DPR_PARAMS(4)); } - writew(DT3000_AD_RETRIG_INTERNAL, dev->mmio + DPR_PARAMS(5)); - writew(aref == AREF_DIFF, dev->mmio + DPR_PARAMS(6)); + writew(DPR_PARAM5_AD_TRIG_INT_RETRIG, dev->mmio + DPR_PARAMS(5)); + writew((aref == AREF_DIFF) ? DPR_PARAM6_AD_DIFF : 0, + dev->mmio + DPR_PARAMS(6)); - writew(AI_FIFO_DEPTH / 2, dev->mmio + DPR_PARAMS(7)); + writew(DPR_AI_FIFO_DEPTH / 2, dev->mmio + DPR_PARAMS(7)); writew(DPR_SUBSYS_AI, dev->mmio + DPR_SUBSYS); dt3k_send_cmd(dev, DPR_CMD_CONFIG); -- 2.5.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2 04/14] staging: comedi: dt3000: rename the SUBS_* defines
For aesthetics, rename these defines to avoid any confusion with the similar comedi defines. Move them closer to the register they are associated with. Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/dt3000.c | 31 +++ 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/drivers/staging/comedi/drivers/dt3000.c b/drivers/staging/comedi/drivers/dt3000.c index f9626e8..05acd8f 100644 --- a/drivers/staging/comedi/drivers/dt3000.c +++ b/drivers/staging/comedi/drivers/dt3000.c @@ -62,6 +62,12 @@ #define DPR_ADC_BUFFER (4 * 0x800) #define DPR_COMMAND(4 * 0xfd3) #define DPR_SUBSYS (4 * 0xfd3) +#define DPR_SUBSYS_AI 0 +#define DPR_SUBSYS_AO 1 +#define DPR_SUBSYS_DIN 2 +#define DPR_SUBSYS_DOUT3 +#define DPR_SUBSYS_MEM 4 +#define DPR_SUBSYS_CT 5 #define DPR_ENCODE (4 * 0xfd4) #define DPR_PARAMS(x) (4 * (0xfd5 + (x))) #define DPR_TICK_REG_LO(4 * 0xff5) @@ -209,13 +215,6 @@ static const struct dt3k_boardtype dt3k_boardtypes[] = { #define AI_FIFO_DEPTH 2003 #define AO_FIFO_DEPTH 2048 -#define SUBS_AI0 -#define SUBS_AO1 -#define SUBS_DIN 2 -#define SUBS_DOUT 3 -#define SUBS_MEM 4 -#define SUBS_CT5 - /* interrupt flags */ #define DT3000_CMDONE 0x80 #define DT3000_CTDONE 0x40 @@ -326,7 +325,7 @@ static void dt3k_ai_empty_fifo(struct comedi_device *dev, static int dt3k_ai_cancel(struct comedi_device *dev, struct comedi_subdevice *s) { - writew(SUBS_AI, dev->mmio + DPR_SUBSYS); + writew(DPR_SUBSYS_AI, dev->mmio + DPR_SUBSYS); dt3k_send_cmd(dev, DPR_CMD_STOP); writew(0, dev->mmio + DPR_INT_MASK); @@ -511,7 +510,7 @@ static int dt3k_ai_cmd(struct comedi_device *dev, struct comedi_subdevice *s) writew(AI_FIFO_DEPTH / 2, dev->mmio + DPR_PARAMS(7)); - writew(SUBS_AI, dev->mmio + DPR_SUBSYS); + writew(DPR_SUBSYS_AI, dev->mmio + DPR_SUBSYS); dt3k_send_cmd(dev, DPR_CMD_CONFIG); writew(DT3000_ADFULL | DT3000_ADSWERR | DT3000_ADHWERR, @@ -519,7 +518,7 @@ static int dt3k_ai_cmd(struct comedi_device *dev, struct comedi_subdevice *s) debug_n_ints = 0; - writew(SUBS_AI, dev->mmio + DPR_SUBSYS); + writew(DPR_SUBSYS_AI, dev->mmio + DPR_SUBSYS); dt3k_send_cmd(dev, DPR_CMD_START); return 0; @@ -537,7 +536,7 @@ static int dt3k_ai_insn(struct comedi_device *dev, struct comedi_subdevice *s, aref = CR_AREF(insn->chanspec); for (i = 0; i < insn->n; i++) - data[i] = dt3k_readsingle(dev, SUBS_AI, chan, gain); + data[i] = dt3k_readsingle(dev, DPR_SUBSYS_AI, chan, gain); return i; } @@ -553,7 +552,7 @@ static int dt3k_ao_insn_write(struct comedi_device *dev, for (i = 0; i < insn->n; i++) { val = data[i]; - dt3k_writesingle(dev, SUBS_AO, chan, val); + dt3k_writesingle(dev, DPR_SUBSYS_AO, chan, val); } s->readback[chan] = val; @@ -563,7 +562,7 @@ static int dt3k_ao_insn_write(struct comedi_device *dev, static void dt3k_dio_config(struct comedi_device *dev, int bits) { /* XXX */ - writew(SUBS_DOUT, dev->mmio + DPR_SUBSYS); + writew(DPR_SUBSYS_DOUT, dev->mmio + DPR_SUBSYS); writew(bits, dev->mmio + DPR_PARAMS(0)); #if 0 @@ -604,9 +603,9 @@ static int dt3k_dio_insn_bits(struct comedi_device *dev, unsigned int *data) { if (comedi_dio_update_state(s, data)) - dt3k_writesingle(dev, SUBS_DOUT, 0, s->state); + dt3k_writesingle(dev, DPR_SUBSYS_DOUT, 0, s->state); - data[1] = dt3k_readsingle(dev, SUBS_DIN, 0, 0); + data[1] = dt3k_readsingle(dev, DPR_SUBSYS_DIN, 0, 0); return insn->n; } @@ -620,7 +619,7 @@ static int dt3k_mem_insn_read(struct comedi_device *dev, int i; for (i = 0; i < insn->n; i++) { - writew(SUBS_MEM, dev->mmio + DPR_SUBSYS); + writew(DPR_SUBSYS_MEM, dev->mmio + DPR_SUBSYS); writew(addr, dev->mmio + DPR_PARAMS(0)); writew(1, dev->mmio + DPR_PARAMS(1)); -- 2.5.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2 05/14] staging: comedi: dt3000: rename the interrupt flag defines
For aesthetics, rename these defines so they have association with the register. Move them closer to the register define and use the BIT macro to define them. Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/dt3000.c | 24 +++- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/drivers/staging/comedi/drivers/dt3000.c b/drivers/staging/comedi/drivers/dt3000.c index 05acd8f..f674ca7 100644 --- a/drivers/staging/comedi/drivers/dt3000.c +++ b/drivers/staging/comedi/drivers/dt3000.c @@ -78,6 +78,14 @@ #define DPR_AD_BUF_REAR(4 * 0xffa) #define DPR_INT_MASK (4 * 0xffb) #define DPR_INTR_FLAG (4 * 0xffc) +#define DPR_INTR_CMDONEBIT(7) +#define DPR_INTR_CTDONEBIT(6) +#define DPR_INTR_DAHWERR BIT(5) +#define DPR_INTR_DASWERR BIT(4) +#define DPR_INTR_DAEMPTY BIT(3) +#define DPR_INTR_ADHWERR BIT(2) +#define DPR_INTR_ADSWERR BIT(1) +#define DPR_INTR_ADFULLBIT(0) #define DPR_RESPONSE_MBX (4 * 0xffe) #define DPR_CMD_MBX(4 * 0xfff) #define DPR_CMD_COMPLETION(x) ((x) << 8) @@ -215,16 +223,6 @@ static const struct dt3k_boardtype dt3k_boardtypes[] = { #define AI_FIFO_DEPTH 2003 #define AO_FIFO_DEPTH 2048 -/* interrupt flags */ -#define DT3000_CMDONE 0x80 -#define DT3000_CTDONE 0x40 -#define DT3000_DAHWERR 0x20 -#define DT3000_DASWERR 0x10 -#define DT3000_DAEMPTY 0x08 -#define DT3000_ADHWERR 0x04 -#define DT3000_ADSWERR 0x02 -#define DT3000_ADFULL 0x01 - #define DT3000_EXTERNAL_CLOCK 1 #define DT3000_RISING_EDGE 2 @@ -348,10 +346,10 @@ static irqreturn_t dt3k_interrupt(int irq, void *d) status = readw(dev->mmio + DPR_INTR_FLAG); - if (status & DT3000_ADFULL) + if (status & DPR_INTR_ADFULL) dt3k_ai_empty_fifo(dev, s); - if (status & (DT3000_ADSWERR | DT3000_ADHWERR)) + if (status & (DPR_INTR_ADSWERR | DPR_INTR_ADHWERR)) s->async->events |= COMEDI_CB_ERROR; debug_n_ints++; @@ -513,7 +511,7 @@ static int dt3k_ai_cmd(struct comedi_device *dev, struct comedi_subdevice *s) writew(DPR_SUBSYS_AI, dev->mmio + DPR_SUBSYS); dt3k_send_cmd(dev, DPR_CMD_CONFIG); - writew(DT3000_ADFULL | DT3000_ADSWERR | DT3000_ADHWERR, + writew(DPR_INTR_ADFULL | DPR_INTR_ADSWERR | DPR_INTR_ADHWERR, dev->mmio + DPR_INT_MASK); debug_n_ints = 0; -- 2.5.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2 07/14] staging: comedi: dt3000: remove proc subdevice
This subdevice is not allocated or defined in the driver. Remove the disabled subdevice initialization. Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/dt3000.c | 6 -- 1 file changed, 6 deletions(-) diff --git a/drivers/staging/comedi/drivers/dt3000.c b/drivers/staging/comedi/drivers/dt3000.c index 9ff7e95..fdae78d 100644 --- a/drivers/staging/comedi/drivers/dt3000.c +++ b/drivers/staging/comedi/drivers/dt3000.c @@ -721,12 +721,6 @@ static int dt3000_auto_attach(struct comedi_device *dev, s->len_chanlist = 1; s->range_table = &range_unknown; -#if 0 - s = &dev->subdevices[4]; - /* proc subsystem */ - s->type = COMEDI_SUBD_PROC; -#endif - return 0; } -- 2.5.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2 09/14] staging: comedi: dt3000: the dt3002 board does not have analog outputs
According to the boardinfo, the dt3002 board does not have analog outputs. The rest of the board have two 12-bit analog output channels. Replace the 'dachan' and 'dabits' members of the boardinfo with a bit- field flag 'has_ao'. Use the new member to conditionally initialize the analog output subdevice. Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/dt3000.c | 49 - 1 file changed, 23 insertions(+), 26 deletions(-) diff --git a/drivers/staging/comedi/drivers/dt3000.c b/drivers/staging/comedi/drivers/dt3000.c index 8d6d344..1ee3db6 100644 --- a/drivers/staging/comedi/drivers/dt3000.c +++ b/drivers/staging/comedi/drivers/dt3000.c @@ -170,9 +170,8 @@ struct dt3k_boardtype { int adchan; int ai_speed; const struct comedi_lrange *adrange; - int dachan; - int dabits; unsigned int ai_is_16bit:1; + unsigned int has_ao:1; }; static const struct dt3k_boardtype dt3k_boardtypes[] = { @@ -181,16 +180,14 @@ static const struct dt3k_boardtype dt3k_boardtypes[] = { .adchan = 16, .adrange= &range_dt3000_ai, .ai_speed = 3000, - .dachan = 2, - .dabits = 12, + .has_ao = 1, }, [BOARD_DT3001_PGL] = { .name = "dt3001-pgl", .adchan = 16, .adrange= &range_dt3000_ai_pgl, .ai_speed = 3000, - .dachan = 2, - .dabits = 12, + .has_ao = 1, }, [BOARD_DT3002] = { .name = "dt3002", @@ -203,34 +200,30 @@ static const struct dt3k_boardtype dt3k_boardtypes[] = { .adchan = 64, .adrange= &range_dt3000_ai, .ai_speed = 3000, - .dachan = 2, - .dabits = 12, + .has_ao = 1, }, [BOARD_DT3003_PGL] = { .name = "dt3003-pgl", .adchan = 64, .adrange= &range_dt3000_ai_pgl, .ai_speed = 3000, - .dachan = 2, - .dabits = 12, + .has_ao = 1, }, [BOARD_DT3004] = { .name = "dt3004", .adchan = 16, .adrange= &range_dt3000_ai, .ai_speed = 1, - .dachan = 2, - .dabits = 12, .ai_is_16bit= 1, + .has_ao = 1, }, [BOARD_DT3005] = { .name = "dt3005", /* a.k.a. 3004-200 */ .adchan = 16, .adrange= &range_dt3000_ai, .ai_speed = 5000, - .dachan = 2, - .dabits = 12, .ai_is_16bit= 1, + .has_ao = 1, }, }; @@ -681,19 +674,23 @@ static int dt3000_auto_attach(struct comedi_device *dev, s->cancel = dt3k_ai_cancel; } + /* Analog Output subdevice */ s = &dev->subdevices[1]; - /* ao subsystem */ - s->type = COMEDI_SUBD_AO; - s->subdev_flags = SDF_WRITABLE; - s->n_chan = 2; - s->maxdata = (1 << board->dabits) - 1; - s->len_chanlist = 1; - s->range_table = &range_bipolar10; - s->insn_write = dt3k_ao_insn_write; - - ret = comedi_alloc_subdev_readback(s); - if (ret) - return ret; + if (board->has_ao) { + s->type = COMEDI_SUBD_AO; + s->subdev_flags = SDF_WRITABLE; + s->n_chan = 2; + s->maxdata = 0x0fff; + s->range_table = &range_bipolar10; + s->insn_write = dt3k_ao_insn_write; + + ret = comedi_alloc_subdev_readback(s); + if (ret) + return ret; + + } else { + s->type = COMEDI_SUBD_UNUSED; + } s = &dev->subdevices[2]; /* dio subsystem */ -- 2.5.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2 10/14] staging: comedi: dt3000: rename dt3k_ai_insn()
For aesthetics, rename this subdevice (*insn_read) function to follow the normal naming in comedi drivers. Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/dt3000.c | 10 ++ 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/drivers/staging/comedi/drivers/dt3000.c b/drivers/staging/comedi/drivers/dt3000.c index 1ee3db6..2d293e6 100644 --- a/drivers/staging/comedi/drivers/dt3000.c +++ b/drivers/staging/comedi/drivers/dt3000.c @@ -511,8 +511,10 @@ static int dt3k_ai_cmd(struct comedi_device *dev, struct comedi_subdevice *s) return 0; } -static int dt3k_ai_insn(struct comedi_device *dev, struct comedi_subdevice *s, - struct comedi_insn *insn, unsigned int *data) +static int dt3k_ai_insn_read(struct comedi_device *dev, +struct comedi_subdevice *s, +struct comedi_insn *insn, +unsigned int *data) { int i; unsigned int chan, gain, aref; @@ -657,14 +659,14 @@ static int dt3000_auto_attach(struct comedi_device *dev, if (ret) return ret; + /* Analog Input subdevice */ s = &dev->subdevices[0]; - /* ai subdevice */ s->type = COMEDI_SUBD_AI; s->subdev_flags = SDF_READABLE | SDF_GROUND | SDF_DIFF; s->n_chan = board->adchan; - s->insn_read= dt3k_ai_insn; s->maxdata = board->ai_is_16bit ? 0x : 0x0fff; s->range_table = &range_dt3000_ai; /* XXX */ + s->insn_read= dt3k_ai_insn_read; if (dev->irq) { dev->read_subdev = s; s->subdev_flags |= SDF_CMD_READ; -- 2.5.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2 08/14] staging: comedi: dt3000: refactor 'adbits' boardinfo
All the board supported by this driver have analog inputs. The input resolution is either 12-bit or 16-bit. Replace the 'adbits' member of the boardinfo with a bit-field flag 'ai_is_16bits' and just set if for the 16-bit boards. Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/dt3000.c | 13 - 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/drivers/staging/comedi/drivers/dt3000.c b/drivers/staging/comedi/drivers/dt3000.c index fdae78d..8d6d344 100644 --- a/drivers/staging/comedi/drivers/dt3000.c +++ b/drivers/staging/comedi/drivers/dt3000.c @@ -168,18 +168,17 @@ enum dt3k_boardid { struct dt3k_boardtype { const char *name; int adchan; - int adbits; int ai_speed; const struct comedi_lrange *adrange; int dachan; int dabits; + unsigned int ai_is_16bit:1; }; static const struct dt3k_boardtype dt3k_boardtypes[] = { [BOARD_DT3001] = { .name = "dt3001", .adchan = 16, - .adbits = 12, .adrange= &range_dt3000_ai, .ai_speed = 3000, .dachan = 2, @@ -188,7 +187,6 @@ static const struct dt3k_boardtype dt3k_boardtypes[] = { [BOARD_DT3001_PGL] = { .name = "dt3001-pgl", .adchan = 16, - .adbits = 12, .adrange= &range_dt3000_ai_pgl, .ai_speed = 3000, .dachan = 2, @@ -197,14 +195,12 @@ static const struct dt3k_boardtype dt3k_boardtypes[] = { [BOARD_DT3002] = { .name = "dt3002", .adchan = 32, - .adbits = 12, .adrange= &range_dt3000_ai, .ai_speed = 3000, }, [BOARD_DT3003] = { .name = "dt3003", .adchan = 64, - .adbits = 12, .adrange= &range_dt3000_ai, .ai_speed = 3000, .dachan = 2, @@ -213,7 +209,6 @@ static const struct dt3k_boardtype dt3k_boardtypes[] = { [BOARD_DT3003_PGL] = { .name = "dt3003-pgl", .adchan = 64, - .adbits = 12, .adrange= &range_dt3000_ai_pgl, .ai_speed = 3000, .dachan = 2, @@ -222,20 +217,20 @@ static const struct dt3k_boardtype dt3k_boardtypes[] = { [BOARD_DT3004] = { .name = "dt3004", .adchan = 16, - .adbits = 16, .adrange= &range_dt3000_ai, .ai_speed = 1, .dachan = 2, .dabits = 12, + .ai_is_16bit= 1, }, [BOARD_DT3005] = { .name = "dt3005", /* a.k.a. 3004-200 */ .adchan = 16, - .adbits = 16, .adrange= &range_dt3000_ai, .ai_speed = 5000, .dachan = 2, .dabits = 12, + .ai_is_16bit= 1, }, }; @@ -675,7 +670,7 @@ static int dt3000_auto_attach(struct comedi_device *dev, s->subdev_flags = SDF_READABLE | SDF_GROUND | SDF_DIFF; s->n_chan = board->adchan; s->insn_read= dt3k_ai_insn; - s->maxdata = (1 << board->adbits) - 1; + s->maxdata = board->ai_is_16bit ? 0x : 0x0fff; s->range_table = &range_dt3000_ai; /* XXX */ if (dev->irq) { dev->read_subdev = s; -- 2.5.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2 11/14] staging: comedi: dt3000: tidy up digital i/o subdevice init
Remove the unnecessary 'len_chanlist' initialization. This member is only used by subdevices that support async commands. For aesthetics, reorder the initialization a bit. Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/dt3000.c | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/staging/comedi/drivers/dt3000.c b/drivers/staging/comedi/drivers/dt3000.c index 2d293e6..5d1e4bb 100644 --- a/drivers/staging/comedi/drivers/dt3000.c +++ b/drivers/staging/comedi/drivers/dt3000.c @@ -694,16 +694,15 @@ static int dt3000_auto_attach(struct comedi_device *dev, s->type = COMEDI_SUBD_UNUSED; } + /* Digital I/O subdevice */ s = &dev->subdevices[2]; - /* dio subsystem */ s->type = COMEDI_SUBD_DIO; s->subdev_flags = SDF_READABLE | SDF_WRITABLE; s->n_chan = 8; - s->insn_config = dt3k_dio_insn_config; - s->insn_bits= dt3k_dio_insn_bits; s->maxdata = 1; - s->len_chanlist = 8; s->range_table = &range_digital; + s->insn_config = dt3k_dio_insn_config; + s->insn_bits= dt3k_dio_insn_bits; s = &dev->subdevices[3]; /* mem subsystem */ -- 2.5.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2 13/14] staging: comedi: dt3000: remove #if 0'ed out code
Replace the disabled code in dt3k_dio_config() with a comment in case it's actually needed. Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/dt3000.c | 7 ++- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/staging/comedi/drivers/dt3000.c b/drivers/staging/comedi/drivers/dt3000.c index 0610875..32bd68d 100644 --- a/drivers/staging/comedi/drivers/dt3000.c +++ b/drivers/staging/comedi/drivers/dt3000.c @@ -554,11 +554,8 @@ static void dt3k_dio_config(struct comedi_device *dev, int bits) writew(DPR_SUBSYS_DOUT, dev->mmio + DPR_SUBSYS); writew(bits, dev->mmio + DPR_PARAMS(0)); -#if 0 - /* don't know */ - writew(0, dev->mmio + DPR_PARAMS(1)); - writew(0, dev->mmio + DPR_PARAMS(2)); -#endif + + /* XXX write 0 to DPR_PARAMS(1) and DPR_PARAMS(2) ? */ dt3k_send_cmd(dev, DPR_CMD_CONFIG); } -- 2.5.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2 14/14] staging: comedi: dt3000: update the MODULE_DESCRIPTION
Change the MODULE_DESCRIPTION to something more ueeful than the generic "Comedi low-level driver". Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/dt3000.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/comedi/drivers/dt3000.c b/drivers/staging/comedi/drivers/dt3000.c index 32bd68d..ab7a332 100644 --- a/drivers/staging/comedi/drivers/dt3000.c +++ b/drivers/staging/comedi/drivers/dt3000.c @@ -747,5 +747,5 @@ static struct pci_driver dt3000_pci_driver = { module_comedi_pci_driver(dt3000_driver, dt3000_pci_driver); MODULE_AUTHOR("Comedi http://www.comedi.org";); -MODULE_DESCRIPTION("Comedi low-level driver"); +MODULE_DESCRIPTION("Comedi driver for Data Translation DT3000 series boards"); MODULE_LICENSE("GPL"); -- 2.5.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2 12/14] staging: comedi: dt3000: tidy up memory subdevice init
Remove the unnecessary 'len_chanlist' initialization. This member is only used by subdevices that support async commands. For aesthetics, reorder the initialization a bit. Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/dt3000.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/staging/comedi/drivers/dt3000.c b/drivers/staging/comedi/drivers/dt3000.c index 5d1e4bb..0610875 100644 --- a/drivers/staging/comedi/drivers/dt3000.c +++ b/drivers/staging/comedi/drivers/dt3000.c @@ -704,15 +704,14 @@ static int dt3000_auto_attach(struct comedi_device *dev, s->insn_config = dt3k_dio_insn_config; s->insn_bits= dt3k_dio_insn_bits; + /* Memory subdevice */ s = &dev->subdevices[3]; - /* mem subsystem */ s->type = COMEDI_SUBD_MEMORY; s->subdev_flags = SDF_READABLE; s->n_chan = 0x1000; - s->insn_read= dt3k_mem_insn_read; s->maxdata = 0xff; - s->len_chanlist = 1; s->range_table = &range_unknown; + s->insn_read= dt3k_mem_insn_read; return 0; } -- 2.5.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 1/2] staging: wilc1000: linux_wlan_spi: correct types
linux_spi_write(), linux_spi_read(), linux_spi_write_read(): nwi->io_func.u.spi.spi_tx = linux_spi_write; nwi->io_func.u.spi.spi_rx = linux_spi_read; nwi->io_func.u.spi.spi_trx = linux_spi_write_read; are expected to accept arguments of 'u8 *', u32 types: struct { int (*spi_max_speed)(void); int (*spi_tx)(u8 *, u32); int (*spi_rx)(u8 *, u32); int (*spi_trx)(u8 *, u8 *, u32); } spi; However, linux_spi_read() and linux_spi_write_read() do not do this, they use 'unsigned char *' and 'unsigned long' instead. Changed the types of their arguments to satisfy the expectations. Signed-off-by: Stanislav Kholmanskikh --- drivers/staging/wilc1000/linux_wlan_spi.c | 12 ++-- drivers/staging/wilc1000/linux_wlan_spi.h | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/staging/wilc1000/linux_wlan_spi.c b/drivers/staging/wilc1000/linux_wlan_spi.c index 51bbd96..c6c1f6e 100644 --- a/drivers/staging/wilc1000/linux_wlan_spi.c +++ b/drivers/staging/wilc1000/linux_wlan_spi.c @@ -243,7 +243,7 @@ int linux_spi_write(u8 *b, u32 len) #if defined(TXRX_PHASE_SIZE) -int linux_spi_read(unsigned char *rb, unsigned long rlen) +int linux_spi_read(u8 *rb, u32 rlen) { int ret; @@ -307,7 +307,7 @@ int linux_spi_read(unsigned char *rb, unsigned long rlen) kfree(t_buffer); } else { - PRINT_ER("can't read data with the following length: %ld\n", rlen); + PRINT_ER("can't read data with the following length: %u\n", rlen); ret = -1; } /* change return value to match WILC interface */ @@ -317,7 +317,7 @@ int linux_spi_read(unsigned char *rb, unsigned long rlen) } #else -int linux_spi_read(unsigned char *rb, unsigned long rlen) +int linux_spi_read(u8 *rb, u32 rlen) { int ret; @@ -351,7 +351,7 @@ int linux_spi_read(unsigned char *rb, unsigned long rlen) } kfree(t_buffer); } else { - PRINT_ER("can't read data with the following length: %ld\n", rlen); + PRINT_ER("can't read data with the following length: %u\n", rlen); ret = -1; } /* change return value to match WILC interface */ @@ -362,7 +362,7 @@ int linux_spi_read(unsigned char *rb, unsigned long rlen) #endif -int linux_spi_write_read(unsigned char *wb, unsigned char *rb, unsigned int rlen) +int linux_spi_write_read(u8 *wb, u8 *rb, u32 rlen) { int ret; @@ -390,7 +390,7 @@ int linux_spi_write_read(unsigned char *wb, unsigned char *rb, unsigned int rlen PRINT_ER("SPI transaction failed\n"); } } else { - PRINT_ER("can't read data with the following length: %d\n", rlen); + PRINT_ER("can't read data with the following length: %u\n", rlen); ret = -1; } /* change return value to match WILC interface */ diff --git a/drivers/staging/wilc1000/linux_wlan_spi.h b/drivers/staging/wilc1000/linux_wlan_spi.h index d8eed0f..7356785 100644 --- a/drivers/staging/wilc1000/linux_wlan_spi.h +++ b/drivers/staging/wilc1000/linux_wlan_spi.h @@ -9,6 +9,6 @@ int linux_spi_init(void *vp); void linux_spi_deinit(void *vp); int linux_spi_write(u8 *b, u32 len); int linux_spi_read(u8 *rb, u32 rlen); -int linux_spi_write_read(unsigned char *wb, unsigned char *rb, unsigned int rlen); +int linux_spi_write_read(u8 *wb, u8 *rb, u32 rlen); int linux_spi_set_max_speed(void); #endif -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 2/2] staging: wilc1000: linux_wlan_spi: include header
A check using 'sparse' shows warnings in linux_wlan_spi.c: drivers/staging/wilc1000/linux_wlan_spi.c:43:19: warning: symbol 'wilc_spi_dev' was not declared. Should it be static? drivers/staging/wilc1000/linux_wlan_spi.c:71:19: warning: symbol 'wilc_bus' was not declared. Should it be static? drivers/staging/wilc1000/linux_wlan_spi.c:95:5: warning: symbol 'linux_spi_init' was not declared. Should it be static? drivers/staging/wilc1000/linux_wlan_spi.c:195:5: warning: symbol 'linux_spi_write' was not declared. Should it be static? drivers/staging/wilc1000/linux_wlan_spi.c:320:5: warning: symbol 'linux_spi_read' was not declared. Should it be static? drivers/staging/wilc1000/linux_wlan_spi.c:365:5: warning: symbol 'linux_spi_write_read' was not declared. Should it be static? drivers/staging/wilc1000/linux_wlan_spi.c:402:5: warning: symbol 'linux_spi_set_max_speed' was not declared. Should it be static? Let's avoid it by including "linux_wlan_spi.h" header. Signed-off-by: Stanislav Kholmanskikh --- drivers/staging/wilc1000/linux_wlan_spi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/wilc1000/linux_wlan_spi.c b/drivers/staging/wilc1000/linux_wlan_spi.c index c6c1f6e..760b72a 100644 --- a/drivers/staging/wilc1000/linux_wlan_spi.c +++ b/drivers/staging/wilc1000/linux_wlan_spi.c @@ -10,6 +10,7 @@ #include #include "linux_wlan_common.h" +#include "linux_wlan_spi.h" #define USE_SPI_DMA 0 /* johnny add */ @@ -40,7 +41,6 @@ static u32 SPEED = MIN_SPEED; -struct spi_device *wilc_spi_dev; void linux_spi_deinit(void *vp); static int __init wilc_bus_probe(struct spi_device *spi) -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
staging: wilc1000: WILC1000_DYNAMICALLY_ALLOCATE_MEMROY
Hi! I noticed that drivers/staging/wilc1000/Kconfic defines: config WILC1000_DYNAMICALLY_ALLOCATE_MEMROY bool "Dynamically allocate memory in real time" ---help--- This choice supports dynamic allocation of the memory for the receive buffer. The driver will allocate the RX buffer when it is required. "MEMROY" looks suspicious. Is it a typo (MEMORY?) or by intent? Thanks! ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: staging: wilc1000: WILC1000_DYNAMICALLY_ALLOCATE_MEMROY
On Thu, Oct 08, 2015 at 09:29:35PM +0300, Stanislav Kholmanskikh wrote: > Hi! > > I noticed that drivers/staging/wilc1000/Kconfic defines: > > config WILC1000_DYNAMICALLY_ALLOCATE_MEMROY > bool "Dynamically allocate memory in real time" > ---help--- > This choice supports dynamic allocation of the memory > for the receive buffer. The driver will allocate the RX buffer > when it is required. > > > "MEMROY" looks suspicious. Is it a typo (MEMORY?) or by intent? Probably a typo, but be sure to see if it lines up with what the code expects before changing anything. Ideally in the end this option should be removed as the driver should only do dynamic allocation, no static allocation should be needed. thanks, greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] Staging: vt6655: Renamed uRATE to rate
From: Paul McQuade Renamed uRATE to rate to avoid camelcase Signed-off-by: Paul McQuade --- drivers/staging/vt6655/rf.c | 12 ++-- drivers/staging/vt6655/rf.h | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/staging/vt6655/rf.c b/drivers/staging/vt6655/rf.c index c537321..4c22bb3 100644 --- a/drivers/staging/vt6655/rf.c +++ b/drivers/staging/vt6655/rf.c @@ -768,7 +768,7 @@ bool RFvWriteWakeProgSyn(struct vnt_private *priv, unsigned char byRFType, */ bool RFbSetPower( struct vnt_private *priv, - unsigned int uRATE, + unsigned int rate, u16 uCH ) { @@ -782,7 +782,7 @@ bool RFbSetPower( if ((uCH < 1) || (uCH > CB_MAX_CHANNEL)) return false; - switch (uRATE) { + switch (rate) { case RATE_1M: case RATE_2M: case RATE_5M: @@ -818,7 +818,7 @@ bool RFbSetPower( if (priv->byCurPwr == byPwr) return true; - bResult = RFbRawSetPower(priv, byPwr, uRATE); + bResult = RFbRawSetPower(priv, byPwr, rate); if (bResult) priv->byCurPwr = byPwr; @@ -842,7 +842,7 @@ bool RFbSetPower( bool RFbRawSetPower( struct vnt_private *priv, unsigned char byPwr, - unsigned int uRATE + unsigned int rate ) { bool bResult = true; @@ -854,7 +854,7 @@ bool RFbRawSetPower( switch (priv->byRFType) { case RF_AIROHA: bResult &= IFRFbWriteEmbedded(priv, dwAL2230PowerTable[byPwr]); - if (uRATE <= RATE_11M) + if (rate <= RATE_11M) bResult &= IFRFbWriteEmbedded(priv, 0x0001B400+(BY_AL2230_REG_LEN<<3)+IFREGCTL_REGW); else bResult &= IFRFbWriteEmbedded(priv, 0x0005A400+(BY_AL2230_REG_LEN<<3)+IFREGCTL_REGW); @@ -863,7 +863,7 @@ bool RFbRawSetPower( case RF_AL2230S: bResult &= IFRFbWriteEmbedded(priv, dwAL2230PowerTable[byPwr]); - if (uRATE <= RATE_11M) { + if (rate <= RATE_11M) { bResult &= IFRFbWriteEmbedded(priv, 0x040C1400+(BY_AL2230_REG_LEN<<3)+IFREGCTL_REGW); bResult &= IFRFbWriteEmbedded(priv, 0x00299B00+(BY_AL2230_REG_LEN<<3)+IFREGCTL_REGW); } else { diff --git a/drivers/staging/vt6655/rf.h b/drivers/staging/vt6655/rf.h index b5fc3ee..e9c7869 100644 --- a/drivers/staging/vt6655/rf.h +++ b/drivers/staging/vt6655/rf.h @@ -79,11 +79,11 @@ bool RFbInit( struct vnt_private * ); bool RFvWriteWakeProgSyn(struct vnt_private *, unsigned char byRFType, u16); -bool RFbSetPower(struct vnt_private *, unsigned int uRATE, u16); +bool RFbSetPower(struct vnt_private *, unsigned int rate, u16); bool RFbRawSetPower( struct vnt_private *, unsigned char byPwr, - unsigned int uRATE + unsigned int rate ); void -- 2.5.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: comedi: 8255_pci: prefer using the BIT macro
As suggested by checkpatch.pl, use the BIT macro to define the register bits. Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/8255_pci.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/comedi/drivers/8255_pci.c b/drivers/staging/comedi/drivers/8255_pci.c index bb9854b..38c05d1 100644 --- a/drivers/staging/comedi/drivers/8255_pci.c +++ b/drivers/staging/comedi/drivers/8255_pci.c @@ -178,8 +178,8 @@ static const struct pci_8255_boardinfo pci_8255_boards[] = { }; /* ripped from mite.h and mite_setup2() to avoid mite dependency */ -#define MITE_IODWBSR 0xc0 /* IO Device Window Base Size Register */ -#define WENAB (1 << 7) /* window enable */ +#define MITE_IODWBSR 0xc0/* IO Device Window Base Size Register */ +#define WENAB BIT(7) /* window enable */ static int pci_8255_mite_init(struct pci_dev *pcidev) { -- 2.5.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 0/3] staging: sm750fb: remove sii164 DVI controller support
Hi Sudip, On Thu, Oct 08, 2015 at 11:46:28AM +0530, Sudip Mukherjee wrote: > On Tue, Oct 06, 2015 at 04:49:13PM +0100, Mike Rapoport wrote: > > Currently the sii164 DVI controller support is unused anywhere in the rest > > of > > the driver, and, anyway it does not belong to framebuffer device driver. > > These patches remove the sii164 DVI controller support. > I am not sure if we can remove sii164. Sil164 has two configuration > method. One is from i2c R/W and the other is hardware gpio setting. > > Generally, we use hardware GPIO setting. So we don't need any driver for > sil164. And that is why you see it is unused here. > > But SM750LE will always require swi2c for its dvi chip. And SM750LE is a > special version of the hardware which only Huawei uses. > > And if i remember correctly sii164 code will be used if USE_DVICHIP and > USE_HW_I2C are not defined. The code from ddk750_dvi and ddk750_sii164 is never called from the rest of the driver, the USE_DVICHIP is defined and used only by ddk750_dvi and ddk750_sii164 themself, and USE_HW_I2C is used only by ddk750_sii164. As I've mentioned earlier (1), sm750 has several sub-devices and idealy we should have an MFD driver and sub-devices drivers. Than I2C controller and GPIO controller would be enabled by their own drivers and the DVI controller would be configured as a device on the I2C bus. Anyway, if we are to keep the DVI controller related code, there should be something that actually uses that code in the sm750 driver. As for selection whether to use DVI controller and how it will be accessed, it should be at least a build option rather then several defines that are set once and forever. [1] http://www.spinics.net/lists/linux-driver-devel/msg72426.html > TODO file lists removal of USE_HW_I2C and USE_DVICHIP as at that time I > planned to remove support of SM750LE but Greg suggested to keep it > (https://lkml.org/lkml/2015/3/19/353). > > regards > sudip -- Sincerely yours, Mike. ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 1/3] staging: sm750fb: merge calcPLL and getPllValue into getChipClock
On Thu, Oct 08, 2015 at 12:58:04PM +0530, Sudip Mukherjee wrote: > On Tue, Oct 06, 2015 at 09:42:15AM +0100, Mike Rapoport wrote: > > The getChipClock function is used only to get MXCLK frequency, which > > makes most of getPllValue function unused and thus. The detection of > > MXCLK frequency may be implemented directly in getChipClock rendering > > getPllValue and calcPLL unused. > > > > Signed-off-by: Mike Rapoport > > --- > > You have also missed saving the values in pPLL->inputFreq and > pPLL->clockType = clockType. Both have been used later. the pPLL pointer that is passed to getPllValue points to a local variable in getChipClock. If we merge these funcions, the variable and the pointer are not needed. > Is it ok to remove the PLL calculation of all the different type of > display devices? Currently only PANEL_PLL_CTRL is being used for > calculation and ofcourse we also donot keep in kernel that we donot use. I think we can remove the unused code and then generalize the clock calculations if anybody will ever need it. > Maybe we can do some thing like: > > diff --git a/drivers/staging/sm750fb/ddk750_chip.c > b/drivers/staging/sm750fb/ddk750_chip.c > index ad2f1c0..4b60894 100644 > --- a/drivers/staging/sm750fb/ddk750_chip.c > +++ b/drivers/staging/sm750fb/ddk750_chip.c > @@ -39,11 +39,17 @@ static unsigned int getChipClock(void) > { > unsigned int pll_reg; > unsigned int M, N, OD, POD; > + clock_type_t clk_type = PANEL_PLL_CTRL; > + /* > + * Different register location based on display device type: > + * MXCLK_PLL_CTRL, PANEL_PLL_CTRL, CRT_PLL_CTRL, VGA_PLL0_CTRL, > + * VGA_PLL1_CTRL > + */ > > if (getChipType() == SM750LE) > return MHz(130); > > - pll_reg = PEEK32(MXCLK_PLL_CTRL); > + pll_reg = PEEK32(clk_type); > M = FIELD_GET(pll_reg, PANEL_PLL_CTRL, M); > N = FIELD_GET(pll_reg, PANEL_PLL_CTRL, N); > OD = FIELD_GET(pll_reg, PANEL_PLL_CTRL, OD); > > --- > > This is on top of your patch. So now we have the different possible > values in the comments, so whenever, if anyone is working on a different > device atleast they will not have to search and find out what the other > values can be. > > regards > sudip ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH v2 0/3] staging: comedi: ii_pci20kc: cleanup driver
On 08/10/15 18:30, H Hartley Sweeten wrote: Fix a minor checkpatch.pl issue and cleanup this driver a bit. v2: as Ian abbott pointed out, it appears that the analog output data always needs munging to 2's complement. Fix patch 2 and merge with patch 3. H Hartley Sweeten (3): staging: comedi: ii_pci20kc: prefer using the BIT macro staging: comedi: ii_pci20kc: use comedi_offset_munge() staging: comedi: ii_pci20kc: update the MODULE_DESCRIPTION drivers/staging/comedi/drivers/ii_pci20kc.c | 84 ++--- 1 file changed, 40 insertions(+), 44 deletions(-) Reviewed-by: Ian Abbott -- -=( Ian Abbott @ MEV Ltd.E-mail: )=- -=( Web: http://www.mev.co.uk/ )=- ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH v2 00/14] staging: comedi: dt3000: cleanup driver
On 08/10/15 18:48, H Hartley Sweeten wrote: This series fixes all the checkpatch.pl issues and cleans up the driver a bit. There are still some issues with this driver but I have not been able to locate a datasheet... :-( v2: fix patch 9 as pointed out by Ian Abbott The comedi_alloc_subdev_readback() also needs to be moved into the if block. H Hartley Sweeten (14): staging: comedi: dt3000: tidy up multi-line comments staging: comedi: dt3000: rename dual-ported RAM location defines staging: comedi: dt3000: tidy up the command mailbox defines staging: comedi: dt3000: rename the SUBS_* defines staging: comedi: dt3000: rename the interrupt flag defines staging: comedi: dt3000: tidy up remaining defines staging: comedi: dt3000: remove proc subdevice staging: comedi: dt3000: refactor 'adbits' boardinfo staging: comedi: dt3000: the dt3002 board does not have analog outputs staging: comedi: dt3000: rename dt3k_ai_insn() staging: comedi: dt3000: tidy up digital i/o subdevice init staging: comedi: dt3000: tidy up memory subdevice init staging: comedi: dt3000: remove #if 0'ed out code staging: comedi: dt3000: update the MODULE_DESCRIPTION drivers/staging/comedi/drivers/dt3000.c | 466 +++- 1 file changed, 224 insertions(+), 242 deletions(-) Thanks! Reviewed-by: Ian Abbott -- -=( Ian Abbott @ MEV Ltd.E-mail: )=- -=( Web: http://www.mev.co.uk/ )=- ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging: comedi: 8255_pci: prefer using the BIT macro
On 08/10/15 21:05, H Hartley Sweeten wrote: As suggested by checkpatch.pl, use the BIT macro to define the register bits. Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/8255_pci.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/comedi/drivers/8255_pci.c b/drivers/staging/comedi/drivers/8255_pci.c index bb9854b..38c05d1 100644 --- a/drivers/staging/comedi/drivers/8255_pci.c +++ b/drivers/staging/comedi/drivers/8255_pci.c @@ -178,8 +178,8 @@ static const struct pci_8255_boardinfo pci_8255_boards[] = { }; /* ripped from mite.h and mite_setup2() to avoid mite dependency */ -#define MITE_IODWBSR 0xc0 /* IO Device Window Base Size Register */ -#define WENAB (1 << 7) /* window enable */ +#define MITE_IODWBSR 0xc0/* IO Device Window Base Size Register */ +#define WENAB BIT(7) /* window enable */ static int pci_8255_mite_init(struct pci_dev *pcidev) { Reviewed-by: Ian Abbott -- -=( Ian Abbott @ MEV Ltd.E-mail: )=- -=( Web: http://www.mev.co.uk/ )=- ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] IB/hfi1: use TASK_COMM_LEN in hfi1_ctxtdata
Use comm[TASK_COMM_LEN] instead of comm[16]. Signed-off-by: Geliang Tang --- drivers/staging/rdma/hfi1/hfi.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/rdma/hfi1/hfi.h b/drivers/staging/rdma/hfi1/hfi.h index 8ca171b..a35213e 100644 --- a/drivers/staging/rdma/hfi1/hfi.h +++ b/drivers/staging/rdma/hfi1/hfi.h @@ -262,7 +262,7 @@ struct hfi1_ctxtdata { pid_t pid; pid_t subpid[HFI1_MAX_SHARED_CTXTS]; /* same size as task_struct .comm[], command that opened context */ - char comm[16]; + char comm[TASK_COMM_LEN]; /* so file ops can get at unit */ struct hfi1_devdata *dd; /* so functions that need physical port can get it easily */ -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] IB/ipath: use TASK_COMM_LEN in ipath_portdata
Use comm[TASK_COMM_LEN] instead of comm[16]. Add linux/sched.h header in ipath_kernel.h, and remove linux/sched.h header from ipath_*.c which have included ipath_kernel.h. Signed-off-by: Geliang Tang --- drivers/staging/rdma/ipath/ipath_driver.c | 1 - drivers/staging/rdma/ipath/ipath_intr.c| 1 - drivers/staging/rdma/ipath/ipath_kernel.h | 3 ++- drivers/staging/rdma/ipath/ipath_qp.c | 1 - drivers/staging/rdma/ipath/ipath_ruc.c | 1 - drivers/staging/rdma/ipath/ipath_ud.c | 1 - drivers/staging/rdma/ipath/ipath_user_pages.c | 1 - drivers/staging/rdma/ipath/ipath_user_sdma.c | 1 - drivers/staging/rdma/ipath/ipath_verbs_mcast.c | 1 - 9 files changed, 2 insertions(+), 9 deletions(-) diff --git a/drivers/staging/rdma/ipath/ipath_driver.c b/drivers/staging/rdma/ipath/ipath_driver.c index 46d9898..dfcfaa5 100644 --- a/drivers/staging/rdma/ipath/ipath_driver.c +++ b/drivers/staging/rdma/ipath/ipath_driver.c @@ -33,7 +33,6 @@ #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt -#include #include #include #include diff --git a/drivers/staging/rdma/ipath/ipath_intr.c b/drivers/staging/rdma/ipath/ipath_intr.c index e568971..0403fa2 100644 --- a/drivers/staging/rdma/ipath/ipath_intr.c +++ b/drivers/staging/rdma/ipath/ipath_intr.c @@ -33,7 +33,6 @@ #include #include -#include #include "ipath_kernel.h" #include "ipath_verbs.h" diff --git a/drivers/staging/rdma/ipath/ipath_kernel.h b/drivers/staging/rdma/ipath/ipath_kernel.h index f0f9471..66c934a 100644 --- a/drivers/staging/rdma/ipath/ipath_kernel.h +++ b/drivers/staging/rdma/ipath/ipath_kernel.h @@ -44,6 +44,7 @@ #include #include #include +#include #include #include @@ -162,7 +163,7 @@ struct ipath_portdata { struct pid *port_pid; struct pid *port_subpid[INFINIPATH_MAX_SUBPORT]; /* same size as task_struct .comm[] */ - char port_comm[16]; + char port_comm[TASK_COMM_LEN]; /* pkeys set by this use of this port */ u16 port_pkeys[4]; /* so file ops can get at unit */ diff --git a/drivers/staging/rdma/ipath/ipath_qp.c b/drivers/staging/rdma/ipath/ipath_qp.c index face876..0344327 100644 --- a/drivers/staging/rdma/ipath/ipath_qp.c +++ b/drivers/staging/rdma/ipath/ipath_qp.c @@ -32,7 +32,6 @@ */ #include -#include #include #include diff --git a/drivers/staging/rdma/ipath/ipath_ruc.c b/drivers/staging/rdma/ipath/ipath_ruc.c index 1f95bba..2296832 100644 --- a/drivers/staging/rdma/ipath/ipath_ruc.c +++ b/drivers/staging/rdma/ipath/ipath_ruc.c @@ -31,7 +31,6 @@ * SOFTWARE. */ -#include #include #include "ipath_verbs.h" diff --git a/drivers/staging/rdma/ipath/ipath_ud.c b/drivers/staging/rdma/ipath/ipath_ud.c index e8a2a91..33fcfe2 100644 --- a/drivers/staging/rdma/ipath/ipath_ud.c +++ b/drivers/staging/rdma/ipath/ipath_ud.c @@ -31,7 +31,6 @@ * SOFTWARE. */ -#include #include #include "ipath_verbs.h" diff --git a/drivers/staging/rdma/ipath/ipath_user_pages.c b/drivers/staging/rdma/ipath/ipath_user_pages.c index 1da1252..d29b4da 100644 --- a/drivers/staging/rdma/ipath/ipath_user_pages.c +++ b/drivers/staging/rdma/ipath/ipath_user_pages.c @@ -34,7 +34,6 @@ #include #include #include -#include #include "ipath_kernel.h" diff --git a/drivers/staging/rdma/ipath/ipath_user_sdma.c b/drivers/staging/rdma/ipath/ipath_user_sdma.c index e82b3ee..8c12e3c 100644 --- a/drivers/staging/rdma/ipath/ipath_user_sdma.c +++ b/drivers/staging/rdma/ipath/ipath_user_sdma.c @@ -33,7 +33,6 @@ #include #include #include -#include #include #include #include diff --git a/drivers/staging/rdma/ipath/ipath_verbs_mcast.c b/drivers/staging/rdma/ipath/ipath_verbs_mcast.c index 6216ea9..72d476f 100644 --- a/drivers/staging/rdma/ipath/ipath_verbs_mcast.c +++ b/drivers/staging/rdma/ipath/ipath_verbs_mcast.c @@ -32,7 +32,6 @@ */ #include -#include #include #include "ipath_verbs.h" -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel