Re: [PATCH] staging/rdma/hfi1: Disable thermal polling before sensor initialization
On Wed, Nov 04, 2015 at 11:44:17PM -0500, jubin.j...@intel.com wrote: > From: jareer.h.abdel-qader This should be "Jareer Abdel-Qader ". regards, dan carpenter ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging/rdma/hfi1: Delete unnecessary checks before two function calls
From: Markus Elfring Date: Thu, 5 Nov 2015 08:41:00 +0100 The functions "sc_return_credits" and "vfree" perform also input parameter validation. Thus the tests around their calls are not needed. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring --- drivers/staging/rdma/hfi1/file_ops.c | 2 +- drivers/staging/rdma/hfi1/user_sdma.c | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/staging/rdma/hfi1/file_ops.c b/drivers/staging/rdma/hfi1/file_ops.c index aae9826..204d1d0 100644 --- a/drivers/staging/rdma/hfi1/file_ops.c +++ b/drivers/staging/rdma/hfi1/file_ops.c @@ -313,7 +313,7 @@ static ssize_t hfi1_file_write(struct file *fp, const char __user *data, case HFI1_CMD_SDMA_STATUS_UPD: break; case HFI1_CMD_CREDIT_UPD: - if (uctxt && uctxt->sc) + if (uctxt) sc_return_credits(uctxt->sc); break; case HFI1_CMD_TID_UPDATE: diff --git a/drivers/staging/rdma/hfi1/user_sdma.c b/drivers/staging/rdma/hfi1/user_sdma.c index 36c838d..45f3797 100644 --- a/drivers/staging/rdma/hfi1/user_sdma.c +++ b/drivers/staging/rdma/hfi1/user_sdma.c @@ -473,8 +473,7 @@ int hfi1_user_sdma_free_queues(struct hfi1_filedata *fd) fd->pq = NULL; } if (fd->cq) { - if (fd->cq->comps) - vfree(fd->cq->comps); + vfree(fd->cq->comps); kfree(fd->cq); fd->cq = NULL; } -- 2.6.2 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging/rdma/hfi1: Delete unnecessary checks before two function calls
On Thu, Nov 05, 2015 at 09:10:47AM +0100, SF Markus Elfring wrote: > diff --git a/drivers/staging/rdma/hfi1/file_ops.c > b/drivers/staging/rdma/hfi1/file_ops.c > index aae9826..204d1d0 100644 > --- a/drivers/staging/rdma/hfi1/file_ops.c > +++ b/drivers/staging/rdma/hfi1/file_ops.c > @@ -313,7 +313,7 @@ static ssize_t hfi1_file_write(struct file *fp, const > char __user *data, > case HFI1_CMD_SDMA_STATUS_UPD: > break; > case HFI1_CMD_CREDIT_UPD: > - if (uctxt && uctxt->sc) > + if (uctxt) > sc_return_credits(uctxt->sc); Relying on hidden sanity checks makes the code harder to read. regards, dan carpenter ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH V3] Revert "Staging: wilc1000: coreconfigurator: Drop unneeded wrapper functions"
The source and destination pointers are misplaced. This will be like, ether_addr_copy(data, bssid + ADDR2); -> ether_addr_copy(bssid, data + ADDR2); and also to use ether_addr_copy, it has to be proved that src/dst address are properly aligned(2). I revert this as author agree to drop this patch. This reverts commit d4622f68db8095dd54179e3134e97812727f6b89. Signed-off-by: Glen Lee --- Changes in v3: change comments. drivers/staging/wilc1000/coreconfigurator.c | 48 +++-- 1 file changed, 25 insertions(+), 23 deletions(-) diff --git a/drivers/staging/wilc1000/coreconfigurator.c b/drivers/staging/wilc1000/coreconfigurator.c index fd7240c..56e0cf9 100644 --- a/drivers/staging/wilc1000/coreconfigurator.c +++ b/drivers/staging/wilc1000/coreconfigurator.c @@ -13,12 +13,8 @@ #include "wilc_wlan.h" #include #include -#include #define TAG_PARAM_OFFSET (MAC_HDR_LEN + TIME_STAMP_LEN + \ BEACON_INTERVAL_LEN + CAP_INFO_LEN) -#define ADDR1 4 -#define ADDR2 10 -#define ADDR3 16 /* Basic Frame Type Codes (2-bit) */ enum basic_frame_type { @@ -175,32 +171,38 @@ static inline u8 get_from_ds(u8 *header) return ((header[1] & 0x02) >> 1); } +/* This function extracts the MAC Address in 'address1' field of the MAC */ +/* header and updates the MAC Address in the allocated 'addr' variable. */ +static inline void get_address1(u8 *pu8msa, u8 *addr) +{ + memcpy(addr, pu8msa + 4, 6); +} + +/* This function extracts the MAC Address in 'address2' field of the MAC */ +/* header and updates the MAC Address in the allocated 'addr' variable. */ +static inline void get_address2(u8 *pu8msa, u8 *addr) +{ + memcpy(addr, pu8msa + 10, 6); +} + +/* This function extracts the MAC Address in 'address3' field of the MAC */ +/* header and updates the MAC Address in the allocated 'addr' variable. */ +static inline void get_address3(u8 *pu8msa, u8 *addr) +{ + memcpy(addr, pu8msa + 16, 6); +} + /* This function extracts the BSSID from the incoming WLAN packet based on */ -/* the 'from ds' bit, and updates the MAC Address in the allocated 'data'*/ +/* the 'from ds' bit, and updates the MAC Address in the allocated 'addr'*/ /* variable. */ static inline void get_BSSID(u8 *data, u8 *bssid) { if (get_from_ds(data) == 1) - /* -* Extract the MAC Address in 'address2' field of the MAC -* header and update the MAC Address in the allocated 'data' -* variable. -*/ - ether_addr_copy(data, bssid + ADDR2); + get_address2(data, bssid); else if (get_to_ds(data) == 1) - /* -* Extract the MAC Address in 'address1' field of the MAC -* header and update the MAC Address in the allocated 'data' -* variable. -*/ - ether_addr_copy(data, bssid + ADDR1); + get_address1(data, bssid); else - /* -* Extract the MAC Address in 'address3' field of the MAC -* header and update the MAC Address in the allocated 'data' -* variable. -*/ - ether_addr_copy(data, bssid + ADDR3); + get_address3(data, bssid); } /* This function extracts the SSID from a beacon/probe response frame*/ -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2 2/2] staging: rtl8188eu: unused macros removed
IS_* and GET_CVID_* macros have not been used. Signed-off-by: Ivan Safonov --- Changes in v2: - All e-mail addresses of get_mainterner.pl script for this patch placed to the cc header. - Patch description corrected. drivers/staging/rtl8188eu/core/rtw_ioctl_set.c | 7 -- drivers/staging/rtl8188eu/include/HalVerDef.h | 33 -- 2 files changed, 40 deletions(-) diff --git a/drivers/staging/rtl8188eu/core/rtw_ioctl_set.c b/drivers/staging/rtl8188eu/core/rtw_ioctl_set.c index 22f5b45..cf60717 100644 --- a/drivers/staging/rtl8188eu/core/rtw_ioctl_set.c +++ b/drivers/staging/rtl8188eu/core/rtw_ioctl_set.c @@ -27,13 +27,6 @@ extern void indicate_wx_scan_complete_event(struct adapter *padapter); -#define IS_MAC_ADDRESS_BROADCAST(addr) \ -(\ - ((addr[0] == 0xff) && (addr[1] == 0xff) && \ - (addr[2] == 0xff) && (addr[3] == 0xff) && \ - (addr[4] == 0xff) && (addr[5] == 0xff)) ? true : false \ -) - u8 rtw_do_join(struct adapter *padapter) { struct list_head *plist, *phead; diff --git a/drivers/staging/rtl8188eu/include/HalVerDef.h b/drivers/staging/rtl8188eu/include/HalVerDef.h index 56b4ff0..6f2b2a4 100644 --- a/drivers/staging/rtl8188eu/include/HalVerDef.h +++ b/drivers/staging/rtl8188eu/include/HalVerDef.h @@ -47,37 +47,4 @@ struct HAL_VERSION { enum HAL_VENDOR VendorType; }; -/* Get element */ -#define GET_CVID_CHIP_TYPE(version)(((version).ChipType)) -#define GET_CVID_MANUFACTUER(version) (((version).VendorType)) -#define GET_CVID_CUT_VERSION(version) (((version).CUTVersion)) - -/* Common Macro. -- */ -/* HAL_VERSION VersionID */ - -/* HAL_CHIP_TYPE_E */ -#define IS_TEST_CHIP(version) \ - ((GET_CVID_CHIP_TYPE(version) == TEST_CHIP) ? true : false) -#define IS_NORMAL_CHIP(version)\ - ((GET_CVID_CHIP_TYPE(version) == NORMAL_CHIP) ? true : false) - -/* HAL_CUT_VERSION_E */ -#define IS_A_CUT(version) \ - ((GET_CVID_CUT_VERSION(version) == A_CUT_VERSION) ? true : false) -#define IS_B_CUT(version) \ - ((GET_CVID_CUT_VERSION(version) == B_CUT_VERSION) ? true : false) -#define IS_C_CUT(version) \ - ((GET_CVID_CUT_VERSION(version) == C_CUT_VERSION) ? true : false) -#define IS_D_CUT(version) \ - ((GET_CVID_CUT_VERSION(version) == D_CUT_VERSION) ? true : false) -#define IS_E_CUT(version) \ - ((GET_CVID_CUT_VERSION(version) == E_CUT_VERSION) ? true : false) - - -/* HAL_VENDOR_E */ -#define IS_CHIP_VENDOR_TSMC(version) \ - ((GET_CVID_MANUFACTUER(version) == CHIP_VENDOR_TSMC) ? true : false) -#define IS_CHIP_VENDOR_UMC(version)\ - ((GET_CVID_MANUFACTUER(version) == CHIP_VENDOR_UMC) ? true : false) - #endif -- 2.4.10 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2 1/2] staging: rtl8188eu: rarely used macros replaced by their definitions
IS_* macros (except one) occur only once. Signed-off-by: Ivan Safonov --- Changes in v2: - All e-mail addresses of get_mainterner.pl script for this patch placed to the cc header. drivers/staging/rtl8188eu/hal/hal_com.c | 14 +++--- drivers/staging/rtl8188eu/hal/rtl8188e_dm.c | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/staging/rtl8188eu/hal/hal_com.c b/drivers/staging/rtl8188eu/hal/hal_com.c index 38e9fdc..3871cda 100644 --- a/drivers/staging/rtl8188eu/hal/hal_com.c +++ b/drivers/staging/rtl8188eu/hal/hal_com.c @@ -32,19 +32,19 @@ void dump_chip_info(struct HAL_VERSION chip_vers) char buf[128]; cnt += sprintf((buf+cnt), "Chip Version Info: CHIP_8188E_"); - cnt += sprintf((buf+cnt), "%s_", IS_NORMAL_CHIP(chip_vers) ? + cnt += sprintf((buf+cnt), "%s_", chip_vers.ChipType == NORMAL_CHIP ? "Normal_Chip" : "Test_Chip"); - cnt += sprintf((buf+cnt), "%s_", IS_CHIP_VENDOR_TSMC(chip_vers) ? + cnt += sprintf((buf+cnt), "%s_", chip_vers.VendorType == CHIP_VENDOR_TSMC ? "TSMC" : "UMC"); - if (IS_A_CUT(chip_vers)) + if (chip_vers.CUTVersion == A_CUT_VERSION) cnt += sprintf((buf+cnt), "A_CUT_"); - else if (IS_B_CUT(chip_vers)) + else if (chip_vers.CUTVersion == B_CUT_VERSION) cnt += sprintf((buf+cnt), "B_CUT_"); - else if (IS_C_CUT(chip_vers)) + else if (chip_vers.CUTVersion == C_CUT_VERSION) cnt += sprintf((buf+cnt), "C_CUT_"); - else if (IS_D_CUT(chip_vers)) + else if (chip_vers.CUTVersion == D_CUT_VERSION) cnt += sprintf((buf+cnt), "D_CUT_"); - else if (IS_E_CUT(chip_vers)) + else if (chip_vers.CUTVersion == E_CUT_VERSION) cnt += sprintf((buf+cnt), "E_CUT_"); else cnt += sprintf((buf+cnt), "UNKNOWN_CUT(%d)_", diff --git a/drivers/staging/rtl8188eu/hal/rtl8188e_dm.c b/drivers/staging/rtl8188eu/hal/rtl8188e_dm.c index fca5909..199a77a 100644 --- a/drivers/staging/rtl8188eu/hal/rtl8188e_dm.c +++ b/drivers/staging/rtl8188eu/hal/rtl8188e_dm.c @@ -67,7 +67,7 @@ static void Init_ODM_ComInfo_88E(struct adapter *Adapter) ODM_CmnInfoInit(dm_odm, ODM_CMNINFO_FAB_VER, fab_ver); ODM_CmnInfoInit(dm_odm, ODM_CMNINFO_CUT_VER, cut_ver); - ODM_CmnInfoInit(dm_odm, ODM_CMNINFO_MP_TEST_CHIP, IS_NORMAL_CHIP(hal_data->VersionID)); + ODM_CmnInfoInit(dm_odm, ODM_CMNINFO_MP_TEST_CHIP, hal_data->VersionID.ChipType == NORMAL_CHIP ? true : false); ODM_CmnInfoInit(dm_odm, ODM_CMNINFO_PATCH_ID, hal_data->CustomerID); ODM_CmnInfoInit(dm_odm, ODM_CMNINFO_BWIFI_TEST, Adapter->registrypriv.wifi_spec); -- 2.4.10 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 1/1] staging: rdma: hfi1 : Prefer using the BIT macro
This patch replaces bit shifting on 1 with the BIT(x) macro Signed-off-by: Sunny Kumar --- drivers/staging/rdma/hfi1/user_sdma.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/staging/rdma/hfi1/user_sdma.c b/drivers/staging/rdma/hfi1/user_sdma.c index 36c838d..95a6d99 100644 --- a/drivers/staging/rdma/hfi1/user_sdma.c +++ b/drivers/staging/rdma/hfi1/user_sdma.c @@ -146,8 +146,8 @@ MODULE_PARM_DESC(sdma_comp_size, "Size of User SDMA completion ring. Default: 12 #define KDETH_OM_MAX_SIZE (1 << ((KDETH_OM_LARGE / KDETH_OM_SMALL) + 1)) /* Last packet in the request */ -#define TXREQ_FLAGS_REQ_LAST_PKT (1 << 0) -#define TXREQ_FLAGS_IOVEC_LAST_PKT (1 << 0) +#define TXREQ_FLAGS_REQ_LAST_PKT BIT(1 << 0) +#define TXREQ_FLAGS_IOVEC_LAST_PKT BIT(1 << 0) #define SDMA_REQ_IN_USE 0 #define SDMA_REQ_FOR_THREAD 1 @@ -156,9 +156,9 @@ MODULE_PARM_DESC(sdma_comp_size, "Size of User SDMA completion ring. Default: 12 #define SDMA_REQ_HAS_ERROR 4 #define SDMA_REQ_DONE_ERROR 5 -#define SDMA_PKT_Q_INACTIVE (1 << 0) -#define SDMA_PKT_Q_ACTIVE (1 << 1) -#define SDMA_PKT_Q_DEFERRED (1 << 2) +#define SDMA_PKT_Q_INACTIVE BIT(1 << 0) +#define SDMA_PKT_Q_ACTIVE BIT(1 << 1) +#define SDMA_PKT_Q_DEFERRED BIT(1 << 2) /* * Maximum retry attempts to submit a TX request -- 2.1.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 1/3] staging: lustre: Delete unnecessary checks before two function calls
From: Markus Elfring Date: Thu, 5 Nov 2015 10:18:45 +0100 The functions kobject_put() and kset_unregister() test whether their argument is NULL and then return immediately. Thus the tests around their calls are not needed. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring --- drivers/staging/lustre/lustre/ldlm/ldlm_lockd.c | 10 +++--- drivers/staging/lustre/lustre/lmv/lmv_obd.c | 5 ++--- drivers/staging/lustre/lustre/lov/lov_obd.c | 4 +--- drivers/staging/lustre/lustre/obdclass/genops.c | 6 ++ 4 files changed, 8 insertions(+), 17 deletions(-) diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_lockd.c b/drivers/staging/lustre/lustre/ldlm/ldlm_lockd.c index ca11511..e67e84b 100644 --- a/drivers/staging/lustre/lustre/ldlm/ldlm_lockd.c +++ b/drivers/staging/lustre/lustre/ldlm/ldlm_lockd.c @@ -1062,13 +1062,9 @@ static int ldlm_cleanup(void) if (ldlm_state->ldlm_cb_service != NULL) ptlrpc_unregister_service(ldlm_state->ldlm_cb_service); - if (ldlm_ns_kset) - kset_unregister(ldlm_ns_kset); - if (ldlm_svc_kset) - kset_unregister(ldlm_svc_kset); - if (ldlm_kobj) - kobject_put(ldlm_kobj); - + kset_unregister(ldlm_ns_kset); + kset_unregister(ldlm_svc_kset); + kobject_put(ldlm_kobj); ldlm_debugfs_cleanup(); kfree(ldlm_state); diff --git a/drivers/staging/lustre/lustre/lmv/lmv_obd.c b/drivers/staging/lustre/lustre/lmv/lmv_obd.c index 635a93c..c3c8e8c 100644 --- a/drivers/staging/lustre/lustre/lmv/lmv_obd.c +++ b/drivers/staging/lustre/lustre/lmv/lmv_obd.c @@ -240,7 +240,7 @@ static int lmv_connect(const struct lu_env *env, if (data->ocd_connect_flags & OBD_CONNECT_REAL) rc = lmv_check_connect(obd); - if (rc && lmv->lmv_tgts_kobj) + if (rc) kobject_put(lmv->lmv_tgts_kobj); return rc; @@ -646,8 +646,7 @@ static int lmv_disconnect(struct obd_export *exp) lmv_disconnect_mdc(obd, lmv->tgts[i]); } - if (lmv->lmv_tgts_kobj) - kobject_put(lmv->lmv_tgts_kobj); + kobject_put(lmv->lmv_tgts_kobj); out_local: /* diff --git a/drivers/staging/lustre/lustre/lov/lov_obd.c b/drivers/staging/lustre/lustre/lov/lov_obd.c index 7abe484..910c62c 100644 --- a/drivers/staging/lustre/lustre/lov/lov_obd.c +++ b/drivers/staging/lustre/lustre/lov/lov_obd.c @@ -109,9 +109,7 @@ static void lov_putref(struct obd_device *obd) __lov_del_obd(obd, tgt); } - if (lov->lov_tgts_kobj) - kobject_put(lov->lov_tgts_kobj); - + kobject_put(lov->lov_tgts_kobj); } else { mutex_unlock(&lov->lov_lock); } diff --git a/drivers/staging/lustre/lustre/obdclass/genops.c b/drivers/staging/lustre/lustre/obdclass/genops.c index 6477aeb..a1cf8e1 100644 --- a/drivers/staging/lustre/lustre/obdclass/genops.c +++ b/drivers/staging/lustre/lustre/obdclass/genops.c @@ -216,8 +216,7 @@ int class_register_type(struct obd_ops *dt_ops, struct md_ops *md_ops, return 0; failed: - if (type->typ_kobj) - kobject_put(type->typ_kobj); + kobject_put(type->typ_kobj); kfree(type->typ_name); kfree(type->typ_md_ops); kfree(type->typ_dt_ops); @@ -244,8 +243,7 @@ int class_unregister_type(const char *name) return -EBUSY; } - if (type->typ_kobj) - kobject_put(type->typ_kobj); + kobject_put(type->typ_kobj); if (!IS_ERR_OR_NULL(type->typ_debugfs_entry)) ldebugfs_remove(&type->typ_debugfs_entry); -- 2.6.2 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 2/3] staging: lustre: Delete an unnecessary variable initialisation in class_register_type()
From: Markus Elfring Date: Thu, 5 Nov 2015 10:55:16 +0100 The variable "rc" will be eventually set to an error return code in the class_register_type() function. Thus let us omit the explicit initialisation at the beginning. Signed-off-by: Markus Elfring --- drivers/staging/lustre/lustre/obdclass/genops.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/lustre/lustre/obdclass/genops.c b/drivers/staging/lustre/lustre/obdclass/genops.c index a1cf8e1..acb86f0 100644 --- a/drivers/staging/lustre/lustre/obdclass/genops.c +++ b/drivers/staging/lustre/lustre/obdclass/genops.c @@ -155,7 +155,7 @@ int class_register_type(struct obd_ops *dt_ops, struct md_ops *md_ops, struct lu_device_type *ldt) { struct obd_type *type; - int rc = 0; + int rc; /* sanity check */ LASSERT(strnlen(name, CLASS_MAX_NAME) < CLASS_MAX_NAME); -- 2.6.2 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 3/3] staging: lustre: Less function calls in class_register_type() after error detection
From: Markus Elfring Date: Thu, 5 Nov 2015 12:48:58 +0100 The functions "kfree" and "kobject_put" were called in a few cases by the function "class_register_type" during error handling even if the passed variable contained a null pointer. This implementation detail could be improved by the adjustment of jump targets. Signed-off-by: Markus Elfring --- drivers/staging/lustre/lustre/obdclass/genops.c | 26 +++-- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/drivers/staging/lustre/lustre/obdclass/genops.c b/drivers/staging/lustre/lustre/obdclass/genops.c index acb86f0..4d99a39 100644 --- a/drivers/staging/lustre/lustre/obdclass/genops.c +++ b/drivers/staging/lustre/lustre/obdclass/genops.c @@ -171,13 +171,16 @@ int class_register_type(struct obd_ops *dt_ops, struct md_ops *md_ops, return rc; type->typ_dt_ops = kzalloc(sizeof(*type->typ_dt_ops), GFP_NOFS); + if (!type->typ_dt_ops) + goto free_type; + type->typ_md_ops = kzalloc(sizeof(*type->typ_md_ops), GFP_NOFS); - type->typ_name = kzalloc(strlen(name) + 1, GFP_NOFS); + if (!type->typ_md_ops) + goto free_dt_ops; - if (!type->typ_dt_ops || - !type->typ_md_ops || - !type->typ_name) - goto failed; + type->typ_name = kzalloc(strlen(name) + 1, GFP_NOFS); + if (!type->typ_name) + goto free_md_ops; *(type->typ_dt_ops) = *dt_ops; /* md_ops is optional */ @@ -193,20 +196,20 @@ int class_register_type(struct obd_ops *dt_ops, struct md_ops *md_ops, rc = type->typ_debugfs_entry ? PTR_ERR(type->typ_debugfs_entry) : -ENOMEM; type->typ_debugfs_entry = NULL; - goto failed; + goto free_name; } type->typ_kobj = kobject_create_and_add(type->typ_name, lustre_kobj); if (!type->typ_kobj) { rc = -ENOMEM; - goto failed; + goto free_name; } if (ldt != NULL) { type->typ_lu = ldt; rc = lu_device_type_init(ldt); if (rc != 0) - goto failed; + goto put_object; } spin_lock(&obd_types_lock); @@ -214,12 +217,15 @@ int class_register_type(struct obd_ops *dt_ops, struct md_ops *md_ops, spin_unlock(&obd_types_lock); return 0; - - failed: +put_object: kobject_put(type->typ_kobj); +free_name: kfree(type->typ_name); +free_md_ops: kfree(type->typ_md_ops); +free_dt_ops: kfree(type->typ_dt_ops); +free_type: kfree(type); return rc; } -- 2.6.2 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 0/3] staging: lustre: Deletion of some unnecessary checks
From: Markus Elfring Date: Thu, 5 Nov 2015 13:03:33 +0100 Further update suggestions were taken into account after a patch was applied from static source code analysis. Markus Elfring (3): Delete unnecessary checks before two function calls Delete an unnecessary variable initialisation in class_register_type() Less function calls in class_register_type() after error detection drivers/staging/lustre/lustre/ldlm/ldlm_lockd.c | 10 +++- drivers/staging/lustre/lustre/lmv/lmv_obd.c | 5 ++-- drivers/staging/lustre/lustre/lov/lov_obd.c | 4 +-- drivers/staging/lustre/lustre/obdclass/genops.c | 34 ++--- 4 files changed, 25 insertions(+), 28 deletions(-) -- 2.6.2 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 14/22] staging: comedi: adv_pci1710: support external analog output reference
On 04/11/15 16:55, H Hartley Sweeten wrote: The analog outputs can use an external reference to create the D/A output range. Add an entry to the comedi_lrange table for it and modify the (*insn_write) to support it. Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/adv_pci1710.c | 13 - 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/drivers/staging/comedi/drivers/adv_pci1710.c b/drivers/staging/comedi/drivers/adv_pci1710.c index 86ed288..339130b 100644 --- a/drivers/staging/comedi/drivers/adv_pci1710.c +++ b/drivers/staging/comedi/drivers/adv_pci1710.c @@ -65,6 +65,8 @@ #define PCI171X_CLRFIFO_REG 0x09/* W: clear FIFO */ #define PCI171X_DA_REG(x) (0x0a + ((x) * 2)) /* W: D/A register */ #define PCI171X_DAREF_REG 0x0e/* W: D/A reference control */ +#define PCI171X_DAREF(c, r)(((r) & 0x3) << ((c) * 2)) +#define PCI171X_DAREF_MASK(c) PCI171X_DAREF((c), 0x3) #define PCI171X_DI_REG0x10/* R: digital inputs */ #define PCI171X_DO_REG0x10/* W: digital outputs */ #define PCI171X_TIMER_BASE0x18/* R/W: 8254 timer */ @@ -111,9 +113,10 @@ static const struct comedi_lrange pci1711_ai_range = { }; static const struct comedi_lrange pci171x_ao_range = { - 2, { - UNI_RANGE(5), - UNI_RANGE(10) + 3, { + UNI_RANGE(5), /* internal -5V ref */ + UNI_RANGE(10), /* internal -10V ref */ + RANGE_ext(0, 1) /* external Vref (+/-10V max) */ Minor niggle: The comment for the external Vref is slightly confusing. The manual I have says: By inputting an external reference voltage: -xV , where |x| <= 10, you will get a output voltage range: 0 to xV. So the external reference voltage is never positive. How about this?: /* external -xV ref, |x| <= 10 */ -- -=( 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/3] staging: lustre: Delete unnecessary checks before two function calls
I don't like these patches because relying on hidden sanity checks makes the code harder to read. I am CC'd on all these patches because of kernel-janitors and normally I ignore them but this is drivers/staging so I am invested in this code. Feel free to send them to other subsystems though. regards, dan carpenter ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 2/3] staging: lustre: Delete an unnecessary variable initialisation in class_register_type()
Looks good. regards, dan carpenter ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 15/22] staging: comedi: adv_pci1710: tidy up analog output subdev_flags
On 04/11/15 16:55, H Hartley Sweeten wrote: The SDF_GROUND and SDF_COMMON flags are not needed for the analog output subdevice. Just remove them. Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/adv_pci1710.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/comedi/drivers/adv_pci1710.c b/drivers/staging/comedi/drivers/adv_pci1710.c index 339130b..0511f26 100644 --- a/drivers/staging/comedi/drivers/adv_pci1710.c +++ b/drivers/staging/comedi/drivers/adv_pci1710.c @@ -817,7 +817,7 @@ static int pci1710_auto_attach(struct comedi_device *dev, if (board->has_ao) { s = &dev->subdevices[subdev]; s->type = COMEDI_SUBD_AO; - s->subdev_flags = SDF_WRITABLE | SDF_GROUND | SDF_COMMON; + s->subdev_flags = SDF_WRITABLE; s->n_chan= 2; s->maxdata = 0x0fff; s->range_table = &pci171x_ao_range; The signal connector has separate pins for AIGND, AOGND and DGND, although ultimately they are referenced to the same voltage. I'd just leave the SDF_GROUND and SDF_COMMON flags set, same as for the analog input subdevice. -- -=( 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 19/22] staging: comedi: adv_pci1710: fix counter 0 internal clock source
On 04/11/15 16:55, H Hartley Sweeten wrote: Counters 1 and 2 of the 8254 are cascaeded to create the 32-bit timer used for the analog input pacer trigger. The base clock to these counters is 10 MHz. Counter 0 is available to the user for general purpose use. This counter can use either an internal 1 MHz clock or an external clock. The (*insn_config) for the counter subdevice provides support for INSN_CONFIG_{SET,GET}_CLOCK_SRC to allow the user to select the clock source to use. Fix the INSN_CONFIG_GET_CLOCK_SRC so it returns the correct speed of the internal clock. Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/adv_pci1710.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/comedi/drivers/adv_pci1710.c b/drivers/staging/comedi/drivers/adv_pci1710.c index c5f8bff..9e45f3d 100644 --- a/drivers/staging/comedi/drivers/adv_pci1710.c +++ b/drivers/staging/comedi/drivers/adv_pci1710.c @@ -701,7 +701,7 @@ static int pci1710_counter_insn_config(struct comedi_device *dev, data[2] = 0; } else { data[1] = 0; - data[2] = I8254_OSC_BASE_10MHZ; + data[2] = I8254_OSC_BASE_1MHZ; } break; default: The manual I have says it's 1 MHz for PCI-1711/1711L/1716/1716L, and 100 kHz for PCI-1710/1710L/1710HG/1710HGL. -- -=( 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/1] staging: rdma: hfi1 : Prefer using the BIT macro
On Thu, Nov 05, 2015 at 05:28:03PM +0530, Sunny Kumar wrote: > This patch replaces bit shifting on 1 with the BIT(x) macro > > Signed-off-by: Sunny Kumar > --- > drivers/staging/rdma/hfi1/user_sdma.c | 10 +- > 1 file changed, 5 insertions(+), 5 deletions(-) > > /* Last packet in the request */ > -#define TXREQ_FLAGS_REQ_LAST_PKT (1 << 0) > -#define TXREQ_FLAGS_IOVEC_LAST_PKT (1 << 0) > +#define TXREQ_FLAGS_REQ_LAST_PKT BIT(1 << 0) > +#define TXREQ_FLAGS_IOVEC_LAST_PKT BIT(1 << 0) > It is wrong. It actually creates 0x2 instead of 0x1. > -#define SDMA_PKT_Q_INACTIVE (1 << 0) > -#define SDMA_PKT_Q_ACTIVE (1 << 1) > -#define SDMA_PKT_Q_DEFERRED (1 << 2) > +#define SDMA_PKT_Q_INACTIVE BIT(1 << 0) > +#define SDMA_PKT_Q_ACTIVE BIT(1 << 1) > +#define SDMA_PKT_Q_DEFERRED BIT(1 << 2) The same comment as above. It is wrong. ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: most: Delete an unnecessary check before the function call "module_put"
From: Markus Elfring Date: Thu, 5 Nov 2015 14:34:43 +0100 The module_put() function tests whether its argument is NULL and then returns immediately. Thus the test around the call is not needed. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring --- drivers/staging/most/mostcore/core.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/staging/most/mostcore/core.c b/drivers/staging/most/mostcore/core.c index 19852ca..ed1ed25 100644 --- a/drivers/staging/most/mostcore/core.c +++ b/drivers/staging/most/mostcore/core.c @@ -1587,8 +1587,7 @@ out: return 0; error: - if (iface->mod) - module_put(iface->mod); + module_put(iface->mod); modref--; mutex_unlock(&c->start_mutex); return ret; -- 2.6.2 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging: most: Delete an unnecessary check before the function call "module_put"
Relying on hidden sanity checks makes the code harder to read. A human being cannot remember which functions have sanity checks and which do not. These sorts of patches are easy to generate automatically but they make the code worse. There are so many *better* things to do instead of focusing on making the code bad. Please stop sending these patches for drivers/staging. You are welcome to send them for other subsystems which I don't care about. regards, dan carpenter ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: staging: most: Delete an unnecessary check before the function call "module_put"
> Please stop sending these patches for drivers/staging. Will further contributors take another look at similar update suggestions? > You are welcome to send them for other subsystems Thanks for this suggestion. > which I don't care about. I am curious if other software developers will give more positive feedback on the proposed source code fine-tuning because of collateral evolution. Regards, Markus ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] Staging: fwserial: Declare fwtty_port_put as static
Declare the function fwtty_port_put as static since it is used only in this particular file. Also remove the corresponding declaration from header file. Signed-off-by: Shraddha Barke --- drivers/staging/fwserial/fwserial.c | 3 +-- drivers/staging/fwserial/fwserial.h | 2 -- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/staging/fwserial/fwserial.c b/drivers/staging/fwserial/fwserial.c index b3ea4bb..b676c48 100644 --- a/drivers/staging/fwserial/fwserial.c +++ b/drivers/staging/fwserial/fwserial.c @@ -893,11 +893,10 @@ static void fwserial_destroy(struct kref *kref) kfree(serial); } -void fwtty_port_put(struct fwtty_port *port) +static void fwtty_port_put(struct fwtty_port *port) { kref_put(&port->serial->kref, fwserial_destroy); } -EXPORT_SYMBOL(fwtty_port_put); static void fwtty_port_dtr_rts(struct tty_port *tty_port, int on) { diff --git a/drivers/staging/fwserial/fwserial.h b/drivers/staging/fwserial/fwserial.h index 8d791ae..e13fe33 100644 --- a/drivers/staging/fwserial/fwserial.h +++ b/drivers/staging/fwserial/fwserial.h @@ -342,8 +342,6 @@ static const char loop_dev_name[] = "fwloop"; extern struct tty_driver *fwtty_driver; struct fwtty_port *fwtty_port_get(unsigned index); -void fwtty_port_put(struct fwtty_port *port); - /* * Returns the max send async payload size in bytes based on the unit device * link speed. Self-limiting asynchronous bandwidth (via reducing the payload) -- 2.1.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
RE: [PATCH 1/1] staging: rdma: hfi1 : Prefer using the BIT macro
> Subject: [PATCH 1/1] staging: rdma: hfi1 : Prefer using the BIT macro > > This patch replaces bit shifting on 1 with the BIT(x) macro > > Signed-off-by: Sunny Kumar > --- Nak. The patch leaves the shift in. Mike ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging/rdma/hfi1: Convert dd_dev_info() to hfi1_cdbg() in process startup
On Thu, Nov 05, 2015 at 10:58:36AM +0300, Dan Carpenter wrote: On Wed, Nov 04, 2015 at 11:14:57PM -0500, jubin.j...@intel.com wrote: From: Sebastian Sanchez Replacing dd_dev_info() for hfi1_cdbg() to avoid generating syslog output for every context that is open by PSM. Just delete it... People get scared about deleting debug code but you can add it back if there is really a bug. /me chants, "delete. delete. delete." I would tend to agree with that, but in this case we want to keep a way to get this information without making code changes. We just don't want it to spew to the console/syslog all the time. Instead we are using the trace mechanism which lets the user selectively turn on the messages when needed. Perhaps we should expand on the commit message to make this more clear? -Denny ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging/rdma/hfi1: Convert dd_dev_info() to hfi1_cdbg() in process startup
On Thu, Nov 05, 2015 at 09:51:20AM -0500, Dennis Dalessandro wrote: > >/me chants, "delete. delete. delete." > > I would tend to agree with that, but in this case we want to keep a > way to get this information without making code changes. We just > don't want it to spew to the console/syslog all the time. Instead we > are using the trace mechanism which lets the user selectively turn > on the messages when needed. > > Perhaps we should expand on the commit message to make this more clear? > No no. It's fine. So long as you aren't just keeping it around because you are afraid to delete things. regards, dan carpenter ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 3/3] comedi: driver: Fix - BIT macro used coding style issue
BIT macro is used for defining bit location instead of shifting operator - coding style issue Signed-off-by: Ranjith T --- drivers/staging/comedi/drivers/pcmmio.c | 42 +++ 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/drivers/staging/comedi/drivers/pcmmio.c b/drivers/staging/comedi/drivers/pcmmio.c index 10472e6..807795c 100644 --- a/drivers/staging/comedi/drivers/pcmmio.c +++ b/drivers/staging/comedi/drivers/pcmmio.c @@ -84,25 +84,25 @@ #define PCMMIO_AI_LSB_REG 0x00 #define PCMMIO_AI_MSB_REG 0x01 #define PCMMIO_AI_CMD_REG 0x02 -#define PCMMIO_AI_CMD_SE (1 << 7) -#define PCMMIO_AI_CMD_ODD_CHAN (1 << 6) +#define PCMMIO_AI_CMD_SE BIT(7) +#define PCMMIO_AI_CMD_ODD_CHAN BIT(6) #define PCMMIO_AI_CMD_CHAN_SEL(x) (((x) & 0x3) << 4) #define PCMMIO_AI_CMD_RANGE(x) (((x) & 0x3) << 2) #define PCMMIO_RESOURCE_REG0x02 #define PCMMIO_RESOURCE_IRQ(x) (((x) & 0xf) << 0) #define PCMMIO_AI_STATUS_REG 0x03 -#define PCMMIO_AI_STATUS_DATA_READY(1 << 7) -#define PCMMIO_AI_STATUS_DATA_DMA_PEND (1 << 6) -#define PCMMIO_AI_STATUS_CMD_DMA_PEND (1 << 5) -#define PCMMIO_AI_STATUS_IRQ_PEND (1 << 4) -#define PCMMIO_AI_STATUS_DATA_DRQ_ENA (1 << 2) -#define PCMMIO_AI_STATUS_REG_SEL (1 << 3) -#define PCMMIO_AI_STATUS_CMD_DRQ_ENA (1 << 1) -#define PCMMIO_AI_STATUS_IRQ_ENA (1 << 0) +#define PCMMIO_AI_STATUS_DATA_READYBIT(7) +#define PCMMIO_AI_STATUS_DATA_DMA_PEND BIT(6) +#define PCMMIO_AI_STATUS_CMD_DMA_PEND BIT(5) +#define PCMMIO_AI_STATUS_IRQ_PEND BIT(4) +#define PCMMIO_AI_STATUS_DATA_DRQ_ENA BIT(2) +#define PCMMIO_AI_STATUS_REG_SEL BIT(3) +#define PCMMIO_AI_STATUS_CMD_DRQ_ENA BIT(1) +#define PCMMIO_AI_STATUS_IRQ_ENA BIT(0) #define PCMMIO_AI_RES_ENA_REG 0x03 -#define PCMMIO_AI_RES_ENA_CMD_REG_ACCESS (0 << 3) -#define PCMMIO_AI_RES_ENA_AI_RES_ACCESS(1 << 3) -#define PCMMIO_AI_RES_ENA_DIO_RES_ACCESS (1 << 4) +#define PCMMIO_AI_RES_ENA_CMD_REG_ACCESS 0 +#define PCMMIO_AI_RES_ENA_AI_RES_ACCESSBIT(3) +#define PCMMIO_AI_RES_ENA_DIO_RES_ACCESS BIT(4) #define PCMMIO_AI_2ND_ADC_OFFSET 0x04 #define PCMMIO_AO_LSB_REG 0x08 @@ -125,14 +125,14 @@ #define PCMMIO_AO_CMD_CHAN_SEL(x) (((x) & 0x03) << 1) #define PCMMIO_AO_CMD_CHAN_SEL_ALL (0x0f << 0) #define PCMMIO_AO_STATUS_REG 0x0b -#define PCMMIO_AO_STATUS_DATA_READY(1 << 7) -#define PCMMIO_AO_STATUS_DATA_DMA_PEND (1 << 6) -#define PCMMIO_AO_STATUS_CMD_DMA_PEND (1 << 5) -#define PCMMIO_AO_STATUS_IRQ_PEND (1 << 4) -#define PCMMIO_AO_STATUS_DATA_DRQ_ENA (1 << 2) -#define PCMMIO_AO_STATUS_REG_SEL (1 << 3) -#define PCMMIO_AO_STATUS_CMD_DRQ_ENA (1 << 1) -#define PCMMIO_AO_STATUS_IRQ_ENA (1 << 0) +#define PCMMIO_AO_STATUS_DATA_READYBIT(7) +#define PCMMIO_AO_STATUS_DATA_DMA_PEND BIT(6) +#define PCMMIO_AO_STATUS_CMD_DMA_PEND BIT(5) +#define PCMMIO_AO_STATUS_IRQ_PEND BIT(4) +#define PCMMIO_AO_STATUS_DATA_DRQ_ENA BIT(2) +#define PCMMIO_AO_STATUS_REG_SEL BIT(3) +#define PCMMIO_AO_STATUS_CMD_DRQ_ENA BIT(1) +#define PCMMIO_AO_STATUS_IRQ_ENA BIT(0) #define PCMMIO_AO_RESOURCE_ENA_REG 0x0b #define PCMMIO_AO_2ND_DAC_OFFSET 0x04 -- 1.7.10.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging/rdma/hfi1: set Gen3 half-swing for integrated devices
On Thu, Nov 05, 2015 at 10:34:48AM +0300, Dan Carpenter wrote: > On Wed, Nov 04, 2015 at 09:06:08PM -0500, ira.we...@intel.com wrote: > > > +#define CCE_PCIE_CTRL_XMT_MARGIN_GEN1_GEN2_OVERWRITE_ENABLE_MASK 0x1ull > > There is absolutely no point to having a variable name which is nine > bajillion characters long since we are not able to use it and have to > instead use macro majic to hide the first twelve zillion characters. > The long names are directly from the hardware specification. > > If > we can't even see the name when it is used, then why does it exist? Also > macro magic breaks grep and cscope. Just think of a better name to > begin with and get rid of the PC macro. We did not want the PC macro but using the "real" names caused checkpatch failures. Indeed using the PC macro reduces the readability of the code in terms of following the hardware spec because we lose the "real" name. Is this an example where we should ignore the line lengths of checkpatch to preserve the readability of the code? Thanks, Ira ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 3/3] staging/rdma/hfi1: Method to toggle "fast ECN" detection
On Thu, Nov 05, 2015 at 10:56:27AM +0300, Dan Carpenter wrote: > On Wed, Nov 04, 2015 at 09:10:11PM -0500, ira.we...@intel.com wrote: > > From: Vennila Megavannan > > > > Add a module paramter to toggle prescan/Fast ECN Detection. > > > > In addition change the PRESCAN_RXQ Kconfig default to "yes". > > > > Reviewed-by: Arthur Kepner > > Reviewed-by: Mike Marciniszyn > > Signed-off-by: Vennila Megavannan > > Signed-off-by: Ira Weiny > > Hm... In the original code we had the config entry but the code to > support this was actually disabled. Now we are turning on the config > entry by default but the module parameter defaults to disabled. I think > the documentation is a bit tricky because it should say that actually > enabling the config is not enough, it's still disabled. We tried to make it clear but obviously missed the mark. > > Do we really need the config to be there? Distros are going to enable it. > Who is it who wants to disable the config? The config is maintained to be able to fully remove the code to obtain the maximum receive performance _if_ the customer knows that they will never need the prescanning. This is the _ultimate_ in performance on this path. We anticipate some HPC customers who build their own kernels may want this option. > > Also is it better to > default to off or on for this code, what are the upsides and downsides > of that choice? > I'll update the commit message. But will also explain here. Enabling the code with the config option introduces a _slight_ performance impact but allows the user to determine if this congestion control fix should be active or not at run time. You are correct that most distros will enable the config options (default Yes). Therefore this becomes a system admin control item for the fabric being configured. After testing we found that this was the best compromise for most systems in terms of performance and flexibility. This is because prescanning is not required most of the time. Should a customer find that their topology and/or workload requires prescanning they can then enable this option at run time. This will result in a significant reduction of performance at the node level but may for those customers result in better overall fabric/cluster performance. So in conclusion we have 3 performance levels and the combination in this patch puts us at the "middle one". Thanks, Ira ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 1/1] staging: rdma: hfi1 : Prefer using the BIT macro
On Thu, Nov 05, 2015 at 05:28:03PM +0530, Sunny Kumar wrote: > This patch replaces bit shifting on 1 with the BIT(x) macro > > Signed-off-by: Sunny Kumar Also, NAK as has been covered in other responses. However, I wanted to add, similar to the hfi1_ioctl fix, we have follow on checkpatch patches which address this. Ira > --- > drivers/staging/rdma/hfi1/user_sdma.c | 10 +- > 1 file changed, 5 insertions(+), 5 deletions(-) > > diff --git a/drivers/staging/rdma/hfi1/user_sdma.c > b/drivers/staging/rdma/hfi1/user_sdma.c > index 36c838d..95a6d99 100644 > --- a/drivers/staging/rdma/hfi1/user_sdma.c > +++ b/drivers/staging/rdma/hfi1/user_sdma.c > @@ -146,8 +146,8 @@ MODULE_PARM_DESC(sdma_comp_size, "Size of User SDMA > completion ring. Default: 12 > #define KDETH_OM_MAX_SIZE (1 << ((KDETH_OM_LARGE / KDETH_OM_SMALL) + 1)) > > /* Last packet in the request */ > -#define TXREQ_FLAGS_REQ_LAST_PKT (1 << 0) > -#define TXREQ_FLAGS_IOVEC_LAST_PKT (1 << 0) > +#define TXREQ_FLAGS_REQ_LAST_PKT BIT(1 << 0) > +#define TXREQ_FLAGS_IOVEC_LAST_PKT BIT(1 << 0) > > #define SDMA_REQ_IN_USE 0 > #define SDMA_REQ_FOR_THREAD 1 > @@ -156,9 +156,9 @@ MODULE_PARM_DESC(sdma_comp_size, "Size of User SDMA > completion ring. Default: 12 > #define SDMA_REQ_HAS_ERROR 4 > #define SDMA_REQ_DONE_ERROR 5 > > -#define SDMA_PKT_Q_INACTIVE (1 << 0) > -#define SDMA_PKT_Q_ACTIVE (1 << 1) > -#define SDMA_PKT_Q_DEFERRED (1 << 2) > +#define SDMA_PKT_Q_INACTIVE BIT(1 << 0) > +#define SDMA_PKT_Q_ACTIVE BIT(1 << 1) > +#define SDMA_PKT_Q_DEFERRED BIT(1 << 2) > > /* > * Maximum retry attempts to submit a TX request > -- > 2.1.4 > > ___ > devel mailing list > de...@linuxdriverproject.org > http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
RE: [PATCH 19/22] staging: comedi: adv_pci1710: fix counter 0 internal clock source
On Thursday, November 05, 2015 6:17 AM, Ian Abbott wrote: > On 04/11/15 16:55, H Hartley Sweeten wrote: >> Counters 1 and 2 of the 8254 are cascaeded to create the 32-bit timer >> used for the analog input pacer trigger. The base clock to these counters >> is 10 MHz. >> >> Counter 0 is available to the user for general purpose use. This counter >> can use either an internal 1 MHz clock or an external clock. The >> (*insn_config) for the counter subdevice provides support for >> INSN_CONFIG_{SET,GET}_CLOCK_SRC to allow the user to select the >> clock source to use. Fix the INSN_CONFIG_GET_CLOCK_SRC so it returns >> the correct speed of the internal clock. >> >> Signed-off-by: H Hartley Sweeten >> Cc: Ian Abbott >> Cc: Greg Kroah-Hartman >> --- >> drivers/staging/comedi/drivers/adv_pci1710.c | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/drivers/staging/comedi/drivers/adv_pci1710.c >> b/drivers/staging/comedi/drivers/adv_pci1710.c >> index c5f8bff..9e45f3d 100644 >> --- a/drivers/staging/comedi/drivers/adv_pci1710.c >> +++ b/drivers/staging/comedi/drivers/adv_pci1710.c >> @@ -701,7 +701,7 @@ static int pci1710_counter_insn_config(struct >> comedi_device *dev, >> data[2] = 0; >> } else { >> data[1] = 0; >> -data[2] = I8254_OSC_BASE_10MHZ; >> +data[2] = I8254_OSC_BASE_1MHZ; >> } >> break; >> default: >> > > The manual I have says it's 1 MHz for PCI-1711/1711L/1716/1716L, > and 100 kHz for PCI-1710/1710L/1710HG/1710HGL. The data I have is a bit different. The PCI-1710/1710HG User's manual I have has some issues The Specifications say: Channel 1: 10 MHz Channel 2: Takes input from output of channel 1 Channel 0: Internal 1 MHz or external clock (10 MHz max) The Block Diagram also show a 1 MHz internal clock (10 MHz / 10) or an external clock (CNT0_CLK pin). The I/O connector description says this about the CNT0_CLK pin. "Counter 0 Clock Input. This pin is the external clock input of counter 0. The clock input of counter 0 can be either external (up to 10 MHz) or Internal (100 kHz), as set up software." The Trigger Source Connections says that all three counters are connected to a 1 MHz clock. The Control Register description says that: "CNT0 Counter 0 clock source select bit 0 means that the clock source of Counter 0 comes from the internal clock (100 kHz), and 1 means that the clock source of Counter 0 comes from the external clock (maximum up to 10 MHz)." The "A.1 The Intel 82C54" appendix says: "The 82C54 has a maximum input clock frequency of 1 MHz. The PCI-1710/ 1710HG provides 1 MHz input frequencies to the counter chip from an on-board oscillator." The PCI-1711/1731 manual I have is a bit better. The block diagram, I/O Connector and CNT0 description all have a 1 MHz internal clock. I think the manuals are a bit messed up. The 82C54 datasheet says that the Chip can handle clock inputs up to 10 MHz. A 10 MHz base clock to the cascaded counters is pretty typical for DAQ cards and a 1 MHz clock to the user counter seems a bit more useful than a 100 kHz clock. Hartley ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging/rdma/hfi1: set Gen3 half-swing for integrated devices
On Thu, Nov 05, 2015 at 11:41:23AM -0500, ira.weiny wrote: > Is this an example where we should ignore the line lengths of checkpatch to > preserve the readability of the code? Honestly, you can't fight checkpatch, especially in staging. Rejecting patches is a drain on your emotions and your energy. We accept all checkpatch fixes if they are half way decent. Maybe just put a comment in the header about the full hardware name? This patch breaks cscope and we don't end up actually using the hardware name in the end... regards, dan carpenter ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
RE: [PATCH 15/22] staging: comedi: adv_pci1710: tidy up analog output subdev_flags
On Thursday, November 05, 2015 6:01 AM, Ian Abbott wrote: > On 04/11/15 16:55, H Hartley Sweeten wrote: >> The SDF_GROUND and SDF_COMMON flags are not needed for the analog output >> subdevice. Just remove them. >> >> Signed-off-by: H Hartley Sweeten >> Cc: Ian Abbott >> Cc: Greg Kroah-Hartman >> --- >> drivers/staging/comedi/drivers/adv_pci1710.c | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/drivers/staging/comedi/drivers/adv_pci1710.c >> b/drivers/staging/comedi/drivers/adv_pci1710.c >> index 339130b..0511f26 100644 >> --- a/drivers/staging/comedi/drivers/adv_pci1710.c >> +++ b/drivers/staging/comedi/drivers/adv_pci1710.c >> @@ -817,7 +817,7 @@ static int pci1710_auto_attach(struct comedi_device *dev, >> if (board->has_ao) { >> s = &dev->subdevices[subdev]; >> s->type = COMEDI_SUBD_AO; >> -s->subdev_flags = SDF_WRITABLE | SDF_GROUND | SDF_COMMON; >> +s->subdev_flags = SDF_WRITABLE; >> s->n_chan = 2; >> s->maxdata = 0x0fff; >> s->range_table = &pci171x_ao_range; >> > > The signal connector has separate pins for AIGND, AOGND and DGND, > although ultimately they are referenced to the same voltage. I'd just > leave the SDF_GROUND and SDF_COMMON flags set, same as for the analog > input subdevice. They just don't make any sense here. The SDF_* aref flags are used with the analog input subdevices to specify which AREF_* options are supported. The AREF_* options are then used to program the hardware for the desired analog aref. The connector does have the separate pins for the analog input, analog output and digital grounds but, like you said, they all go to a common reference. The user might specify a AREF_* selection but it doesn't actually do anything. If the analog aref is not programmable I think it's a bit overkill to specify the SDF_* aref in the subdev_flags. If anything just the SDF_GROUND should be specified which is the default aref (AREF_GROUND = 0x00). For the analog inputs, the user's manual for the PCI-1710/1710HG show a couple wiring options 1) Single-ended (AI[x] to AIGND) 2) Differential - ground reference (AI[x] to AI[x+1]. AI[x+1] to GND) 3) Differential - AIGND reference (AI[x] to AI[x+1]. pull-down resistors to AIGND) Again, these are wiring options not programmable options. I feel that the subdev_flags should either not specify an SDF_* aref option or just specify the SDF_GROUND option. Hartley ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
RE: [PATCH 14/22] staging: comedi: adv_pci1710: support external analog output reference
On Thursday, November 05, 2015 5:43 AM, Ian Abbott wrote: > On 04/11/15 16:55, H Hartley Sweeten wrote: >> The analog outputs can use an external reference to create the D/A output >> range. Add an entry to the comedi_lrange table for it and modify the >> (*insn_write) to support it. >> >> Signed-off-by: H Hartley Sweeten >> Cc: Ian Abbott >> Cc: Greg Kroah-Hartman >> --- >> drivers/staging/comedi/drivers/adv_pci1710.c | 13 - >> 1 file changed, 8 insertions(+), 5 deletions(-) >> >> diff --git a/drivers/staging/comedi/drivers/adv_pci1710.c >> b/drivers/staging/comedi/drivers/adv_pci1710.c >> index 86ed288..339130b 100644 >> --- a/drivers/staging/comedi/drivers/adv_pci1710.c >> +++ b/drivers/staging/comedi/drivers/adv_pci1710.c >> @@ -65,6 +65,8 @@ >> #define PCI171X_CLRFIFO_REG0x09/* W: clear FIFO */ >> #define PCI171X_DA_REG(x) (0x0a + ((x) * 2)) /* W: D/A register */ >> #define PCI171X_DAREF_REG 0x0e/* W: D/A reference control */ >> +#define PCI171X_DAREF(c, r) (((r) & 0x3) << ((c) * 2)) >> +#define PCI171X_DAREF_MASK(c) PCI171X_DAREF((c), 0x3) >> #define PCI171X_DI_REG 0x10/* R: digital inputs */ >> #define PCI171X_DO_REG 0x10/* W: digital outputs */ >> #define PCI171X_TIMER_BASE 0x18/* R/W: 8254 timer */ >> @@ -111,9 +113,10 @@ static const struct comedi_lrange pci1711_ai_range = { >> }; >> >> static const struct comedi_lrange pci171x_ao_range = { >> -2, { >> -UNI_RANGE(5), >> -UNI_RANGE(10) >> +3, { >> +UNI_RANGE(5), /* internal -5V ref */ >> +UNI_RANGE(10), /* internal -10V ref */ >> +RANGE_ext(0, 1) /* external Vref (+/-10V max) */ > > Minor niggle: > > The comment for the external Vref is slightly confusing. The manual I > have says: > > By inputting an external reference voltage: -xV , where |x| <= 10, > you will get a output voltage range: 0 to xV. > > So the external reference voltage is never positive. How about this?: > > /* external -xV ref, |x| <= 10 */ Again it appears we have different manuals. Mine says: "The PCI-1710/1710HG card provides two D/A output channels, DA0_OUT and DA1_OUT. Users may use the PCI-1710/1710HG internally provided precision -5V (-10V) reference to generate 0 to +5V (+10V) D/A output range. Users also my create D/A output range through external references, DA0_REF and DA1_REF. The maximum reference input range is +/-10V. Connecting with an external reference of -7V will generate 0 to +7V DA output." The drawing then shows DA0 using a positive external reference voltage and DA1 using a negative reference voltage. The specifications state the output range with external reference as: 0 ~ +xV @ -xV (-10 <= x <= 10) Hartley ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: lustre: lnet: selftest: Move extern declarations to headers
This patch moves extern declarations to respective header files. This patch also removes extern keyword from function declarations since functions have the extern specifier by default. Signed-off-by: Amitoj Kaur Chawla --- drivers/staging/lustre/lnet/selftest/console.c | 4 drivers/staging/lustre/lnet/selftest/console.h | 2 ++ drivers/staging/lustre/lnet/selftest/framework.c | 11 --- drivers/staging/lustre/lnet/selftest/module.c| 3 --- drivers/staging/lustre/lnet/selftest/selftest.h | 13 + 5 files changed, 15 insertions(+), 18 deletions(-) diff --git a/drivers/staging/lustre/lnet/selftest/console.c b/drivers/staging/lustre/lnet/selftest/console.c index 024aaee..ab9906f 100644 --- a/drivers/staging/lustre/lnet/selftest/console.c +++ b/drivers/staging/lustre/lnet/selftest/console.c @@ -1698,8 +1698,6 @@ lstcon_new_session_id(lst_sid_t *sid) sid->ses_stamp = cfs_time_current(); } -extern srpc_service_t lstcon_acceptor_service; - int lstcon_session_new(char *name, int key, unsigned feats, int timeout, int force, lst_sid_t *sid_up) @@ -1984,8 +1982,6 @@ static void lstcon_init_acceptor_service(void) lstcon_acceptor_service.sv_wi_total = SFW_FRWK_WI_MAX; } -extern int lstcon_ioctl_entry(unsigned int cmd, struct libcfs_ioctl_data *data); - static DECLARE_IOCTL_HANDLER(lstcon_ioctl_handler, lstcon_ioctl_entry); /* initialize console */ diff --git a/drivers/staging/lustre/lnet/selftest/console.h b/drivers/staging/lustre/lnet/selftest/console.h index acd1312..fe1974a 100644 --- a/drivers/staging/lustre/lnet/selftest/console.h +++ b/drivers/staging/lustre/lnet/selftest/console.h @@ -169,6 +169,8 @@ typedef struct { } lstcon_session_t; /* session descriptor */ extern lstcon_session_t console_session; +extern srpc_service_t lstcon_acceptor_service; +int lstcon_ioctl_entry(unsigned int cmd, struct libcfs_ioctl_data *data); static inline lstcon_trans_stat_t * lstcon_trans_stat(void) diff --git a/drivers/staging/lustre/lnet/selftest/framework.c b/drivers/staging/lustre/lnet/selftest/framework.c index 177beaf..34072d0 100644 --- a/drivers/staging/lustre/lnet/selftest/framework.c +++ b/drivers/staging/lustre/lnet/selftest/framework.c @@ -1623,17 +1623,6 @@ static srpc_service_t sfw_services[] = { } }; -extern sfw_test_client_ops_t ping_test_client; -extern srpc_service_t ping_test_service; -extern void ping_init_test_client(void); -extern void ping_init_test_service(void); - -extern sfw_test_client_ops_t brw_test_client; -extern srpc_service_t brw_test_service; -extern void brw_init_test_client(void); -extern void brw_init_test_service(void); - - int sfw_startup(void) { diff --git a/drivers/staging/lustre/lnet/selftest/module.c b/drivers/staging/lustre/lnet/selftest/module.c index 09b8f46..c2a8ee5 100644 --- a/drivers/staging/lustre/lnet/selftest/module.c +++ b/drivers/staging/lustre/lnet/selftest/module.c @@ -47,9 +47,6 @@ enum { LST_INIT_CONSOLE }; -extern int lstcon_console_init(void); -extern int lstcon_console_fini(void); - static int lst_init_step = LST_INIT_NONE; struct cfs_wi_sched *lst_sched_serial; diff --git a/drivers/staging/lustre/lnet/selftest/selftest.h b/drivers/staging/lustre/lnet/selftest/selftest.h index 4832253..7e6a234 100644 --- a/drivers/staging/lustre/lnet/selftest/selftest.h +++ b/drivers/staging/lustre/lnet/selftest/selftest.h @@ -452,6 +452,19 @@ void srpc_service_remove_buffers(srpc_service_t *sv, int nbuffer); void srpc_get_counters(srpc_counters_t *cnt); void srpc_set_counters(const srpc_counters_t *cnt); +int lstcon_console_init(void); +int lstcon_console_fini(void); + +extern sfw_test_client_ops_t ping_test_client; +extern srpc_service_t ping_test_service; +void ping_init_test_client(void); +void ping_init_test_service(void); + +extern sfw_test_client_ops_t brw_test_client; +extern srpc_service_t brw_test_service; +void brw_init_test_client(void); +void brw_init_test_service(void); + extern struct cfs_wi_sched *lst_sched_serial; extern struct cfs_wi_sched **lst_sched_test; -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging/rdma/hfi1: Disable thermal polling before sensor initialization
> This should be "Jareer Abdel-Qader ". ok. Will fix in V2. Thanks, Jubin John ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2] staging/rdma/hfi1: Disable thermal polling before sensor initialization
From: Jareer Abdel-Qader During driver load the thermal sensor needs to be reset prior to initialization of the sensor. This prevents a possible sensor lock up which can cause the wrong temperature value to be reported. This fix leads to remove disabling thermal polling from reset_asic_csrs() function. Reviewed by: Dennis Dalessandro Reviewed by: Easwar Hariharan Signed-off-by: Jareer Abdel-Qader Signed-off-by: Ira Weiny Signed-off-by: Jubin John --- Changes in v2: - Fixed author name format drivers/staging/rdma/hfi1/chip.c |6 -- 1 files changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/staging/rdma/hfi1/chip.c b/drivers/staging/rdma/hfi1/chip.c index e489819..e1951f4 100644 --- a/drivers/staging/rdma/hfi1/chip.c +++ b/drivers/staging/rdma/hfi1/chip.c @@ -9455,7 +9455,7 @@ static void reset_asic_csrs(struct hfi1_devdata *dd) /* We might want to retain this state across FLR if we ever use it */ write_csr(dd, ASIC_CFG_DRV_STR, 0); - write_csr(dd, ASIC_CFG_THERM_POLL_EN, 0); + /* ASIC_CFG_THERM_POLL_EN leave alone */ /* ASIC_STS_THERM read-only */ /* ASIC_CFG_RESET leave alone */ @@ -10803,7 +10803,9 @@ static int thermal_init(struct hfi1_devdata *dd) acquire_hw_mutex(dd); dd_dev_info(dd, "Initializing thermal sensor\n"); - + /* Disable polling of thermal readings */ + write_csr(dd, ASIC_CFG_THERM_POLL_EN, 0x0); + msleep(100); /* Thermal Sensor Initialization */ /*Step 1: Reset the Thermal SBus Receiver */ ret = sbus_request_slow(dd, SBUS_THERMAL, 0x0, -- 1.7.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging/rdma/hfi1: Select only devices with active links
From: Dean Luick When looking for or validating a user device, only use devices that are currently active. Reviewed-by: Mitko Haralanov Signed-off-by: Dean Luick Signed-off-by: Jubin John --- drivers/staging/rdma/hfi1/file_ops.c | 21 ++--- 1 files changed, 18 insertions(+), 3 deletions(-) diff --git a/drivers/staging/rdma/hfi1/file_ops.c b/drivers/staging/rdma/hfi1/file_ops.c index aae9826..cd4c982 100644 --- a/drivers/staging/rdma/hfi1/file_ops.c +++ b/drivers/staging/rdma/hfi1/file_ops.c @@ -874,6 +874,14 @@ done: return ret; } +/* return true if the device available for general use */ +static int usable_device(struct hfi1_devdata *dd) +{ + struct hfi1_pportdata *ppd = dd->pport; + + return driver_lstate(ppd) == IB_PORT_ACTIVE; +} + static int get_user_context(struct file *fp, struct hfi1_user_info *uinfo, int devno, unsigned alg) { @@ -903,7 +911,11 @@ static int get_user_context(struct file *fp, struct hfi1_user_info *uinfo, for (dev = 0; dev < devmax; dev++) { pdd = hfi1_lookup(dev); - if (pdd && pdd->freectxts && + if (!pdd) + continue; + if (!usable_device(pdd)) + continue; + if (pdd->freectxts && pdd->freectxts > free) { dd = pdd; free = pdd->freectxts; @@ -912,7 +924,11 @@ static int get_user_context(struct file *fp, struct hfi1_user_info *uinfo, } else { for (dev = 0; dev < devmax; dev++) { pdd = hfi1_lookup(dev); - if (pdd && pdd->freectxts) { + if (!pdd) + continue; + if (!usable_device(pdd)) + continue; + if (pdd->freectxts) { dd = pdd; break; } @@ -936,7 +952,6 @@ static int find_shared_ctxt(struct file *fp, for (ndev = 0; ndev < devmax; ndev++) { struct hfi1_devdata *dd = hfi1_lookup(ndev); - /* device portion of usable() */ if (!(dd && (dd->flags & HFI1_PRESENT) && dd->kregbase)) continue; for (i = dd->first_user_ctxt; i < dd->num_rcv_contexts; i++) { -- 1.7.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging/rdma/hfi1: Fix for opaportconfig ledon by not checking for portNum
From: Sebastian Sanchez opaportconfig ledon fails with error message due to port number being checked in the attr modifier. This change removes the check for the port number in AttrMod, so the P field is ignored. Reviewed-by: Easwar Hariharan Signed-off-by: Sebastian Sanchez Signed-off-by: Jubin John --- drivers/staging/rdma/hfi1/mad.c |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/rdma/hfi1/mad.c b/drivers/staging/rdma/hfi1/mad.c index 32f7037..a122565 100644 --- a/drivers/staging/rdma/hfi1/mad.c +++ b/drivers/staging/rdma/hfi1/mad.c @@ -3458,7 +3458,7 @@ static int __subn_get_opa_led_info(struct opa_smp *smp, u32 am, u8 *data, u32 nport = OPA_AM_NPORT(am); u64 reg; - if (nport != 1 || OPA_AM_PORTNUM(am)) { + if (nport != 1) { smp->status |= IB_SMP_INVALID_FIELD; return reply((struct ib_mad_hdr *)smp); } @@ -3483,7 +3483,7 @@ static int __subn_set_opa_led_info(struct opa_smp *smp, u32 am, u8 *data, u32 nport = OPA_AM_NPORT(am); int on = !!(be32_to_cpu(p->rsvd_led_mask) & OPA_LED_MASK); - if (nport != 1 || OPA_AM_PORTNUM(am)) { + if (nport != 1) { smp->status |= IB_SMP_INVALID_FIELD; return reply((struct ib_mad_hdr *)smp); } -- 1.7.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging/rdma/hfi1: Remove spurious error messages
From: Ignacio Hernandez Changed the order in which diagnostics messages are printed, taking into account the cases where the errors are handled in rcv_hdrerr() and no further message is needed to report. Reviewed-by: Mark Debbage Reviewed-by: Arthur Kepner Reviewed-by: Mike Marciniszyn Signed-off-by: Ignacio Hernandez Signed-off-by: Jubin John --- drivers/staging/rdma/hfi1/driver.c | 26 +- 1 files changed, 13 insertions(+), 13 deletions(-) diff --git a/drivers/staging/rdma/hfi1/driver.c b/drivers/staging/rdma/hfi1/driver.c index ce69141..61fc626 100644 --- a/drivers/staging/rdma/hfi1/driver.c +++ b/drivers/staging/rdma/hfi1/driver.c @@ -1163,20 +1163,20 @@ void handle_eflags(struct hfi1_packet *packet) struct hfi1_ctxtdata *rcd = packet->rcd; u32 rte = rhf_rcv_type_err(packet->rhf); - dd_dev_err(rcd->dd, - "receive context %d: rhf 0x%016llx, errs [ %s%s%s%s%s%s%s%s] rte 0x%x\n", - rcd->ctxt, packet->rhf, - packet->rhf & RHF_K_HDR_LEN_ERR ? "k_hdr_len " : "", - packet->rhf & RHF_DC_UNC_ERR ? "dc_unc " : "", - packet->rhf & RHF_DC_ERR ? "dc " : "", - packet->rhf & RHF_TID_ERR ? "tid " : "", - packet->rhf & RHF_LEN_ERR ? "len " : "", - packet->rhf & RHF_ECC_ERR ? "ecc " : "", - packet->rhf & RHF_VCRC_ERR ? "vcrc " : "", - packet->rhf & RHF_ICRC_ERR ? "icrc " : "", - rte); - rcv_hdrerr(rcd, rcd->ppd, packet); + if (rhf_err_flags(packet->rhf)) + dd_dev_err(rcd->dd, + "receive context %d: rhf 0x%016llx, errs [ %s%s%s%s%s%s%s%s] rte 0x%x\n", + rcd->ctxt, packet->rhf, + packet->rhf & RHF_K_HDR_LEN_ERR ? "k_hdr_len " : "", + packet->rhf & RHF_DC_UNC_ERR ? "dc_unc " : "", + packet->rhf & RHF_DC_ERR ? "dc " : "", + packet->rhf & RHF_TID_ERR ? "tid " : "", + packet->rhf & RHF_LEN_ERR ? "len " : "", + packet->rhf & RHF_ECC_ERR ? "ecc " : "", + packet->rhf & RHF_VCRC_ERR ? "vcrc " : "", + packet->rhf & RHF_ICRC_ERR ? "icrc " : "", + rte); } /* -- 1.7.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging/rdma/hfi1: use one-shot LCB write
From: Dean Luick Use the one-shot LCB write implemented in the 8051 firmware. This speeds up 8051 LCB writes by 2x. Use old method for older firmwares. Reviewed-by: Dennis Dalessandro Signed-off-by: Dean Luick Signed-off-by: Jubin John --- drivers/staging/rdma/hfi1/chip.c | 42 + drivers/staging/rdma/hfi1/chip.h |1 + 2 files changed, 38 insertions(+), 5 deletions(-) diff --git a/drivers/staging/rdma/hfi1/chip.c b/drivers/staging/rdma/hfi1/chip.c index e489819..89315d5 100644 --- a/drivers/staging/rdma/hfi1/chip.c +++ b/drivers/staging/rdma/hfi1/chip.c @@ -4774,13 +4774,25 @@ int read_lcb_csr(struct hfi1_devdata *dd, u32 addr, u64 *data) */ static int write_lcb_via_8051(struct hfi1_devdata *dd, u32 addr, u64 data) { + u32 regno; + int ret; - if (acquire_lcb_access(dd, 0) == 0) { - write_csr(dd, addr, data); - release_lcb_access(dd, 0); - return 0; + if (dd->icode == ICODE_FUNCTIONAL_SIMULATOR || + (dd->dc8051_ver < dc8051_ver(0, 20))) { + if (acquire_lcb_access(dd, 0) == 0) { + write_csr(dd, addr, data); + release_lcb_access(dd, 0); + return 0; + } + return -EBUSY; } - return -EBUSY; + + /* register is an index of LCB registers: (offset - base) / 8 */ + regno = (addr - DC_LCB_CFG_RUN) >> 3; + ret = do_8051_command(dd, HCMD_WRITE_LCB_CSR, regno, &data); + if (ret != HCMD_SUCCESS) + return -EBUSY; + return 0; } /* @@ -4862,6 +4874,26 @@ static int do_8051_command( */ /* +* When writing a LCB CSR, out_data contains the full value to +* to be written, while in_data contains the relative LCB +* address in 7:0. Do the work here, rather than the caller, +* of distrubting the write data to where it needs to go: +* +* Write data +* 39:00 -> in_data[47:8] +* 47:40 -> DC8051_CFG_EXT_DEV_0.RETURN_CODE +* 63:48 -> DC8051_CFG_EXT_DEV_0.RSP_DATA +*/ + if (type == HCMD_WRITE_LCB_CSR) { + in_data |= ((*out_data) & 0xffull) << 8; + reg = *out_data) >> 40) & 0xff) << + DC_DC8051_CFG_EXT_DEV_0_RETURN_CODE_SHIFT) + | *out_data) >> 48) & 0x) << + DC_DC8051_CFG_EXT_DEV_0_RSP_DATA_SHIFT); + write_csr(dd, DC_DC8051_CFG_EXT_DEV_0, reg); + } + + /* * Do two writes: the first to stabilize the type and req_data, the * second to activate. */ diff --git a/drivers/staging/rdma/hfi1/chip.h b/drivers/staging/rdma/hfi1/chip.h index ebf9041..d74aed8 100644 --- a/drivers/staging/rdma/hfi1/chip.h +++ b/drivers/staging/rdma/hfi1/chip.h @@ -235,6 +235,7 @@ #define HCMD_MISC 0x05 #define HCMD_READ_LCB_IDLE_MSG 0x06 #define HCMD_READ_LCB_CSR 0x07 +#define HCMD_WRITE_LCB_CSR 0x08 #define HCMD_INTERFACE_TEST 0xff /* DC_DC8051_CFG_HOST_CMD_1.RETURN_CODE - 8051 host command return */ -- 1.7.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging/rdma/hfi1: Eliminate WARN_ON when VL is invalid
From: Ira Weiny sdma_select_engine_vl only needs to protect itself from an invalid VL. Something higher up the stack should be warning the user when they try to use an SL which maps to an invalid VL. Reviewed-by: Dean Luick Reviewed-by: Mike Marciniszyn Reviewed-by: Kaike Wan Signed-off-by: Ira Weiny Signed-off-by: Jubin John --- drivers/staging/rdma/hfi1/sdma.c | 12 ++-- 1 files changed, 10 insertions(+), 2 deletions(-) diff --git a/drivers/staging/rdma/hfi1/sdma.c b/drivers/staging/rdma/hfi1/sdma.c index 2a1da21..998bf43 100644 --- a/drivers/staging/rdma/hfi1/sdma.c +++ b/drivers/staging/rdma/hfi1/sdma.c @@ -777,8 +777,14 @@ struct sdma_engine *sdma_select_engine_vl( struct sdma_map_elem *e; struct sdma_engine *rval; - if (WARN_ON(vl > 8)) - return NULL; + /* NOTE This should only happen if SC->VL changed after the initial +* checks on the QP/AH +* Default will return engine 0 below +*/ + if (unlikely(vl >= num_vls)) { + rval = NULL; + goto done; + } rcu_read_lock(); m = rcu_dereference(dd->sdma_map); @@ -790,6 +796,8 @@ struct sdma_engine *sdma_select_engine_vl( rval = e->sde[selector & e->mask]; rcu_read_unlock(); +done: + rval = !rval ? &dd->per_sdma[0] : rval; trace_hfi1_sdma_engine_select(dd, selector, vl, rval->this_idx); return rval; } -- 1.7.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging/rdma/hfi1: Workaround to prevent corruption during packet delivery
From: Mark F. Brown Disabling one receive context when RX_DMA is receiving a packet can cause incorrect packet delivery for a subsequent packet on another receive context. This is resolved by doing the following: 1. Programming dummy tail address for every receive context before enabling it 2. While deallocating receive context resetting tail address to dummy address 3. Leaving the dummy address in when disabling tail update 4. When disabling receive context leaving tail update enabled Reviewed-by: Dennis Dalessandro Reviewed-by: Mike Marciniszyn Reviewed-by: Mitko Haralanov Signed-off-by: Mark F. Brown Signed-off-by: Jubin John --- drivers/staging/rdma/hfi1/chip.c | 18 +++--- drivers/staging/rdma/hfi1/hfi.h |4 drivers/staging/rdma/hfi1/init.c | 28 3 files changed, 47 insertions(+), 3 deletions(-) diff --git a/drivers/staging/rdma/hfi1/chip.c b/drivers/staging/rdma/hfi1/chip.c index e489819..3c3ba52 100644 --- a/drivers/staging/rdma/hfi1/chip.c +++ b/drivers/staging/rdma/hfi1/chip.c @@ -7753,6 +7753,17 @@ void hfi1_rcvctrl(struct hfi1_devdata *dd, unsigned int op, int ctxt) } if (op & HFI1_RCVCTRL_CTXT_DIS) { write_csr(dd, RCV_VL15, 0); + /* +* When receive context is being disabled turn on tail +* update with a dummy tail address and then disable +* receive context. +*/ + if (dd->rcvhdrtail_dummy_physaddr) { + write_kctxt_csr(dd, ctxt, RCV_HDR_TAIL_ADDR, + dd->rcvhdrtail_dummy_physaddr); + rcvctrl |= RCV_CTXT_CTRL_TAIL_UPD_SMASK; + } + rcvctrl &= ~RCV_CTXT_CTRL_ENABLE_SMASK; } if (op & HFI1_RCVCTRL_INTRAVAIL_ENB) @@ -7822,10 +7833,11 @@ void hfi1_rcvctrl(struct hfi1_devdata *dd, unsigned int op, int ctxt) if (op & (HFI1_RCVCTRL_TAILUPD_DIS | HFI1_RCVCTRL_CTXT_DIS)) /* * If the context has been disabled and the Tail Update has -* been cleared, clear the RCV_HDR_TAIL_ADDR CSR so -* it doesn't contain an address that is invalid. +* been cleared, set the RCV_HDR_TAIL_ADDR CSR to dummy address +* so it doesn't contain an address that is invalid. */ - write_kctxt_csr(dd, ctxt, RCV_HDR_TAIL_ADDR, 0); + write_kctxt_csr(dd, ctxt, RCV_HDR_TAIL_ADDR, + dd->rcvhdrtail_dummy_physaddr); } u32 hfi1_read_cntrs(struct hfi1_devdata *dd, loff_t pos, char **namep, diff --git a/drivers/staging/rdma/hfi1/hfi.h b/drivers/staging/rdma/hfi1/hfi.h index 190f7a2..02f2deb 100644 --- a/drivers/staging/rdma/hfi1/hfi.h +++ b/drivers/staging/rdma/hfi1/hfi.h @@ -1084,6 +1084,10 @@ struct hfi1_devdata { /* Save the enabled LCB error bits */ u64 lcb_err_en; u8 dc_shutdown; + + /* receive context tail dummy address */ + volatile __le64 *rcvhdrtail_dummy_kvaddr; + dma_addr_t rcvhdrtail_dummy_physaddr; }; /* 8051 firmware version helper */ diff --git a/drivers/staging/rdma/hfi1/init.c b/drivers/staging/rdma/hfi1/init.c index 47a1202..5bc911c 100644 --- a/drivers/staging/rdma/hfi1/init.c +++ b/drivers/staging/rdma/hfi1/init.c @@ -691,6 +691,18 @@ int hfi1_init(struct hfi1_devdata *dd, int reinit) if (ret) goto done; + /* allocate dummy tail memory for all receive contexts */ + dd->rcvhdrtail_dummy_kvaddr = dma_zalloc_coherent( + &dd->pcidev->dev, sizeof(u64), + &dd->rcvhdrtail_dummy_physaddr, + GFP_KERNEL); + + if (!dd->rcvhdrtail_dummy_kvaddr) { + dd_dev_err(dd, "cannot allocate dummy tail memory\n"); + ret = -ENOMEM; + goto done; + } + /* dd->rcd can be NULL if early initialization failed */ for (i = 0; dd->rcd && i < dd->first_user_ctxt; ++i) { /* @@ -1266,6 +1278,14 @@ static void cleanup_device_data(struct hfi1_devdata *dd) tmp = dd->rcd; dd->rcd = NULL; spin_unlock_irqrestore(&dd->uctxt_lock, flags); + + if (dd->rcvhdrtail_dummy_kvaddr) { + dma_free_coherent(&dd->pcidev->dev, sizeof(u64), + (void *)dd->rcvhdrtail_dummy_kvaddr, + dd->rcvhdrtail_dummy_physaddr); + dd->rcvhdrtail_dummy_kvaddr = NULL; + } + for (ctxt = 0; tmp && ctxt < dd->num_rcv_contexts; ctxt++) { struct hfi1_ctxtdata *rcd = tmp[ctxt]; @@ -1521,6 +1541,14 @@ int hfi1_create_rcvhdrq(struct hfi1_devdata *dd, struct hfi1_ctxtdata *rcd) reg = (dd->rcvhdrsize & RCV_HDR_SIZE_HDR_SIZE_MASK) << RCV_HDR_SIZE_HDR_SIZE_SHIFT; write_kctxt_csr(dd, rcd->ctxt, RCV_HDR_SIZE,
Re: [PATCH v2 01/11] irqdomain: Added domain bus token DOMAIN_BUS_FSL_MC_MSI
On 2015/10/31 3:43, J. German Rivera wrote: > Since an FSL-MC bus is a new bus type that is neither PCI nor > PLATFORM, we need a new domain bus token to disambiguate the > IRQ domain for FSL-MC MSIs. > > Signed-off-by: J. German Rivera > --- > Changes in v2: none > > include/linux/irqdomain.h | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/include/linux/irqdomain.h b/include/linux/irqdomain.h > index d5e5c5b..c0cb5d1 100644 > --- a/include/linux/irqdomain.h > +++ b/include/linux/irqdomain.h > @@ -73,6 +73,7 @@ enum irq_domain_bus_token { > DOMAIN_BUS_PCI_MSI, > DOMAIN_BUS_PLATFORM_MSI, > DOMAIN_BUS_NEXUS, > + DOMAIN_BUS_FSL_MC_MSI, > }; Reviewed-by: Jiang Liu > > /** > -- > 2.3.3 > ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH v2 02/11] fsl-mc: msi: Added FSL-MC-specific member to the msi_desc's union
On 2015/10/31 3:43, J. German Rivera wrote: > FSL-MC is a bus type different from PCI and platform, so it needs > its own member in the msi_desc's union. > > Signed-off-by: J. German Rivera > --- > Changes in v2: > - Addressed comment from Jiang Liu > * Added a dedicated structure for FSL-MC in struct msi_desc > > include/linux/msi.h | 9 + > 1 file changed, 9 insertions(+) > > diff --git a/include/linux/msi.h b/include/linux/msi.h > index f71a25e..152e51a 100644 > --- a/include/linux/msi.h > +++ b/include/linux/msi.h > @@ -33,6 +33,14 @@ struct platform_msi_desc { > }; > > /** > + * fsl_mc_msi_desc - FSL-MC device specific msi descriptor data > + * @msi_index: The index of the MSI descriptor > + */ > +struct fsl_mc_msi_desc { > + u16 msi_index; > +}; > + > +/** > * struct msi_desc - Descriptor structure for MSI based interrupts > * @list:List head for management > * @irq: The base interrupt number > @@ -87,6 +95,7 @@ struct msi_desc { >* tree wide cleanup. >*/ > struct platform_msi_desc platform; > + struct fsl_mc_msi_desc fsl_mc; > }; > }; Reviewed-by: Jiang Liu > > -- > 2.3.3 > ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 05/73] staging: wilc1000: fixes please don't use multiple blank lines
From: Leo Kim This patch fixes the checks reported by checkpatch.pl for Please don't use multiple blank lines. Signed-off-by: Leo Kim Signed-off-by: Glen Lee --- drivers/staging/wilc1000/wilc_wlan.c | 48 1 file changed, 48 deletions(-) diff --git a/drivers/staging/wilc1000/wilc_wlan.c b/drivers/staging/wilc1000/wilc_wlan.c index 7aaad0f..5db87c0 100644 --- a/drivers/staging/wilc1000/wilc_wlan.c +++ b/drivers/staging/wilc1000/wilc_wlan.c @@ -6,8 +6,6 @@ extern wilc_hif_func_t hif_sdio; extern wilc_hif_func_t hif_spi; u32 wilc_get_chipid(u8 update); - - typedef struct { int quit; wilc_wlan_io_func_t io_func; @@ -35,8 +33,6 @@ typedef struct { struct rxq_entry_t *rxq_tail; int rxq_entries; int rxq_exit; - - } wilc_wlan_dev_t; static wilc_wlan_dev_t g_wlan; @@ -92,8 +88,6 @@ static void wilc_wlan_txq_remove(struct txq_entry_t *tqe) p->txq_head = tqe->next; if (p->txq_head) p->txq_head->prev = NULL; - - } else if (tqe == p->txq_tail) { p->txq_tail = (tqe->prev); if (p->txq_tail) @@ -126,10 +120,6 @@ wilc_wlan_txq_remove_from_head(struct net_device *dev) p->txq_head->prev = NULL; p->txq_entries -= 1; - - - - } else { tqe = NULL; } @@ -222,9 +212,6 @@ typedef struct { struct txq_entry_t *txqe; } Pending_Acks_info_t; - - - struct Ack_session_info *Free_head; struct Ack_session_info *Alloc_head; @@ -239,8 +226,6 @@ u32 PendingAcks_arrBase; u32 Opened_TCP_session; u32 Pending_Acks; - - static inline int Init_TCP_tracking(void) { @@ -319,7 +304,6 @@ static inline int tcp_process(struct net_device *dev, struct txq_entry_t *tqe) ip_hdr_ptr = &buffer[ETHERNET_HDR_LEN]; protocol = ip_hdr_ptr[9]; - if (protocol == 0x06) { u8 *tcp_hdr_ptr; u32 IHL, Total_Length, Data_offset; @@ -335,7 +319,6 @@ static inline int tcp_process(struct net_device *dev, struct txq_entry_t *tqe) Ack_no = (((u32)tcp_hdr_ptr[8]) << 24) + (((u32)tcp_hdr_ptr[9]) << 16) + (((u32)tcp_hdr_ptr[10]) << 8) + ((u32)tcp_hdr_ptr[11]); - for (i = 0; i < Opened_TCP_session; i++) { if (Acks_keep_track_info[i].Ack_seq_num == seq_no) { Update_TCP_track_session(i, Ack_no); @@ -346,8 +329,6 @@ static inline int tcp_process(struct net_device *dev, struct txq_entry_t *tqe) add_TCP_track_session(0, 0, seq_no); add_TCP_Pending_Ack(Ack_no, i, tqe); - - } } else { @@ -360,7 +341,6 @@ static inline int tcp_process(struct net_device *dev, struct txq_entry_t *tqe) return ret; } - static int wilc_wlan_txq_filter_dup_tcp_ack(struct net_device *dev) { perInterface_wlan_t *nic; @@ -398,7 +378,6 @@ static int wilc_wlan_txq_filter_dup_tcp_ack(struct net_device *dev) else PendingAcks_arrBase = 0; - spin_unlock_irqrestore(&wilc->txq_spinlock, p->txq_spinlock_flags); while (Dropped > 0) { @@ -523,7 +502,6 @@ static struct txq_entry_t *wilc_wlan_txq_get_first(struct wilc *wilc) spin_unlock_irqrestore(&wilc->txq_spinlock, flags); - return tqe; } @@ -536,7 +514,6 @@ static struct txq_entry_t *wilc_wlan_txq_get_next(struct wilc *wilc, tqe = tqe->next; spin_unlock_irqrestore(&wilc->txq_spinlock, flags); - return tqe; } @@ -637,7 +614,6 @@ static inline void chip_wakeup(void) } while ((clk_status_reg & 0x1) == 0); } - if (genuChipPSstate == CHIP_SLEEPING_MANUAL) { g_wlan.hif_func.hif_read_reg(0x1C0C, ®); reg &= ~BIT(0); @@ -990,9 +966,6 @@ static void wilc_wlan_handle_rxq(struct wilc *wilc) p->rxq_exit = 0; - - - do { if (p->quit) { PRINT_D(RX_DBG, "exit 1st do-while due to Clean_UP function\n"); @@ -1009,8 +982,6 @@ static void wilc_wlan_handle_rxq(struct wilc *wilc) PRINT_D(RX_DBG, "rxQ entery Size = %d - Address = %p\n", size, buffer); offset = 0; - - do { u32 header; u32 pkt_len, pkt_offset, tp_len; @@ -1023,8 +994,6 @@ static void wilc_wlan_handle_rxq(struct wilc *wilc) #endif PRINT_D(RX_DBG, "Header = %04x - Offset = %d\n", header, offset); - - is_cfg_packet = (header >> 31) & 0x1; pkt_offset = (header >> 22) & 0x1ff; tp_len = (header >> 11) & 0x7ff; @@ -1039,7 +1008,6 @@ static void wi
[PATCH 06/73] staging: wilc1000: fixes blank lines aren't necessary brace
From: Leo Kim This patch fixes the checks reported by checkpatch.pl for Blank lines aren't necessary after an open brace '{' and Blank lines aren't necessary before a close brace '}'. Signed-off-by: Leo Kim Signed-off-by: Glen Lee --- drivers/staging/wilc1000/wilc_wlan.c | 24 1 file changed, 24 deletions(-) diff --git a/drivers/staging/wilc1000/wilc_wlan.c b/drivers/staging/wilc1000/wilc_wlan.c index 5db87c0..603541c 100644 --- a/drivers/staging/wilc1000/wilc_wlan.c +++ b/drivers/staging/wilc1000/wilc_wlan.c @@ -59,7 +59,6 @@ static CHIP_PS_STATE_T genuChipPSstate = CHIP_WAKEDUP; static inline void acquire_bus(BUS_ACQUIRE_T acquire) { - mutex_lock(&g_linux_wlan->hif_cs); #ifndef WILC_OPTIMIZE_SLEEP_INT if (genuChipPSstate != CHIP_WAKEDUP) @@ -68,7 +67,6 @@ static inline void acquire_bus(BUS_ACQUIRE_T acquire) if (acquire == ACQUIRE_AND_WAKEUP) chip_wakeup(); } - } static inline void release_bus(BUS_RELEASE_T release) { @@ -81,10 +79,8 @@ static inline void release_bus(BUS_RELEASE_T release) static void wilc_wlan_txq_remove(struct txq_entry_t *tqe) { - wilc_wlan_dev_t *p = &g_wlan; if (tqe == p->txq_head) { - p->txq_head = tqe->next; if (p->txq_head) p->txq_head->prev = NULL; @@ -97,7 +93,6 @@ static void wilc_wlan_txq_remove(struct txq_entry_t *tqe) tqe->next->prev = tqe->prev; } p->txq_entries -= 1; - } static struct txq_entry_t * @@ -191,7 +186,6 @@ static int wilc_wlan_txq_add_to_head(struct txq_entry_t *tqe) PRINT_D(TX_DBG, "Wake up the txq_handler\n"); return 0; - } u32 Statisitcs_totalAcks = 0, Statisitcs_DroppedAcks = 0; @@ -228,9 +222,7 @@ u32 Pending_Acks; static inline int Init_TCP_tracking(void) { - return 0; - } static inline int add_TCP_track_session(u32 src_prt, u32 dst_prt, u32 seq) { @@ -246,11 +238,9 @@ static inline int add_TCP_track_session(u32 src_prt, u32 dst_prt, u32 seq) static inline int Update_TCP_track_session(u32 index, u32 Ack) { - if (Ack > Acks_keep_track_info[index].Bigger_Ack_num) Acks_keep_track_info[index].Bigger_Ack_num = Ack; return 0; - } static inline int add_TCP_Pending_Ack(u32 Ack, u32 Session_index, struct txq_entry_t *txqe) { @@ -261,7 +251,6 @@ static inline int add_TCP_Pending_Ack(u32 Ack, u32 Session_index, struct txq_ent Pending_Acks_info[PendingAcks_arrBase + Pending_Acks].Session_index = Session_index; txqe->tcp_PendingAck_index = PendingAcks_arrBase + Pending_Acks; Pending_Acks++; - } else { } @@ -466,7 +455,6 @@ int wilc_wlan_txq_add_net_pkt(struct net_device *dev, void *priv, u8 *buffer, int wilc_wlan_txq_add_mgmt_pkt(struct net_device *dev, void *priv, u8 *buffer, u32 buffer_size, wilc_tx_complete_func_t func) { - wilc_wlan_dev_t *p = &g_wlan; struct txq_entry_t *tqe; @@ -605,7 +593,6 @@ static inline void chip_wakeup(void) if ((clk_status_reg & 0x1) == 0) wilc_debug(N_ERR, "clocks still OFF. Wake up failed\n"); - } if ((clk_status_reg & 0x1) == 0) { g_wlan.hif_func.hif_write_reg(0xf0, reg & @@ -694,7 +681,6 @@ void chip_sleep_manually(u32 u32SleepTime) genuChipPSstate = CHIP_SLEEPING_MANUAL; release_bus(RELEASE_ONLY); - } int wilc_wlan_handle_txq(struct net_device *dev, u32 *pu32TxqCount) @@ -733,7 +719,6 @@ int wilc_wlan_handle_txq(struct net_device *dev, u32 *pu32TxqCount) sum = 0; do { if ((tqe != NULL) && (i < (WILC_VMM_TBL_SIZE - 1))) { - if (tqe->type == WILC_CFG_PKT) vmm_sz = ETH_CONFIG_PKT_HDR_OFFSET; @@ -782,7 +767,6 @@ int wilc_wlan_handle_txq(struct net_device *dev, u32 *pu32TxqCount) acquire_bus(ACQUIRE_AND_WAKEUP); counter = 0; do { - ret = p->hif_func.hif_read_reg(WILC_HOST_TX_CTRL, ®); if (!ret) { wilc_debug(N_ERR, "[wilc txq]: fail can't read reg vmm_tbl_entry..\n"); @@ -1015,7 +999,6 @@ static void wilc_wlan_handle_rxq(struct wilc *wilc) } else { - if (!is_cfg_packet) { if (pkt_len > 0) { frmw_to_linux(wilc, @@ -1064,7 +1047,6 @@ static void wilc_unknown_isr_ext(void) } static void wilc_pllupdate_isr_ext(u32 int_stats) { - int trials = 10; g_wlan.hif_func.hif_clear_int_ext(PLL_INT_C
[PATCH 01/73] staging: wilc1000: fixes alignment should match open parenthesis
From: Leo Kim This patch fixes the checks reported by checkpatch.pl for alignment should match open parenthesis Signed-off-by: Leo Kim Signed-off-by: Glen Lee --- drivers/staging/wilc1000/linux_wlan.c | 11 ++- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/drivers/staging/wilc1000/linux_wlan.c b/drivers/staging/wilc1000/linux_wlan.c index f82ecb9..976964d 100644 --- a/drivers/staging/wilc1000/linux_wlan.c +++ b/drivers/staging/wilc1000/linux_wlan.c @@ -264,9 +264,11 @@ static int init_irq(struct net_device *dev) PRINT_ER("could not obtain gpio for WILC_INTR\n"); } - if ((ret != -1) && (request_threaded_irq(wl->dev_irq_num, isr_uh_routine, isr_bh_routine, - IRQF_TRIGGER_LOW | IRQF_ONESHOT, - "WILC_IRQ", dev)) < 0) { + if (ret != -1 && request_threaded_irq(wl->dev_irq_num, + isr_uh_routine, + isr_bh_routine, + IRQF_TRIGGER_LOW | IRQF_ONESHOT, + "WILC_IRQ", dev) < 0) { PRINT_ER("Failed to request IRQ for GPIO: %d\n", GPIO_NUM); ret = -1; } else { @@ -1472,8 +1474,7 @@ void wl_wlan_cleanup(struct wilc *wilc) int i = 0; perInterface_wlan_t *nic[NUM_CONCURRENT_IFC]; - if (wilc && - (wilc->vif[0].ndev || wilc->vif[1].ndev)) { + if (wilc && (wilc->vif[0].ndev || wilc->vif[1].ndev)) { unregister_inetaddr_notifier(&g_dev_notifier); for (i = 0; i < NUM_CONCURRENT_IFC; i++) -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 09/73] staging: wilc1000: rename genuChipPSstate variable
From: Leo Kim This patch rename genuChipPSstate variable to chip_ps_state to avoid CamelCase naming convention. Signed-off-by: Leo Kim Signed-off-by: Glen Lee --- drivers/staging/wilc1000/wilc_wlan.c | 20 ++-- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/drivers/staging/wilc1000/wilc_wlan.c b/drivers/staging/wilc1000/wilc_wlan.c index 7ebfcaf..c393e52 100644 --- a/drivers/staging/wilc1000/wilc_wlan.c +++ b/drivers/staging/wilc1000/wilc_wlan.c @@ -55,13 +55,13 @@ static void wilc_debug(u32 flag, char *fmt, ...) } } -static CHIP_PS_STATE_T genuChipPSstate = CHIP_WAKEDUP; +static CHIP_PS_STATE_T chip_ps_state = CHIP_WAKEDUP; static inline void acquire_bus(BUS_ACQUIRE_T acquire) { mutex_lock(&g_linux_wlan->hif_cs); #ifndef WILC_OPTIMIZE_SLEEP_INT - if (genuChipPSstate != CHIP_WAKEDUP) + if (chip_ps_state != CHIP_WAKEDUP) #endif { if (acquire == ACQUIRE_AND_WAKEUP) @@ -606,7 +606,7 @@ static inline void chip_wakeup(void) } while ((clk_status_reg & 0x1) == 0); } - if (genuChipPSstate == CHIP_SLEEPING_MANUAL) { + if (chip_ps_state == CHIP_SLEEPING_MANUAL) { g_wlan.hif_func.hif_read_reg(0x1C0C, ®); reg &= ~BIT(0); g_wlan.hif_func.hif_write_reg(0x1C0C, reg); @@ -623,7 +623,7 @@ static inline void chip_wakeup(void) g_wlan.hif_func.hif_write_reg(0x1e9c, val32); } } - genuChipPSstate = CHIP_WAKEDUP; + chip_ps_state = CHIP_WAKEDUP; } #else static inline void chip_wakeup(void) @@ -653,7 +653,7 @@ static inline void chip_wakeup(void) } while (wilc_get_chipid(true) == 0); - if (genuChipPSstate == CHIP_SLEEPING_MANUAL) { + if (chip_ps_state == CHIP_SLEEPING_MANUAL) { g_wlan.hif_func.hif_read_reg(0x1C0C, ®); reg &= ~BIT(0); g_wlan.hif_func.hif_write_reg(0x1C0C, reg); @@ -670,12 +670,12 @@ static inline void chip_wakeup(void) g_wlan.hif_func.hif_write_reg(0x1e9c, val32); } } - genuChipPSstate = CHIP_WAKEDUP; + chip_ps_state = CHIP_WAKEDUP; } #endif void chip_sleep_manually(u32 u32SleepTime) { - if (genuChipPSstate != CHIP_WAKEDUP) + if (chip_ps_state != CHIP_WAKEDUP) return; acquire_bus(ACQUIRE_ONLY); @@ -684,7 +684,7 @@ void chip_sleep_manually(u32 u32SleepTime) #endif g_wlan.hif_func.hif_write_reg(0x10a8, 1); - genuChipPSstate = CHIP_SLEEPING_MANUAL; + chip_ps_state = CHIP_SLEEPING_MANUAL; release_bus(RELEASE_ONLY); } @@ -1069,7 +1069,7 @@ static void wilc_sleeptimer_isr_ext(u32 int_stats1) { g_wlan.hif_func.hif_clear_int_ext(SLEEP_INT_CLR); #ifndef WILC_OPTIMIZE_SLEEP_INT - genuChipPSstate = CHIP_SLEEPING_AUTO; + chip_ps_state = CHIP_SLEEPING_AUTO; #endif } @@ -1158,7 +1158,7 @@ void wilc_handle_isr(void *wilc) if (int_status & DATA_INT_EXT) { wilc_wlan_handle_isr_ext(wilc, int_status); #ifndef WILC_OPTIMIZE_SLEEP_INT - genuChipPSstate = CHIP_WAKEDUP; + chip_ps_state = CHIP_WAKEDUP; #endif } if (int_status & SLEEP_INT_EXT) -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 04/73] staging: wilc1000: wilc_wlan.c: remove over-commenting
From: Leo Kim There are over-commenting in the wilc_wlan.c file and most of them are not helpful to explain what the code does and generate 80 ending line over warnings. So, all of comments are removed in this patch and the comments will later be added if necessary with the preferred Linux style. Signed-off-by: Leo Kim Signed-off-by: Glen Lee --- drivers/staging/wilc1000/wilc_wlan.c | 330 +++ 1 file changed, 27 insertions(+), 303 deletions(-) diff --git a/drivers/staging/wilc1000/wilc_wlan.c b/drivers/staging/wilc1000/wilc_wlan.c index 0e5535e..7aaad0f 100644 --- a/drivers/staging/wilc1000/wilc_wlan.c +++ b/drivers/staging/wilc1000/wilc_wlan.c @@ -1,21 +1,7 @@ -/* // */ -/* */ -/* Copyright (c) Atmel Corporation. All rights reserved. */ -/* */ -/* Module Name: wilc_wlan.c */ -/* */ -/* */ -/* */ - #include "wilc_wlan_if.h" #include "wilc_wfi_netdevice.h" #include "wilc_wlan_cfg.h" -/ - * - * Global - * - / extern wilc_hif_func_t hif_sdio; extern wilc_hif_func_t hif_spi; u32 wilc_get_chipid(u8 update); @@ -24,42 +10,20 @@ u32 wilc_get_chipid(u8 update); typedef struct { int quit; - - /** -* input interface functions -**/ wilc_wlan_io_func_t io_func; - - /** -* host interface functions -**/ wilc_hif_func_t hif_func; - - /** -* configuration interface functions -**/ int cfg_frame_in_use; wilc_cfg_frame_t cfg_frame; u32 cfg_frame_offset; int cfg_seq_no; - /** -* RX buffer -**/ #ifdef MEMORY_STATIC u8 *rx_buffer; u32 rx_buffer_offset; #endif - /** -* TX buffer -**/ u8 *tx_buffer; u32 tx_buffer_offset; - /** -* TX queue -**/ - unsigned long txq_spinlock_flags; struct txq_entry_t *txq_head; @@ -67,9 +31,6 @@ typedef struct { int txq_entries; int txq_exit; - /** -* RX queue -**/ struct rxq_entry_t *rxq_head; struct rxq_entry_t *rxq_tail; int rxq_entries; @@ -82,12 +43,6 @@ static wilc_wlan_dev_t g_wlan; static inline void chip_allow_sleep(void); static inline void chip_wakeup(void); -/ - * - * Debug - * - / - static u32 dbgflag = N_INIT | N_ERR | N_INTR | N_TXQ | N_RXQ; static void wilc_debug(u32 flag, char *fmt, ...) @@ -106,9 +61,6 @@ static void wilc_debug(u32 flag, char *fmt, ...) static CHIP_PS_STATE_T genuChipPSstate = CHIP_WAKEDUP; -/*acquire_bus() and release_bus() are made static inline functions*/ -/*as a temporary workaround to fix a problem of receiving*/ -/*unknown interrupt from FW*/ static inline void acquire_bus(BUS_ACQUIRE_T acquire) { @@ -130,11 +82,6 @@ static inline void release_bus(BUS_RELEASE_T release) #endif mutex_unlock(&g_linux_wlan->hif_cs); } -/ - * - * Queue - * - / static void wilc_wlan_txq_remove(struct txq_entry_t *tqe) { @@ -219,9 +166,6 @@ static void wilc_wlan_txq_add_to_tail(struct net_device *dev, spin_unlock_irqrestore(&wilc->txq_spinlock, flags); - /** -* wake up TX queue -**/ PRINT_D(TX_DBG, "Wake the txq_handling\n"); up(&wilc->txq_event); @@ -253,11 +197,6 @@ static int wilc_wlan_txq_add_to_head(struct txq_entry_t *tqe) spin_unlock_irqrestore(&g_linux_wlan->txq_spinlock, flags); up(&g_linux_wlan->txq_add_to_head_cs); - - - /** -* wake up TX queue -**/ up(&g_linux_wlan->txq_event); PRINT_D(TX_DBG, "Wake up the txq_handler\n"); @@ -281,7 +220,7 @@ typedef struct { u32 ack_num; u32 Session_index; struct txq_entry_t *txqe; -} Pending_Acks_info_t /*Ack_info_t*/; +} Pending_Acks_info_t; @@ -373,7 +312,7 @@ static inline int tcp_process(struct net_device *dev, struct txq_entry_t *tqe) eth_hdr_ptr = &buffer[0]; h_proto = ntohs(*((unsigned short *)ð_hdr_ptr[12])); - if (h_proto == 0x0800) { /* IP */ + if (h_proto == 0x0800) { u8 *ip_hdr_ptr; u8 protocol; @@ -389,7 +328,7 @@ static inline int tcp_process(struct net_device *dev, struct txq_entry_t *tqe) IHL = (ip_hdr_ptr[0] & 0xf) << 2; Total_Length = (((u32)ip_hdr_ptr[2]) << 8) + ((u32)ip_hdr_ptr[3]); Data_offset = (((u32)tcp_hdr_ptr[12] & 0xf0) >> 2); - if (
[PATCH 03/73] staging: wilc1000: fixes that open brace { should be on the previous line
From: Leo Kim This patch fixes the error reported by checkpatch.pl for that open brace { should be on the previous line. Signed-off-by: Leo Kim Signed-off-by: Glen Lee --- drivers/staging/wilc1000/linux_wlan.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/staging/wilc1000/linux_wlan.c b/drivers/staging/wilc1000/linux_wlan.c index 947c9f9..c94cb13 100644 --- a/drivers/staging/wilc1000/linux_wlan.c +++ b/drivers/staging/wilc1000/linux_wlan.c @@ -1186,8 +1186,7 @@ static void wilc_set_multicast_list(struct net_device *dev) return; } - netdev_for_each_mc_addr(ha, dev) - { + netdev_for_each_mc_addr(ha, dev) { memcpy(multicast_mac_addr_list[i], ha->addr, ETH_ALEN); PRINT_D(INIT_DBG, "Entry[%d]: %x:%x:%x:%x:%x:%x\n", i, multicast_mac_addr_list[i][0], -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 02/73] staging: wilc1000: fixes a struct allocation to match coding standards
From: Leo Kim This patch fixes the checks reported by checkpatch.pl for prefer kmalloc(sizeof(*tx_data)...) over kmalloc(sizeof(struct tx_complete_data)...) Signed-off-by: Leo Kim Signed-off-by: Glen Lee --- drivers/staging/wilc1000/linux_wlan.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/wilc1000/linux_wlan.c b/drivers/staging/wilc1000/linux_wlan.c index 976964d..947c9f9 100644 --- a/drivers/staging/wilc1000/linux_wlan.c +++ b/drivers/staging/wilc1000/linux_wlan.c @@ -1236,7 +1236,7 @@ int mac_xmit(struct sk_buff *skb, struct net_device *ndev) return 0; } - tx_data = kmalloc(sizeof(struct tx_complete_data), GFP_ATOMIC); + tx_data = kmalloc(sizeof(*tx_data), GFP_ATOMIC); if (!tx_data) { PRINT_ER("Failed to allocate memory for tx_data structure\n"); dev_kfree_skb(skb); -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 10/73] staging: wilc1000: replace explicit NULL comparisons with !
From: Leo Kim This patch replace explicit NULL comparison with ! operator to simplify code. Reported by checkpatch.pl for Comparison to NULL could be written "!XXX" or "XXX". Signed-off-by: Leo Kim Signed-off-by: Glen Lee --- drivers/staging/wilc1000/wilc_wlan.c | 36 ++-- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/drivers/staging/wilc1000/wilc_wlan.c b/drivers/staging/wilc1000/wilc_wlan.c index c393e52..8ac0b1e 100644 --- a/drivers/staging/wilc1000/wilc_wlan.c +++ b/drivers/staging/wilc1000/wilc_wlan.c @@ -137,7 +137,7 @@ static void wilc_wlan_txq_add_to_tail(struct net_device *dev, spin_lock_irqsave(&wilc->txq_spinlock, flags); - if (p->txq_head == NULL) { + if (!p->txq_head) { tqe->next = NULL; tqe->prev = NULL; p->txq_head = tqe; @@ -168,7 +168,7 @@ static int wilc_wlan_txq_add_to_head(struct txq_entry_t *tqe) spin_lock_irqsave(&g_linux_wlan->txq_spinlock, flags); - if (p->txq_head == NULL) { + if (!p->txq_head) { tqe->next = NULL; tqe->prev = NULL; p->txq_head = tqe; @@ -407,7 +407,7 @@ static int wilc_wlan_txq_add_cfg_pkt(u8 *buffer, u32 buffer_size) } tqe = kmalloc(sizeof(struct txq_entry_t), GFP_ATOMIC); - if (tqe == NULL) { + if (!tqe) { PRINT_ER("Failed to allocate memory\n"); return 0; } @@ -438,7 +438,7 @@ int wilc_wlan_txq_add_net_pkt(struct net_device *dev, void *priv, u8 *buffer, tqe = kmalloc(sizeof(struct txq_entry_t), GFP_ATOMIC); - if (tqe == NULL) + if (!tqe) return 0; tqe->type = WILC_NET_PKT; tqe->buffer = buffer; @@ -467,7 +467,7 @@ int wilc_wlan_txq_add_mgmt_pkt(struct net_device *dev, void *priv, u8 *buffer, tqe = kmalloc(sizeof(struct txq_entry_t), GFP_KERNEL); - if (tqe == NULL) + if (!tqe) return 0; tqe->type = WILC_MGMT_PKT; tqe->buffer = buffer; @@ -518,7 +518,7 @@ static int wilc_wlan_rxq_add(struct wilc *wilc, struct rxq_entry_t *rqe) return 0; mutex_lock(&wilc->rxq_cs); - if (p->rxq_head == NULL) { + if (!p->rxq_head) { PRINT_D(RX_DBG, "Add to Queue head\n"); rqe->next = NULL; p->rxq_head = rqe; @@ -723,7 +723,7 @@ int wilc_wlan_handle_txq(struct net_device *dev, u32 *pu32TxqCount) i = 0; sum = 0; do { - if ((tqe != NULL) && (i < (WILC_VMM_TBL_SIZE - 1))) { + if (tqe && (i < (WILC_VMM_TBL_SIZE - 1))) { if (tqe->type == WILC_CFG_PKT) vmm_sz = ETH_CONFIG_PKT_HDR_OFFSET; @@ -871,7 +871,7 @@ int wilc_wlan_handle_txq(struct net_device *dev, u32 *pu32TxqCount) i = 0; do { tqe = wilc_wlan_txq_remove_from_head(dev); - if (tqe != NULL && (vmm_table[i] != 0)) { + if (tqe && (vmm_table[i] != 0)) { u32 header, buffer_offset; #ifdef BIG_ENDIAN @@ -962,7 +962,7 @@ static void wilc_wlan_handle_rxq(struct wilc *wilc) break; } rqe = wilc_wlan_rxq_remove(wilc); - if (rqe == NULL) { + if (!rqe) { PRINT_D(RX_DBG, "nothing in the queue - exit 1st do-while\n"); break; } @@ -1110,7 +1110,7 @@ static void wilc_wlan_handle_isr_ext(struct wilc *wilc, u32 int_status) #else buffer = kmalloc(size, GFP_KERNEL); - if (buffer == NULL) { + if (!buffer) { wilc_debug(N_ERR, "[wilc isr]: fail alloc host memory...drop the packets (%d)\n", size); usleep_range(100 * 1000, 100 * 1000); goto _end_; @@ -1130,7 +1130,7 @@ _end_: p->rx_buffer_offset = offset; #endif rqe = kmalloc(sizeof(struct rxq_entry_t), GFP_KERNEL); - if (rqe != NULL) { + if (rqe) { rqe->buffer = buffer; rqe->buffer_size = size; PRINT_D(RX_DBG, "rxq entery Size= %d - Address = %p\n", rqe->buffer_size, rqe->buffer); @@ -1184,7 +1184,7 @@ int wilc_wlan_firmware_download(const u8 *buffer, u32 buffer_size) blksz = BIT(12); dma_buffer = kmalloc(blksz, GFP_KERNEL); - if (dma_buffer == NULL) { + if (!dma_buffer) { ret = -5; PRINT_ER("Can't allocate buffer for firmware download IO error\n "); goto _fail_1; @@ -1406,7 +1406,7 @@ void wilc_wlan_cleanup(struct
[PATCH 07/73] staging: wilc1000: fixes add blank line after function declaration
From: Leo Kim This patch fixes the warnings reported by checkpatch.pl for please use a blank line after function/struct/union/enum declarations Signed-off-by: Leo Kim Signed-off-by: Glen Lee --- drivers/staging/wilc1000/wilc_wlan.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/drivers/staging/wilc1000/wilc_wlan.c b/drivers/staging/wilc1000/wilc_wlan.c index 603541c..d3117f9 100644 --- a/drivers/staging/wilc1000/wilc_wlan.c +++ b/drivers/staging/wilc1000/wilc_wlan.c @@ -68,6 +68,7 @@ static inline void acquire_bus(BUS_ACQUIRE_T acquire) chip_wakeup(); } } + static inline void release_bus(BUS_RELEASE_T release) { #ifdef WILC_OPTIMIZE_SLEEP_INT @@ -224,6 +225,7 @@ static inline int Init_TCP_tracking(void) { return 0; } + static inline int add_TCP_track_session(u32 src_prt, u32 dst_prt, u32 seq) { Acks_keep_track_info[Opened_TCP_session].Ack_seq_num = seq; @@ -242,6 +244,7 @@ static inline int Update_TCP_track_session(u32 index, u32 Ack) Acks_keep_track_info[index].Bigger_Ack_num = Ack; return 0; } + static inline int add_TCP_Pending_Ack(u32 Ack, u32 Session_index, struct txq_entry_t *txqe) { Statisitcs_totalAcks++; @@ -1045,6 +1048,7 @@ static void wilc_unknown_isr_ext(void) { g_wlan.hif_func.hif_clear_int_ext(0); } + static void wilc_pllupdate_isr_ext(u32 int_stats) { int trials = 10; @@ -1507,6 +1511,7 @@ int wilc_wlan_cfg_set(int start, u32 wid, u8 *buffer, u32 buffer_size, return ret_size; } + int wilc_wlan_cfg_get(int start, u32 wid, int commit, u32 drvHandler) { wilc_wlan_dev_t *p = &g_wlan; @@ -1562,6 +1567,7 @@ void wilc_bus_set_default_speed(void) { g_wlan.hif_func.hif_set_default_bus_speed(); } + u32 init_chip(struct net_device *dev) { u32 chipid; -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 11/73] staging: wilc1000: rename Statisitcs_totalAcks variable
From: Leo Kim This patch rename Statisitcs_totalAcks variable to total_acks to avoid CamelCase naming convention. Signed-off-by: Leo Kim Signed-off-by: Glen Lee --- drivers/staging/wilc1000/wilc_wlan.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/wilc1000/wilc_wlan.c b/drivers/staging/wilc1000/wilc_wlan.c index 8ac0b1e..8d6215b 100644 --- a/drivers/staging/wilc1000/wilc_wlan.c +++ b/drivers/staging/wilc1000/wilc_wlan.c @@ -190,7 +190,7 @@ static int wilc_wlan_txq_add_to_head(struct txq_entry_t *tqe) return 0; } -u32 Statisitcs_totalAcks = 0, Statisitcs_DroppedAcks = 0; +u32 total_acks = 0, Statisitcs_DroppedAcks = 0; #ifdef TCP_ACK_FILTER struct Ack_session_info; @@ -248,7 +248,7 @@ static inline int Update_TCP_track_session(u32 index, u32 Ack) static inline int add_TCP_Pending_Ack(u32 Ack, u32 Session_index, struct txq_entry_t *txqe) { - Statisitcs_totalAcks++; + total_acks++; if (Pending_Acks < MAX_PENDING_ACKS) { Pending_Acks_info[PendingAcks_arrBase + Pending_Acks].ack_num = Ack; Pending_Acks_info[PendingAcks_arrBase + Pending_Acks].txqe = txqe; -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 08/73] staging: wilc1000: fixes missing a blank line after declarations
From: Leo Kim This patch fixes the warnings reported by checkpatch.pl for Missing a blank line after declarations. Signed-off-by: Leo Kim Signed-off-by: Glen Lee --- drivers/staging/wilc1000/wilc_wlan.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/staging/wilc1000/wilc_wlan.c b/drivers/staging/wilc1000/wilc_wlan.c index d3117f9..7ebfcaf 100644 --- a/drivers/staging/wilc1000/wilc_wlan.c +++ b/drivers/staging/wilc1000/wilc_wlan.c @@ -81,6 +81,7 @@ static inline void release_bus(BUS_RELEASE_T release) static void wilc_wlan_txq_remove(struct txq_entry_t *tqe) { wilc_wlan_dev_t *p = &g_wlan; + if (tqe == p->txq_head) { p->txq_head = tqe->next; if (p->txq_head) @@ -500,6 +501,7 @@ static struct txq_entry_t *wilc_wlan_txq_get_next(struct wilc *wilc, struct txq_entry_t *tqe) { unsigned long flags; + spin_lock_irqsave(&wilc->txq_spinlock, flags); tqe = tqe->next; -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 13/73] staging: wilc1000: rename Ack_session_info struct variable
From: Leo Kim This patch rename Ack_session_info struct variable to ack_session_info to avoid CamelCase naming convention. Signed-off-by: Leo Kim Signed-off-by: Glen Lee --- drivers/staging/wilc1000/wilc_wlan.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/staging/wilc1000/wilc_wlan.c b/drivers/staging/wilc1000/wilc_wlan.c index 9b1ca17..f3968fd 100644 --- a/drivers/staging/wilc1000/wilc_wlan.c +++ b/drivers/staging/wilc1000/wilc_wlan.c @@ -193,8 +193,8 @@ static int wilc_wlan_txq_add_to_head(struct txq_entry_t *tqe) u32 total_acks = 0, dropped_acks = 0; #ifdef TCP_ACK_FILTER -struct Ack_session_info; -struct Ack_session_info { +struct ack_session_info; +struct ack_session_info { u32 Ack_seq_num; u32 Bigger_Ack_num; u16 src_port; @@ -208,14 +208,14 @@ typedef struct { struct txq_entry_t *txqe; } Pending_Acks_info_t; -struct Ack_session_info *Free_head; -struct Ack_session_info *Alloc_head; +struct ack_session_info *Free_head; +struct ack_session_info *Alloc_head; #define NOT_TCP_ACK(-1) #define MAX_TCP_SESSION25 #define MAX_PENDING_ACKS 256 -struct Ack_session_info Acks_keep_track_info[2 * MAX_TCP_SESSION]; +struct ack_session_info Acks_keep_track_info[2 * MAX_TCP_SESSION]; Pending_Acks_info_t Pending_Acks_info[MAX_PENDING_ACKS]; u32 PendingAcks_arrBase; -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 14/73] staging: wilc1000: rename Ack_seq_num of struct ack_session_info
From: Leo Kim This patch rename Ack_seq_num of struct ack_session_info to seq_num to avoid CamelCase naming convention. Signed-off-by: Leo Kim Signed-off-by: Glen Lee --- drivers/staging/wilc1000/wilc_wlan.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/wilc1000/wilc_wlan.c b/drivers/staging/wilc1000/wilc_wlan.c index f3968fd..7162473 100644 --- a/drivers/staging/wilc1000/wilc_wlan.c +++ b/drivers/staging/wilc1000/wilc_wlan.c @@ -195,7 +195,7 @@ u32 total_acks = 0, dropped_acks = 0; #ifdef TCP_ACK_FILTER struct ack_session_info; struct ack_session_info { - u32 Ack_seq_num; + u32 seq_num; u32 Bigger_Ack_num; u16 src_port; u16 dst_port; @@ -229,7 +229,7 @@ static inline int Init_TCP_tracking(void) static inline int add_TCP_track_session(u32 src_prt, u32 dst_prt, u32 seq) { - Acks_keep_track_info[Opened_TCP_session].Ack_seq_num = seq; + Acks_keep_track_info[Opened_TCP_session].seq_num = seq; Acks_keep_track_info[Opened_TCP_session].Bigger_Ack_num = 0; Acks_keep_track_info[Opened_TCP_session].src_port = src_prt; Acks_keep_track_info[Opened_TCP_session].dst_port = dst_prt; @@ -313,7 +313,7 @@ static inline int tcp_process(struct net_device *dev, struct txq_entry_t *tqe) Ack_no = (((u32)tcp_hdr_ptr[8]) << 24) + (((u32)tcp_hdr_ptr[9]) << 16) + (((u32)tcp_hdr_ptr[10]) << 8) + ((u32)tcp_hdr_ptr[11]); for (i = 0; i < Opened_TCP_session; i++) { - if (Acks_keep_track_info[i].Ack_seq_num == seq_no) { + if (Acks_keep_track_info[i].seq_num == seq_no) { Update_TCP_track_session(i, Ack_no); break; } -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 12/73] staging: wilc1000: rename Statisitcs_DroppedAcks variable
From: Leo Kim This patch rename Statisitcs_DroppedAcks variable to dropped_acks to avoid CamelCase naming convention. Signed-off-by: Leo Kim Signed-off-by: Glen Lee --- drivers/staging/wilc1000/wilc_wlan.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/wilc1000/wilc_wlan.c b/drivers/staging/wilc1000/wilc_wlan.c index 8d6215b..9b1ca17 100644 --- a/drivers/staging/wilc1000/wilc_wlan.c +++ b/drivers/staging/wilc1000/wilc_wlan.c @@ -190,7 +190,7 @@ static int wilc_wlan_txq_add_to_head(struct txq_entry_t *tqe) return 0; } -u32 total_acks = 0, Statisitcs_DroppedAcks = 0; +u32 total_acks = 0, dropped_acks = 0; #ifdef TCP_ACK_FILTER struct Ack_session_info; @@ -354,7 +354,7 @@ static int wilc_wlan_txq_filter_dup_tcp_ack(struct net_device *dev) tqe = Pending_Acks_info[i].txqe; if (tqe) { wilc_wlan_txq_remove(tqe); - Statisitcs_DroppedAcks++; + dropped_acks++; tqe->status = 1; if (tqe->tx_complete_func) tqe->tx_complete_func(tqe->priv, tqe->status); -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 15/73] staging: wilc1000: rename Bigger_Ack_num of struct ack_session_info
From: Leo Kim This patch rename Bigger_Ack_num of struct ack_session_info to bigger_ack_num to avoid CamelCase naming convention. Signed-off-by: Leo Kim Signed-off-by: Glen Lee --- drivers/staging/wilc1000/wilc_wlan.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/staging/wilc1000/wilc_wlan.c b/drivers/staging/wilc1000/wilc_wlan.c index 7162473..4aec892 100644 --- a/drivers/staging/wilc1000/wilc_wlan.c +++ b/drivers/staging/wilc1000/wilc_wlan.c @@ -196,7 +196,7 @@ u32 total_acks = 0, dropped_acks = 0; struct ack_session_info; struct ack_session_info { u32 seq_num; - u32 Bigger_Ack_num; + u32 bigger_ack_num; u16 src_port; u16 dst_port; u16 status; @@ -230,7 +230,7 @@ static inline int Init_TCP_tracking(void) static inline int add_TCP_track_session(u32 src_prt, u32 dst_prt, u32 seq) { Acks_keep_track_info[Opened_TCP_session].seq_num = seq; - Acks_keep_track_info[Opened_TCP_session].Bigger_Ack_num = 0; + Acks_keep_track_info[Opened_TCP_session].bigger_ack_num = 0; Acks_keep_track_info[Opened_TCP_session].src_port = src_prt; Acks_keep_track_info[Opened_TCP_session].dst_port = dst_prt; Opened_TCP_session++; @@ -241,8 +241,8 @@ static inline int add_TCP_track_session(u32 src_prt, u32 dst_prt, u32 seq) static inline int Update_TCP_track_session(u32 index, u32 Ack) { - if (Ack > Acks_keep_track_info[index].Bigger_Ack_num) - Acks_keep_track_info[index].Bigger_Ack_num = Ack; + if (Ack > Acks_keep_track_info[index].bigger_ack_num) + Acks_keep_track_info[index].bigger_ack_num = Ack; return 0; } @@ -347,7 +347,7 @@ static int wilc_wlan_txq_filter_dup_tcp_ack(struct net_device *dev) spin_lock_irqsave(&wilc->txq_spinlock, p->txq_spinlock_flags); for (i = PendingAcks_arrBase; i < (PendingAcks_arrBase + Pending_Acks); i++) { - if (Pending_Acks_info[i].ack_num < Acks_keep_track_info[Pending_Acks_info[i].Session_index].Bigger_Ack_num) { + if (Pending_Acks_info[i].ack_num < Acks_keep_track_info[Pending_Acks_info[i].Session_index].bigger_ack_num) { struct txq_entry_t *tqe; PRINT_D(TCP_ENH, "DROP ACK: %u\n", Pending_Acks_info[i].ack_num); -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 17/73] staging: wilc1000: rename Session_index of struct pending_acks_info
From: Leo Kim This patch rename Session_index of struct pending_acks_info to session_index to avoid CamelCase naming convention. Signed-off-by: Leo Kim Signed-off-by: Glen Lee --- drivers/staging/wilc1000/wilc_wlan.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/wilc1000/wilc_wlan.c b/drivers/staging/wilc1000/wilc_wlan.c index fb0e635..af5a16e 100644 --- a/drivers/staging/wilc1000/wilc_wlan.c +++ b/drivers/staging/wilc1000/wilc_wlan.c @@ -204,7 +204,7 @@ struct ack_session_info { struct pending_acks_info { u32 ack_num; - u32 Session_index; + u32 session_index; struct txq_entry_t *txqe; }; @@ -252,7 +252,7 @@ static inline int add_TCP_Pending_Ack(u32 Ack, u32 Session_index, struct txq_ent if (Pending_Acks < MAX_PENDING_ACKS) { Pending_Acks_info[PendingAcks_arrBase + Pending_Acks].ack_num = Ack; Pending_Acks_info[PendingAcks_arrBase + Pending_Acks].txqe = txqe; - Pending_Acks_info[PendingAcks_arrBase + Pending_Acks].Session_index = Session_index; + Pending_Acks_info[PendingAcks_arrBase + Pending_Acks].session_index = Session_index; txqe->tcp_PendingAck_index = PendingAcks_arrBase + Pending_Acks; Pending_Acks++; } else { @@ -347,7 +347,7 @@ static int wilc_wlan_txq_filter_dup_tcp_ack(struct net_device *dev) spin_lock_irqsave(&wilc->txq_spinlock, p->txq_spinlock_flags); for (i = PendingAcks_arrBase; i < (PendingAcks_arrBase + Pending_Acks); i++) { - if (Pending_Acks_info[i].ack_num < Acks_keep_track_info[Pending_Acks_info[i].Session_index].bigger_ack_num) { + if (Pending_Acks_info[i].ack_num < Acks_keep_track_info[Pending_Acks_info[i].session_index].bigger_ack_num) { struct txq_entry_t *tqe; PRINT_D(TCP_ENH, "DROP ACK: %u\n", Pending_Acks_info[i].ack_num); -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 16/73] staging: wilc1000: remove typedef of struct Pending_Acks_info_t
From: Leo Kim This patch remove typedef of struct Pending_Acks_info_t. And, rename the Pending_Acks_info_t to pending_acks_info. Signed-off-by: Leo Kim Signed-off-by: Glen Lee --- drivers/staging/wilc1000/wilc_wlan.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/wilc1000/wilc_wlan.c b/drivers/staging/wilc1000/wilc_wlan.c index 4aec892..fb0e635 100644 --- a/drivers/staging/wilc1000/wilc_wlan.c +++ b/drivers/staging/wilc1000/wilc_wlan.c @@ -202,11 +202,11 @@ struct ack_session_info { u16 status; }; -typedef struct { +struct pending_acks_info { u32 ack_num; u32 Session_index; struct txq_entry_t *txqe; -} Pending_Acks_info_t; +}; struct ack_session_info *Free_head; struct ack_session_info *Alloc_head; @@ -216,7 +216,7 @@ struct ack_session_info *Alloc_head; #define MAX_TCP_SESSION25 #define MAX_PENDING_ACKS 256 struct ack_session_info Acks_keep_track_info[2 * MAX_TCP_SESSION]; -Pending_Acks_info_t Pending_Acks_info[MAX_PENDING_ACKS]; +struct pending_acks_info Pending_Acks_info[MAX_PENDING_ACKS]; u32 PendingAcks_arrBase; u32 Opened_TCP_session; -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 20/73] staging: wilc1000: rename PendingAcks_arrBase variable
From: Leo Kim This patch rename the PendingAcks_arrBase variable to pending_base to avoid CamelCase naming convention. Signed-off-by: Leo Kim Signed-off-by: Glen Lee --- drivers/staging/wilc1000/wilc_wlan.c | 18 +- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/drivers/staging/wilc1000/wilc_wlan.c b/drivers/staging/wilc1000/wilc_wlan.c index 7db42c0..a1b6067 100644 --- a/drivers/staging/wilc1000/wilc_wlan.c +++ b/drivers/staging/wilc1000/wilc_wlan.c @@ -218,7 +218,7 @@ struct ack_session_info *Alloc_head; struct ack_session_info ack_session_info[2 * MAX_TCP_SESSION]; struct pending_acks_info pending_acks_info[MAX_PENDING_ACKS]; -u32 PendingAcks_arrBase; +u32 pending_base; u32 Opened_TCP_session; u32 Pending_Acks; @@ -250,10 +250,10 @@ static inline int add_TCP_Pending_Ack(u32 Ack, u32 Session_index, struct txq_ent { total_acks++; if (Pending_Acks < MAX_PENDING_ACKS) { - pending_acks_info[PendingAcks_arrBase + Pending_Acks].ack_num = Ack; - pending_acks_info[PendingAcks_arrBase + Pending_Acks].txqe = txqe; - pending_acks_info[PendingAcks_arrBase + Pending_Acks].session_index = Session_index; - txqe->tcp_PendingAck_index = PendingAcks_arrBase + Pending_Acks; + pending_acks_info[pending_base + Pending_Acks].ack_num = Ack; + pending_acks_info[pending_base + Pending_Acks].txqe = txqe; + pending_acks_info[pending_base + Pending_Acks].session_index = Session_index; + txqe->tcp_PendingAck_index = pending_base + Pending_Acks; Pending_Acks++; } else { @@ -346,7 +346,7 @@ static int wilc_wlan_txq_filter_dup_tcp_ack(struct net_device *dev) wilc = nic->wilc; spin_lock_irqsave(&wilc->txq_spinlock, p->txq_spinlock_flags); - for (i = PendingAcks_arrBase; i < (PendingAcks_arrBase + Pending_Acks); i++) { + for (i = pending_base; i < (pending_base + Pending_Acks); i++) { if (pending_acks_info[i].ack_num < ack_session_info[pending_acks_info[i].session_index].bigger_ack_num) { struct txq_entry_t *tqe; @@ -367,10 +367,10 @@ static int wilc_wlan_txq_filter_dup_tcp_ack(struct net_device *dev) Pending_Acks = 0; Opened_TCP_session = 0; - if (PendingAcks_arrBase == 0) - PendingAcks_arrBase = MAX_TCP_SESSION; + if (pending_base == 0) + pending_base = MAX_TCP_SESSION; else - PendingAcks_arrBase = 0; + pending_base = 0; spin_unlock_irqrestore(&wilc->txq_spinlock, p->txq_spinlock_flags); -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 18/73] staging: wilc1000: rename Acks_keep_track_info variable
From: Leo Kim This patch rename the Acks_keep_track_info variable to ack_session_info to avoid CamelCase naming convention. Signed-off-by: Leo Kim Signed-off-by: Glen Lee --- drivers/staging/wilc1000/wilc_wlan.c | 18 +- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/drivers/staging/wilc1000/wilc_wlan.c b/drivers/staging/wilc1000/wilc_wlan.c index af5a16e..359df26 100644 --- a/drivers/staging/wilc1000/wilc_wlan.c +++ b/drivers/staging/wilc1000/wilc_wlan.c @@ -215,7 +215,7 @@ struct ack_session_info *Alloc_head; #define MAX_TCP_SESSION25 #define MAX_PENDING_ACKS 256 -struct ack_session_info Acks_keep_track_info[2 * MAX_TCP_SESSION]; +struct ack_session_info ack_session_info[2 * MAX_TCP_SESSION]; struct pending_acks_info Pending_Acks_info[MAX_PENDING_ACKS]; u32 PendingAcks_arrBase; @@ -229,10 +229,10 @@ static inline int Init_TCP_tracking(void) static inline int add_TCP_track_session(u32 src_prt, u32 dst_prt, u32 seq) { - Acks_keep_track_info[Opened_TCP_session].seq_num = seq; - Acks_keep_track_info[Opened_TCP_session].bigger_ack_num = 0; - Acks_keep_track_info[Opened_TCP_session].src_port = src_prt; - Acks_keep_track_info[Opened_TCP_session].dst_port = dst_prt; + ack_session_info[Opened_TCP_session].seq_num = seq; + ack_session_info[Opened_TCP_session].bigger_ack_num = 0; + ack_session_info[Opened_TCP_session].src_port = src_prt; + ack_session_info[Opened_TCP_session].dst_port = dst_prt; Opened_TCP_session++; PRINT_D(TCP_ENH, "TCP Session %d to Ack %d\n", Opened_TCP_session, seq); @@ -241,8 +241,8 @@ static inline int add_TCP_track_session(u32 src_prt, u32 dst_prt, u32 seq) static inline int Update_TCP_track_session(u32 index, u32 Ack) { - if (Ack > Acks_keep_track_info[index].bigger_ack_num) - Acks_keep_track_info[index].bigger_ack_num = Ack; + if (Ack > ack_session_info[index].bigger_ack_num) + ack_session_info[index].bigger_ack_num = Ack; return 0; } @@ -313,7 +313,7 @@ static inline int tcp_process(struct net_device *dev, struct txq_entry_t *tqe) Ack_no = (((u32)tcp_hdr_ptr[8]) << 24) + (((u32)tcp_hdr_ptr[9]) << 16) + (((u32)tcp_hdr_ptr[10]) << 8) + ((u32)tcp_hdr_ptr[11]); for (i = 0; i < Opened_TCP_session; i++) { - if (Acks_keep_track_info[i].seq_num == seq_no) { + if (ack_session_info[i].seq_num == seq_no) { Update_TCP_track_session(i, Ack_no); break; } @@ -347,7 +347,7 @@ static int wilc_wlan_txq_filter_dup_tcp_ack(struct net_device *dev) spin_lock_irqsave(&wilc->txq_spinlock, p->txq_spinlock_flags); for (i = PendingAcks_arrBase; i < (PendingAcks_arrBase + Pending_Acks); i++) { - if (Pending_Acks_info[i].ack_num < Acks_keep_track_info[Pending_Acks_info[i].session_index].bigger_ack_num) { + if (Pending_Acks_info[i].ack_num < ack_session_info[Pending_Acks_info[i].session_index].bigger_ack_num) { struct txq_entry_t *tqe; PRINT_D(TCP_ENH, "DROP ACK: %u\n", Pending_Acks_info[i].ack_num); -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 19/73] staging: wilc1000: rename Pending_Acks_info variable
From: Leo Kim This patch rename the Pending_Acks_info variable to pending_acks_info to avoid CamelCase naming convention. Signed-off-by: Leo Kim Signed-off-by: Glen Lee --- drivers/staging/wilc1000/wilc_wlan.c | 17 + 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/drivers/staging/wilc1000/wilc_wlan.c b/drivers/staging/wilc1000/wilc_wlan.c index 359df26..7db42c0 100644 --- a/drivers/staging/wilc1000/wilc_wlan.c +++ b/drivers/staging/wilc1000/wilc_wlan.c @@ -216,7 +216,7 @@ struct ack_session_info *Alloc_head; #define MAX_TCP_SESSION25 #define MAX_PENDING_ACKS 256 struct ack_session_info ack_session_info[2 * MAX_TCP_SESSION]; -struct pending_acks_info Pending_Acks_info[MAX_PENDING_ACKS]; +struct pending_acks_info pending_acks_info[MAX_PENDING_ACKS]; u32 PendingAcks_arrBase; u32 Opened_TCP_session; @@ -250,9 +250,9 @@ static inline int add_TCP_Pending_Ack(u32 Ack, u32 Session_index, struct txq_ent { total_acks++; if (Pending_Acks < MAX_PENDING_ACKS) { - Pending_Acks_info[PendingAcks_arrBase + Pending_Acks].ack_num = Ack; - Pending_Acks_info[PendingAcks_arrBase + Pending_Acks].txqe = txqe; - Pending_Acks_info[PendingAcks_arrBase + Pending_Acks].session_index = Session_index; + pending_acks_info[PendingAcks_arrBase + Pending_Acks].ack_num = Ack; + pending_acks_info[PendingAcks_arrBase + Pending_Acks].txqe = txqe; + pending_acks_info[PendingAcks_arrBase + Pending_Acks].session_index = Session_index; txqe->tcp_PendingAck_index = PendingAcks_arrBase + Pending_Acks; Pending_Acks++; } else { @@ -347,11 +347,12 @@ static int wilc_wlan_txq_filter_dup_tcp_ack(struct net_device *dev) spin_lock_irqsave(&wilc->txq_spinlock, p->txq_spinlock_flags); for (i = PendingAcks_arrBase; i < (PendingAcks_arrBase + Pending_Acks); i++) { - if (Pending_Acks_info[i].ack_num < ack_session_info[Pending_Acks_info[i].session_index].bigger_ack_num) { + if (pending_acks_info[i].ack_num < ack_session_info[pending_acks_info[i].session_index].bigger_ack_num) { struct txq_entry_t *tqe; - PRINT_D(TCP_ENH, "DROP ACK: %u\n", Pending_Acks_info[i].ack_num); - tqe = Pending_Acks_info[i].txqe; + PRINT_D(TCP_ENH, "DROP ACK: %u\n", + pending_acks_info[i].ack_num); + tqe = pending_acks_info[i].txqe; if (tqe) { wilc_wlan_txq_remove(tqe); dropped_acks++; @@ -910,7 +911,7 @@ int wilc_wlan_handle_txq(struct net_device *dev, u32 *pu32TxqCount) tqe->tx_complete_func(tqe->priv, tqe->status); #ifdef TCP_ACK_FILTER if (tqe->tcp_PendingAck_index != NOT_TCP_ACK) - Pending_Acks_info[tqe->tcp_PendingAck_index].txqe = NULL; + pending_acks_info[tqe->tcp_PendingAck_index].txqe = NULL; #endif kfree(tqe); } else { -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 24/73] staging: wilc1000: rename add_TCP_track_session function
From: Leo Kim This patch rename the add_TCP_track_session function to add_tcp_session to avoid CamelCase naming convention. Signed-off-by: Leo Kim Signed-off-by: Glen Lee --- drivers/staging/wilc1000/wilc_wlan.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/wilc1000/wilc_wlan.c b/drivers/staging/wilc1000/wilc_wlan.c index df0f5ce..75b35b8 100644 --- a/drivers/staging/wilc1000/wilc_wlan.c +++ b/drivers/staging/wilc1000/wilc_wlan.c @@ -227,7 +227,7 @@ static inline int init_tcp_tracking(void) return 0; } -static inline int add_TCP_track_session(u32 src_prt, u32 dst_prt, u32 seq) +static inline int add_tcp_session(u32 src_prt, u32 dst_prt, u32 seq) { ack_session_info[tcp_session].seq_num = seq; ack_session_info[tcp_session].bigger_ack_num = 0; @@ -319,7 +319,7 @@ static inline int tcp_process(struct net_device *dev, struct txq_entry_t *tqe) } } if (i == tcp_session) - add_TCP_track_session(0, 0, seq_no); + add_tcp_session(0, 0, seq_no); add_TCP_Pending_Ack(Ack_no, i, tqe); } -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 23/73] staging: wilc1000: rename Init_TCP_tracking function
From: Leo Kim This patch rename the Init_TCP_tracking function to init_tcp_tracking to avoid CamelCase naming convention. Signed-off-by: Leo Kim Signed-off-by: Glen Lee --- drivers/staging/wilc1000/wilc_wlan.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/wilc1000/wilc_wlan.c b/drivers/staging/wilc1000/wilc_wlan.c index df20d4d..df0f5ce 100644 --- a/drivers/staging/wilc1000/wilc_wlan.c +++ b/drivers/staging/wilc1000/wilc_wlan.c @@ -222,7 +222,7 @@ u32 pending_base; u32 tcp_session; u32 pending_acks; -static inline int Init_TCP_tracking(void) +static inline int init_tcp_tracking(void) { return 0; } @@ -1697,7 +1697,7 @@ int wilc_wlan_init(struct net_device *dev, wilc_wlan_inp_t *inp) goto _fail_; } #ifdef TCP_ACK_FILTER - Init_TCP_tracking(); + init_tcp_tracking(); #endif return 1; -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 26/73] staging: wilc1000: rename add_TCP_Pending_Ack function
From: Leo Kim This patch rename the add_TCP_Pending_Ack function to add_tcp_pending_ack to avoid CamelCase naming convention. Signed-off-by: Leo Kim Signed-off-by: Glen Lee --- drivers/staging/wilc1000/wilc_wlan.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/staging/wilc1000/wilc_wlan.c b/drivers/staging/wilc1000/wilc_wlan.c index c4312bb..3e62abd 100644 --- a/drivers/staging/wilc1000/wilc_wlan.c +++ b/drivers/staging/wilc1000/wilc_wlan.c @@ -246,7 +246,8 @@ static inline int update_tcp_session(u32 index, u32 Ack) return 0; } -static inline int add_TCP_Pending_Ack(u32 Ack, u32 Session_index, struct txq_entry_t *txqe) +static inline int add_tcp_pending_ack(u32 Ack, u32 Session_index, + struct txq_entry_t *txqe) { total_acks++; if (pending_acks < MAX_PENDING_ACKS) { @@ -321,7 +322,7 @@ static inline int tcp_process(struct net_device *dev, struct txq_entry_t *tqe) if (i == tcp_session) add_tcp_session(0, 0, seq_no); - add_TCP_Pending_Ack(Ack_no, i, tqe); + add_tcp_pending_ack(Ack_no, i, tqe); } } else { -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 25/73] staging: wilc1000: rename Update_TCP_track_session function
From: Leo Kim This patch rename the Update_TCP_track_session function to update_tcp_session to avoid CamelCase naming convention. Signed-off-by: Leo Kim Signed-off-by: Glen Lee --- drivers/staging/wilc1000/wilc_wlan.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/wilc1000/wilc_wlan.c b/drivers/staging/wilc1000/wilc_wlan.c index 75b35b8..c4312bb 100644 --- a/drivers/staging/wilc1000/wilc_wlan.c +++ b/drivers/staging/wilc1000/wilc_wlan.c @@ -239,7 +239,7 @@ static inline int add_tcp_session(u32 src_prt, u32 dst_prt, u32 seq) return 0; } -static inline int Update_TCP_track_session(u32 index, u32 Ack) +static inline int update_tcp_session(u32 index, u32 Ack) { if (Ack > ack_session_info[index].bigger_ack_num) ack_session_info[index].bigger_ack_num = Ack; @@ -314,7 +314,7 @@ static inline int tcp_process(struct net_device *dev, struct txq_entry_t *tqe) for (i = 0; i < tcp_session; i++) { if (ack_session_info[i].seq_num == seq_no) { - Update_TCP_track_session(i, Ack_no); + update_tcp_session(i, Ack_no); break; } } -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 22/73] staging: wilc1000: rename Pending_Acks variable
From: Leo Kim This patch rename the Pending_Acks variable to pending_acks to avoid CamelCase naming convention. Signed-off-by: Leo Kim Signed-off-by: Glen Lee --- drivers/staging/wilc1000/wilc_wlan.c | 18 +- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/drivers/staging/wilc1000/wilc_wlan.c b/drivers/staging/wilc1000/wilc_wlan.c index 34e1097..df20d4d 100644 --- a/drivers/staging/wilc1000/wilc_wlan.c +++ b/drivers/staging/wilc1000/wilc_wlan.c @@ -220,7 +220,7 @@ struct pending_acks_info pending_acks_info[MAX_PENDING_ACKS]; u32 pending_base; u32 tcp_session; -u32 Pending_Acks; +u32 pending_acks; static inline int Init_TCP_tracking(void) { @@ -249,12 +249,12 @@ static inline int Update_TCP_track_session(u32 index, u32 Ack) static inline int add_TCP_Pending_Ack(u32 Ack, u32 Session_index, struct txq_entry_t *txqe) { total_acks++; - if (Pending_Acks < MAX_PENDING_ACKS) { - pending_acks_info[pending_base + Pending_Acks].ack_num = Ack; - pending_acks_info[pending_base + Pending_Acks].txqe = txqe; - pending_acks_info[pending_base + Pending_Acks].session_index = Session_index; - txqe->tcp_PendingAck_index = pending_base + Pending_Acks; - Pending_Acks++; + if (pending_acks < MAX_PENDING_ACKS) { + pending_acks_info[pending_base + pending_acks].ack_num = Ack; + pending_acks_info[pending_base + pending_acks].txqe = txqe; + pending_acks_info[pending_base + pending_acks].session_index = Session_index; + txqe->tcp_PendingAck_index = pending_base + pending_acks; + pending_acks++; } else { } @@ -346,7 +346,7 @@ static int wilc_wlan_txq_filter_dup_tcp_ack(struct net_device *dev) wilc = nic->wilc; spin_lock_irqsave(&wilc->txq_spinlock, p->txq_spinlock_flags); - for (i = pending_base; i < (pending_base + Pending_Acks); i++) { + for (i = pending_base; i < (pending_base + pending_acks); i++) { if (pending_acks_info[i].ack_num < ack_session_info[pending_acks_info[i].session_index].bigger_ack_num) { struct txq_entry_t *tqe; @@ -364,7 +364,7 @@ static int wilc_wlan_txq_filter_dup_tcp_ack(struct net_device *dev) } } } - Pending_Acks = 0; + pending_acks = 0; tcp_session = 0; if (pending_base == 0) -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 21/73] staging: wilc1000: rename Opened_TCP_session variable
From: Leo Kim This patch rename the Opened_TCP_session variable to tcp_session to avoid CamelCase naming convention. Signed-off-by: Leo Kim Signed-off-by: Glen Lee --- drivers/staging/wilc1000/wilc_wlan.c | 20 ++-- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/drivers/staging/wilc1000/wilc_wlan.c b/drivers/staging/wilc1000/wilc_wlan.c index a1b6067..34e1097 100644 --- a/drivers/staging/wilc1000/wilc_wlan.c +++ b/drivers/staging/wilc1000/wilc_wlan.c @@ -219,7 +219,7 @@ struct ack_session_info ack_session_info[2 * MAX_TCP_SESSION]; struct pending_acks_info pending_acks_info[MAX_PENDING_ACKS]; u32 pending_base; -u32 Opened_TCP_session; +u32 tcp_session; u32 Pending_Acks; static inline int Init_TCP_tracking(void) @@ -229,13 +229,13 @@ static inline int Init_TCP_tracking(void) static inline int add_TCP_track_session(u32 src_prt, u32 dst_prt, u32 seq) { - ack_session_info[Opened_TCP_session].seq_num = seq; - ack_session_info[Opened_TCP_session].bigger_ack_num = 0; - ack_session_info[Opened_TCP_session].src_port = src_prt; - ack_session_info[Opened_TCP_session].dst_port = dst_prt; - Opened_TCP_session++; + ack_session_info[tcp_session].seq_num = seq; + ack_session_info[tcp_session].bigger_ack_num = 0; + ack_session_info[tcp_session].src_port = src_prt; + ack_session_info[tcp_session].dst_port = dst_prt; + tcp_session++; - PRINT_D(TCP_ENH, "TCP Session %d to Ack %d\n", Opened_TCP_session, seq); + PRINT_D(TCP_ENH, "TCP Session %d to Ack %d\n", tcp_session, seq); return 0; } @@ -312,13 +312,13 @@ static inline int tcp_process(struct net_device *dev, struct txq_entry_t *tqe) Ack_no = (((u32)tcp_hdr_ptr[8]) << 24) + (((u32)tcp_hdr_ptr[9]) << 16) + (((u32)tcp_hdr_ptr[10]) << 8) + ((u32)tcp_hdr_ptr[11]); - for (i = 0; i < Opened_TCP_session; i++) { + for (i = 0; i < tcp_session; i++) { if (ack_session_info[i].seq_num == seq_no) { Update_TCP_track_session(i, Ack_no); break; } } - if (i == Opened_TCP_session) + if (i == tcp_session) add_TCP_track_session(0, 0, seq_no); add_TCP_Pending_Ack(Ack_no, i, tqe); @@ -365,7 +365,7 @@ static int wilc_wlan_txq_filter_dup_tcp_ack(struct net_device *dev) } } Pending_Acks = 0; - Opened_TCP_session = 0; + tcp_session = 0; if (pending_base == 0) pending_base = MAX_TCP_SESSION; -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 28/73] staging: wilc1000: rename Session_index member variable
From: Leo Kim This patch rename the Ack Session_index variable to session_index to avoid CamelCase naming convention. Signed-off-by: Leo Kim Signed-off-by: Glen Lee --- drivers/staging/wilc1000/wilc_wlan.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/wilc1000/wilc_wlan.c b/drivers/staging/wilc1000/wilc_wlan.c index 58043dc..ce9f45c 100644 --- a/drivers/staging/wilc1000/wilc_wlan.c +++ b/drivers/staging/wilc1000/wilc_wlan.c @@ -246,14 +246,14 @@ static inline int update_tcp_session(u32 index, u32 ack) return 0; } -static inline int add_tcp_pending_ack(u32 ack, u32 Session_index, +static inline int add_tcp_pending_ack(u32 ack, u32 session_index, struct txq_entry_t *txqe) { total_acks++; if (pending_acks < MAX_PENDING_ACKS) { pending_acks_info[pending_base + pending_acks].ack_num = ack; pending_acks_info[pending_base + pending_acks].txqe = txqe; - pending_acks_info[pending_base + pending_acks].session_index = Session_index; + pending_acks_info[pending_base + pending_acks].session_index = session_index; txqe->tcp_PendingAck_index = pending_base + pending_acks; pending_acks++; } else { -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 35/73] staging: wilc1000: rename EnableTCPAckFilter variable
From: Leo Kim This patch rename the EnableTCPAckFilter variable to enabled to avoid CamelCase naming convention. Signed-off-by: Leo Kim Signed-off-by: Glen Lee --- drivers/staging/wilc1000/wilc_wlan.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/wilc1000/wilc_wlan.c b/drivers/staging/wilc1000/wilc_wlan.c index 283ab52..0bfd1bd 100644 --- a/drivers/staging/wilc1000/wilc_wlan.c +++ b/drivers/staging/wilc1000/wilc_wlan.c @@ -389,16 +389,16 @@ static int wilc_wlan_txq_filter_dup_tcp_ack(struct net_device *dev) } #endif -bool EnableTCPAckFilter = false; +bool enabled = false; void Enable_TCP_ACK_Filter(bool value) { - EnableTCPAckFilter = value; + enabled = value; } bool is_TCP_ACK_Filter_Enabled(void) { - return EnableTCPAckFilter; + return enabled; } static int wilc_wlan_txq_add_cfg_pkt(u8 *buffer, u32 buffer_size) -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 30/73] staging: wilc1000: rename Total_Length variable
From: Leo Kim This patch rename the Total_Length variable to total_length to avoid CamelCase naming convention. Signed-off-by: Leo Kim Signed-off-by: Glen Lee --- drivers/staging/wilc1000/wilc_wlan.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/staging/wilc1000/wilc_wlan.c b/drivers/staging/wilc1000/wilc_wlan.c index b07d229..34a8b47 100644 --- a/drivers/staging/wilc1000/wilc_wlan.c +++ b/drivers/staging/wilc1000/wilc_wlan.c @@ -298,13 +298,14 @@ static inline int tcp_process(struct net_device *dev, struct txq_entry_t *tqe) if (protocol == 0x06) { u8 *tcp_hdr_ptr; - u32 IHL, Total_Length, Data_offset; + u32 IHL, total_length, Data_offset; tcp_hdr_ptr = &ip_hdr_ptr[IP_HDR_LEN]; IHL = (ip_hdr_ptr[0] & 0xf) << 2; - Total_Length = (((u32)ip_hdr_ptr[2]) << 8) + ((u32)ip_hdr_ptr[3]); + total_length = ((u32)ip_hdr_ptr[2] << 8) + + (u32)ip_hdr_ptr[3]; Data_offset = (((u32)tcp_hdr_ptr[12] & 0xf0) >> 2); - if (Total_Length == (IHL + Data_offset)) { + if (total_length == (IHL + Data_offset)) { u32 seq_no, Ack_no; seq_no = (((u32)tcp_hdr_ptr[4]) << 24) + (((u32)tcp_hdr_ptr[5]) << 16) + (((u32)tcp_hdr_ptr[6]) << 8) + ((u32)tcp_hdr_ptr[7]); -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 33/73] staging: wilc1000: remove warnings line over 80 characters
From: Leo Kim This patch removes the warnings reported by checkpatch.pl for line over 80 characters. Signed-off-by: Leo Kim Signed-off-by: Glen Lee --- drivers/staging/wilc1000/wilc_wlan.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/staging/wilc1000/wilc_wlan.c b/drivers/staging/wilc1000/wilc_wlan.c index 52351c6..66d7f1e 100644 --- a/drivers/staging/wilc1000/wilc_wlan.c +++ b/drivers/staging/wilc1000/wilc_wlan.c @@ -308,7 +308,10 @@ static inline int tcp_process(struct net_device *dev, struct txq_entry_t *tqe) if (total_length == (IHL + data_offset)) { u32 seq_no, ack_no; - seq_no = (((u32)tcp_hdr_ptr[4]) << 24) + (((u32)tcp_hdr_ptr[5]) << 16) + (((u32)tcp_hdr_ptr[6]) << 8) + ((u32)tcp_hdr_ptr[7]); + seq_no = ((u32)tcp_hdr_ptr[4] << 24) + +((u32)tcp_hdr_ptr[5] << 16) + +((u32)tcp_hdr_ptr[6] << 8) + +(u32)tcp_hdr_ptr[7]; ack_no = ((u32)tcp_hdr_ptr[8] << 24) + ((u32)tcp_hdr_ptr[9] << 16) + -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 27/73] staging: wilc1000: rename Ack member variable
From: Leo Kim This patch rename the Ack member variable to ack to avoid CamelCase naming convention. Signed-off-by: Leo Kim Signed-off-by: Glen Lee --- drivers/staging/wilc1000/wilc_wlan.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/staging/wilc1000/wilc_wlan.c b/drivers/staging/wilc1000/wilc_wlan.c index 3e62abd..58043dc 100644 --- a/drivers/staging/wilc1000/wilc_wlan.c +++ b/drivers/staging/wilc1000/wilc_wlan.c @@ -239,19 +239,19 @@ static inline int add_tcp_session(u32 src_prt, u32 dst_prt, u32 seq) return 0; } -static inline int update_tcp_session(u32 index, u32 Ack) +static inline int update_tcp_session(u32 index, u32 ack) { - if (Ack > ack_session_info[index].bigger_ack_num) - ack_session_info[index].bigger_ack_num = Ack; + if (ack > ack_session_info[index].bigger_ack_num) + ack_session_info[index].bigger_ack_num = ack; return 0; } -static inline int add_tcp_pending_ack(u32 Ack, u32 Session_index, +static inline int add_tcp_pending_ack(u32 ack, u32 Session_index, struct txq_entry_t *txqe) { total_acks++; if (pending_acks < MAX_PENDING_ACKS) { - pending_acks_info[pending_base + pending_acks].ack_num = Ack; + pending_acks_info[pending_base + pending_acks].ack_num = ack; pending_acks_info[pending_base + pending_acks].txqe = txqe; pending_acks_info[pending_base + pending_acks].session_index = Session_index; txqe->tcp_PendingAck_index = pending_base + pending_acks; -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 34/73] staging: wilc1000: rename Dropped variable
From: Leo Kim This patch rename the Dropped variable to dropped to avoid CamelCase naming convention. Signed-off-by: Leo Kim Signed-off-by: Glen Lee --- drivers/staging/wilc1000/wilc_wlan.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/staging/wilc1000/wilc_wlan.c b/drivers/staging/wilc1000/wilc_wlan.c index 66d7f1e..283ab52 100644 --- a/drivers/staging/wilc1000/wilc_wlan.c +++ b/drivers/staging/wilc1000/wilc_wlan.c @@ -345,7 +345,7 @@ static int wilc_wlan_txq_filter_dup_tcp_ack(struct net_device *dev) perInterface_wlan_t *nic; struct wilc *wilc; u32 i = 0; - u32 Dropped = 0; + u32 dropped = 0; wilc_wlan_dev_t *p = &g_wlan; nic = netdev_priv(dev); @@ -366,7 +366,7 @@ static int wilc_wlan_txq_filter_dup_tcp_ack(struct net_device *dev) if (tqe->tx_complete_func) tqe->tx_complete_func(tqe->priv, tqe->status); kfree(tqe); - Dropped++; + dropped++; } } } @@ -380,9 +380,9 @@ static int wilc_wlan_txq_filter_dup_tcp_ack(struct net_device *dev) spin_unlock_irqrestore(&wilc->txq_spinlock, p->txq_spinlock_flags); - while (Dropped > 0) { + while (dropped > 0) { linux_wlan_lock_timeout(&wilc->txq_event, 1); - Dropped--; + dropped--; } return 1; -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 29/73] staging: wilc1000: remove do-nothing else condition case.
From: Leo Kim This patch removes do-nothing else condition case. Signed-off-by: Leo Kim Signed-off-by: Glen Lee --- drivers/staging/wilc1000/wilc_wlan.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/staging/wilc1000/wilc_wlan.c b/drivers/staging/wilc1000/wilc_wlan.c index ce9f45c..b07d229 100644 --- a/drivers/staging/wilc1000/wilc_wlan.c +++ b/drivers/staging/wilc1000/wilc_wlan.c @@ -256,8 +256,6 @@ static inline int add_tcp_pending_ack(u32 ack, u32 session_index, pending_acks_info[pending_base + pending_acks].session_index = session_index; txqe->tcp_PendingAck_index = pending_base + pending_acks; pending_acks++; - } else { - } return 0; } @@ -1630,7 +1628,6 @@ u32 wilc_get_chipid(u8 update) } else { tempchipid = 0x1002b2; } - } else { } chipid = tempchipid; -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 36/73] staging: wilc1000: rename Enable_TCP_ACK_Filter function
From: Leo Kim This patch rename the Enable_TCP_ACK_Filter function to enable_tcp_ack_filter to avoid CamelCase naming convention. Signed-off-by: Leo Kim Signed-off-by: Glen Lee --- drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 4 ++-- drivers/staging/wilc1000/wilc_wfi_cfgoperations.h | 2 +- drivers/staging/wilc1000/wilc_wlan.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c index 5291868..6f40522 100644 --- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c +++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c @@ -1570,9 +1570,9 @@ static int get_station(struct wiphy *wiphy, struct net_device *dev, if ((strStatistics.link_speed > TCP_ACK_FILTER_LINK_SPEED_THRESH) && (strStatistics.link_speed != DEFAULT_LINK_SPEED)) - Enable_TCP_ACK_Filter(true); + enable_tcp_ack_filter(true); else if (strStatistics.link_speed != DEFAULT_LINK_SPEED) - Enable_TCP_ACK_Filter(false); + enable_tcp_ack_filter(false); PRINT_D(CORECONFIG_DBG, "*** stats[%d][%d][%d][%d][%d]\n", sinfo->signal, sinfo->rx_packets, sinfo->tx_packets, sinfo->tx_failed, sinfo->txrate.legacy); diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.h b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.h index 39cd8e1..d7bdca1 100644 --- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.h +++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.h @@ -104,6 +104,6 @@ void wilc_mgmt_frame_register(struct wiphy *wiphy, struct wireless_dev *wdev, #define TCP_ACK_FILTER_LINK_SPEED_THRESH 54 #define DEFAULT_LINK_SPEED 72 -void Enable_TCP_ACK_Filter(bool value); +void enable_tcp_ack_filter(bool value); #endif diff --git a/drivers/staging/wilc1000/wilc_wlan.c b/drivers/staging/wilc1000/wilc_wlan.c index 0bfd1bd..53c5804 100644 --- a/drivers/staging/wilc1000/wilc_wlan.c +++ b/drivers/staging/wilc1000/wilc_wlan.c @@ -391,7 +391,7 @@ static int wilc_wlan_txq_filter_dup_tcp_ack(struct net_device *dev) bool enabled = false; -void Enable_TCP_ACK_Filter(bool value) +void enable_tcp_ack_filter(bool value) { enabled = value; } -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 32/73] staging: wilc1000: rename Ack_no variable
From: Leo Kim This patch rename the Ack_no variable to ack_no to avoid CamelCase naming convention. Signed-off-by: Leo Kim Signed-off-by: Glen Lee --- drivers/staging/wilc1000/wilc_wlan.c | 11 +++ 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/drivers/staging/wilc1000/wilc_wlan.c b/drivers/staging/wilc1000/wilc_wlan.c index 6d72e09..52351c6 100644 --- a/drivers/staging/wilc1000/wilc_wlan.c +++ b/drivers/staging/wilc1000/wilc_wlan.c @@ -306,22 +306,25 @@ static inline int tcp_process(struct net_device *dev, struct txq_entry_t *tqe) (u32)ip_hdr_ptr[3]; data_offset = ((u32)tcp_hdr_ptr[12] & 0xf0) >> 2; if (total_length == (IHL + data_offset)) { - u32 seq_no, Ack_no; + u32 seq_no, ack_no; seq_no = (((u32)tcp_hdr_ptr[4]) << 24) + (((u32)tcp_hdr_ptr[5]) << 16) + (((u32)tcp_hdr_ptr[6]) << 8) + ((u32)tcp_hdr_ptr[7]); - Ack_no = (((u32)tcp_hdr_ptr[8]) << 24) + (((u32)tcp_hdr_ptr[9]) << 16) + (((u32)tcp_hdr_ptr[10]) << 8) + ((u32)tcp_hdr_ptr[11]); + ack_no = ((u32)tcp_hdr_ptr[8] << 24) + +((u32)tcp_hdr_ptr[9] << 16) + +((u32)tcp_hdr_ptr[10] << 8) + +(u32)tcp_hdr_ptr[11]; for (i = 0; i < tcp_session; i++) { if (ack_session_info[i].seq_num == seq_no) { - update_tcp_session(i, Ack_no); + update_tcp_session(i, ack_no); break; } } if (i == tcp_session) add_tcp_session(0, 0, seq_no); - add_tcp_pending_ack(Ack_no, i, tqe); + add_tcp_pending_ack(ack_no, i, tqe); } } else { -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 31/73] staging: wilc1000: rename Data_offset variable
From: Leo Kim This patch rename the Data_offset variable to data_offset to avoid CamelCase naming convention. Signed-off-by: Leo Kim Signed-off-by: Glen Lee --- drivers/staging/wilc1000/wilc_wlan.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/wilc1000/wilc_wlan.c b/drivers/staging/wilc1000/wilc_wlan.c index 34a8b47..6d72e09 100644 --- a/drivers/staging/wilc1000/wilc_wlan.c +++ b/drivers/staging/wilc1000/wilc_wlan.c @@ -298,14 +298,14 @@ static inline int tcp_process(struct net_device *dev, struct txq_entry_t *tqe) if (protocol == 0x06) { u8 *tcp_hdr_ptr; - u32 IHL, total_length, Data_offset; + u32 IHL, total_length, data_offset; tcp_hdr_ptr = &ip_hdr_ptr[IP_HDR_LEN]; IHL = (ip_hdr_ptr[0] & 0xf) << 2; total_length = ((u32)ip_hdr_ptr[2] << 8) + (u32)ip_hdr_ptr[3]; - Data_offset = (((u32)tcp_hdr_ptr[12] & 0xf0) >> 2); - if (total_length == (IHL + Data_offset)) { + data_offset = ((u32)tcp_hdr_ptr[12] & 0xf0) >> 2; + if (total_length == (IHL + data_offset)) { u32 seq_no, Ack_no; seq_no = (((u32)tcp_hdr_ptr[4]) << 24) + (((u32)tcp_hdr_ptr[5]) << 16) + (((u32)tcp_hdr_ptr[6]) << 8) + ((u32)tcp_hdr_ptr[7]); -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 37/73] staging: wilc1000: rename is_TCP_ACK_Filter_Enabled function
From: Leo Kim This patch rename the is_TCP_ACK_Filter_Enabled function to is_tcp_ack_filter_enabled to avoid CamelCase naming convention. Signed-off-by: Leo Kim Signed-off-by: Glen Lee --- drivers/staging/wilc1000/wilc_wlan.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/wilc1000/wilc_wlan.c b/drivers/staging/wilc1000/wilc_wlan.c index 53c5804..78a4359 100644 --- a/drivers/staging/wilc1000/wilc_wlan.c +++ b/drivers/staging/wilc1000/wilc_wlan.c @@ -396,7 +396,7 @@ void enable_tcp_ack_filter(bool value) enabled = value; } -bool is_TCP_ACK_Filter_Enabled(void) +bool is_tcp_ack_filter_enabled(void) { return enabled; } @@ -456,7 +456,7 @@ int wilc_wlan_txq_add_net_pkt(struct net_device *dev, void *priv, u8 *buffer, PRINT_D(TX_DBG, "Adding mgmt packet at the Queue tail\n"); #ifdef TCP_ACK_FILTER tqe->tcp_PendingAck_index = NOT_TCP_ACK; - if (is_TCP_ACK_Filter_Enabled()) + if (is_tcp_ack_filter_enabled()) tcp_process(dev, tqe); #endif wilc_wlan_txq_add_to_tail(dev, tqe); -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 40/73] staging: wilc1000: rename pu32TxqCount in wilc_wlan_handle_txq function
From: Leo Kim This patch rename pu32TxqCount to txq_count that is second argument of wilc_wlan_handle_txq function to avoid camelcase. Signed-off-by: Leo Kim Signed-off-by: Glen Lee --- drivers/staging/wilc1000/wilc_wlan.c | 4 ++-- drivers/staging/wilc1000/wilc_wlan.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/wilc1000/wilc_wlan.c b/drivers/staging/wilc1000/wilc_wlan.c index 66d5d42..cffd720 100644 --- a/drivers/staging/wilc1000/wilc_wlan.c +++ b/drivers/staging/wilc1000/wilc_wlan.c @@ -695,7 +695,7 @@ void chip_sleep_manually(void) release_bus(RELEASE_ONLY); } -int wilc_wlan_handle_txq(struct net_device *dev, u32 *pu32TxqCount) +int wilc_wlan_handle_txq(struct net_device *dev, u32 *txq_count) { wilc_wlan_dev_t *p = (wilc_wlan_dev_t *)&g_wlan; int i, entries = 0; @@ -949,7 +949,7 @@ _end_: p->txq_exit = 1; PRINT_D(TX_DBG, "THREAD: Exiting txq\n"); - *pu32TxqCount = p->txq_entries; + *txq_count = p->txq_entries; return ret; } diff --git a/drivers/staging/wilc1000/wilc_wlan.h b/drivers/staging/wilc1000/wilc_wlan.h index de2fb7c..1eaac9a 100644 --- a/drivers/staging/wilc1000/wilc_wlan.h +++ b/drivers/staging/wilc1000/wilc_wlan.h @@ -300,7 +300,7 @@ int wilc_wlan_start(void); int wilc_wlan_stop(void); int wilc_wlan_txq_add_net_pkt(struct net_device *dev, void *priv, u8 *buffer, u32 buffer_size, wilc_tx_complete_func_t func); -int wilc_wlan_handle_txq(struct net_device *dev, u32 *pu32TxqCount); +int wilc_wlan_handle_txq(struct net_device *dev, u32 *txq_count); void wilc_handle_isr(void *wilc); void wilc_wlan_cleanup(struct net_device *dev); int wilc_wlan_cfg_set(int start, u32 wid, u8 *buffer, u32 buffer_size, -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 44/73] staging: wilc1000: rename bValue in set_machw_change_vir_if function
From: Leo Kim This patch rename bValue to value that is second argument of set_machw_change_vir_if function to avoid camelcase. Signed-off-by: Leo Kim Signed-off-by: Glen Lee --- drivers/staging/wilc1000/wilc_wfi_netdevice.h | 2 +- drivers/staging/wilc1000/wilc_wlan.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/wilc1000/wilc_wfi_netdevice.h b/drivers/staging/wilc1000/wilc_wfi_netdevice.h index 6f9da09..54ed723 100644 --- a/drivers/staging/wilc1000/wilc_wfi_netdevice.h +++ b/drivers/staging/wilc1000/wilc_wfi_netdevice.h @@ -217,7 +217,7 @@ void wl_wlan_cleanup(struct wilc *wilc); int wilc_netdev_init(struct wilc **wilc); void wilc1000_wlan_deinit(struct net_device *dev); void WILC_WFI_mgmt_rx(struct wilc *wilc, u8 *buff, u32 size); -u16 set_machw_change_vir_if(struct net_device *dev, bool bValue); +u16 set_machw_change_vir_if(struct net_device *dev, bool value); int linux_wlan_get_firmware(struct net_device *dev); int linux_wlan_set_bssid(struct net_device *wilc_netdev, u8 *bssid); #endif diff --git a/drivers/staging/wilc1000/wilc_wlan.c b/drivers/staging/wilc1000/wilc_wlan.c index c4118fe..458eef2b 100644 --- a/drivers/staging/wilc1000/wilc_wlan.c +++ b/drivers/staging/wilc1000/wilc_wlan.c @@ -1715,7 +1715,7 @@ _fail_: return ret; } -u16 set_machw_change_vir_if(struct net_device *dev, bool bValue) +u16 set_machw_change_vir_if(struct net_device *dev, bool value) { u16 ret; u32 reg; @@ -1730,7 +1730,7 @@ u16 set_machw_change_vir_if(struct net_device *dev, bool bValue) if (!ret) PRINT_ER("Error while Reading reg WILC_CHANGING_VIR_IF\n"); - if (bValue) + if (value) reg |= BIT(31); else reg &= ~BIT(31); -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 41/73] staging: wilc1000: fixes else should follow close brace '}'
From: Leo Kim This patch fixes the error reported by checkpatch.pl for else should follow close brace '}' Signed-off-by: Leo Kim Signed-off-by: Glen Lee --- drivers/staging/wilc1000/wilc_wlan.c | 10 +++--- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/drivers/staging/wilc1000/wilc_wlan.c b/drivers/staging/wilc1000/wilc_wlan.c index cffd720..ec5fc1d 100644 --- a/drivers/staging/wilc1000/wilc_wlan.c +++ b/drivers/staging/wilc1000/wilc_wlan.c @@ -898,14 +898,12 @@ int wilc_wlan_handle_txq(struct net_device *dev, u32 *txq_count) memcpy(&txb[offset], &header, 4); if (tqe->type == WILC_CFG_PKT) { buffer_offset = ETH_CONFIG_PKT_HDR_OFFSET; - } - else if (tqe->type == WILC_NET_PKT) { + } else if (tqe->type == WILC_NET_PKT) { char *pBSSID = ((struct tx_complete_data *)(tqe->priv))->pBssid; buffer_offset = ETH_ETHERNET_HDR_OFFSET; memcpy(&txb[offset + 4], pBSSID, 6); - } - else { + } else { buffer_offset = HOST_HDR_OFFSET; } @@ -1008,9 +1006,7 @@ static void wilc_wlan_handle_rxq(struct wilc *wilc) pkt_offset &= ~(IS_MANAGMEMENT | IS_MANAGMEMENT_CALLBACK | IS_MGMT_STATUS_SUCCES); WILC_WFI_mgmt_rx(wilc, &buffer[offset + HOST_HDR_OFFSET], pkt_len); - } - else - { + } else { if (!is_cfg_packet) { if (pkt_len > 0) { frmw_to_linux(wilc, -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 39/73] staging: wilc1000: remove unused argument of chip_sleep_manually function
From: Leo Kim This patch removes u32SleepTime that is second argument of chip_sleep_manually function because it is not used in this function. Remove argument in the function call also. Signed-off-by: Leo Kim Signed-off-by: Glen Lee --- drivers/staging/wilc1000/host_interface.c | 3 +-- drivers/staging/wilc1000/wilc_wlan.c | 2 +- drivers/staging/wilc1000/wilc_wlan.h | 1 + 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c index 84a2479..7014915 100644 --- a/drivers/staging/wilc1000/host_interface.c +++ b/drivers/staging/wilc1000/host_interface.c @@ -271,7 +271,6 @@ static struct host_if_drv *join_req_drv; static void *host_int_ParseJoinBssParam(tstrNetworkInfo *ptstrNetworkInfo); -extern void chip_sleep_manually(u32 u32SleepTime); extern int linux_wlan_get_num_conn_ifcs(void); static int add_handler_in_list(struct host_if_drv *handler) @@ -2906,7 +2905,7 @@ static int hostIFthread(void *pvArg) PRINT_D(HOSTINF_DBG, "scan completed successfully\n"); if (!linux_wlan_get_num_conn_ifcs()) - chip_sleep_manually(INFINITE_SLEEP_TIME); + chip_sleep_manually(); Handle_ScanDone(msg.drv, SCAN_EVENT_DONE); diff --git a/drivers/staging/wilc1000/wilc_wlan.c b/drivers/staging/wilc1000/wilc_wlan.c index 0c08a9a..66d5d42 100644 --- a/drivers/staging/wilc1000/wilc_wlan.c +++ b/drivers/staging/wilc1000/wilc_wlan.c @@ -680,7 +680,7 @@ static inline void chip_wakeup(void) chip_ps_state = CHIP_WAKEDUP; } #endif -void chip_sleep_manually(u32 u32SleepTime) +void chip_sleep_manually(void) { if (chip_ps_state != CHIP_WAKEDUP) return; diff --git a/drivers/staging/wilc1000/wilc_wlan.h b/drivers/staging/wilc1000/wilc_wlan.h index 2eb7e20..de2fb7c 100644 --- a/drivers/staging/wilc1000/wilc_wlan.h +++ b/drivers/staging/wilc1000/wilc_wlan.h @@ -309,4 +309,5 @@ int wilc_wlan_cfg_get(int start, u32 wid, int commit, u32 drvHandler); int wilc_wlan_cfg_get_val(u32 wid, u8 *buffer, u32 buffer_size); int wilc_wlan_txq_add_mgmt_pkt(struct net_device *dev, void *priv, u8 *buffer, u32 buffer_size, wilc_tx_complete_func_t func); +void chip_sleep_manually(void); #endif -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 38/73] staging: wilc1000: fixes a struct allocation to match coding standards
From: Leo Kim This patch fixes the checks reported by checkpatch.pl for prefer kmalloc(sizeof(*tqe)...) over kmalloc(sizeof(struct txq_entry_t)...) Signed-off-by: Leo Kim Signed-off-by: Glen Lee --- drivers/staging/wilc1000/wilc_wlan.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/wilc1000/wilc_wlan.c b/drivers/staging/wilc1000/wilc_wlan.c index 78a4359..0c08a9a 100644 --- a/drivers/staging/wilc1000/wilc_wlan.c +++ b/drivers/staging/wilc1000/wilc_wlan.c @@ -413,7 +413,7 @@ static int wilc_wlan_txq_add_cfg_pkt(u8 *buffer, u32 buffer_size) return 0; } - tqe = kmalloc(sizeof(struct txq_entry_t), GFP_ATOMIC); + tqe = kmalloc(sizeof(*tqe), GFP_ATOMIC); if (!tqe) { PRINT_ER("Failed to allocate memory\n"); return 0; @@ -443,7 +443,7 @@ int wilc_wlan_txq_add_net_pkt(struct net_device *dev, void *priv, u8 *buffer, if (p->quit) return 0; - tqe = kmalloc(sizeof(struct txq_entry_t), GFP_ATOMIC); + tqe = kmalloc(sizeof(*tqe), GFP_ATOMIC); if (!tqe) return 0; @@ -472,7 +472,7 @@ int wilc_wlan_txq_add_mgmt_pkt(struct net_device *dev, void *priv, u8 *buffer, if (p->quit) return 0; - tqe = kmalloc(sizeof(struct txq_entry_t), GFP_KERNEL); + tqe = kmalloc(sizeof(*tqe), GFP_KERNEL); if (!tqe) return 0; -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 42/73] staging: wilc1000: rename pBSSID variable
From: Leo Kim This patch rename the pBSSID variable to bssid to avoid CamelCase naming convention. Signed-off-by: Leo Kim Signed-off-by: Glen Lee --- drivers/staging/wilc1000/wilc_wlan.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/wilc1000/wilc_wlan.c b/drivers/staging/wilc1000/wilc_wlan.c index ec5fc1d..f1bb8af 100644 --- a/drivers/staging/wilc1000/wilc_wlan.c +++ b/drivers/staging/wilc1000/wilc_wlan.c @@ -899,10 +899,10 @@ int wilc_wlan_handle_txq(struct net_device *dev, u32 *txq_count) if (tqe->type == WILC_CFG_PKT) { buffer_offset = ETH_CONFIG_PKT_HDR_OFFSET; } else if (tqe->type == WILC_NET_PKT) { - char *pBSSID = ((struct tx_complete_data *)(tqe->priv))->pBssid; + char *bssid = ((struct tx_complete_data *)(tqe->priv))->pBssid; buffer_offset = ETH_ETHERNET_HDR_OFFSET; - memcpy(&txb[offset + 4], pBSSID, 6); + memcpy(&txb[offset + 4], bssid, 6); } else { buffer_offset = HOST_HDR_OFFSET; } -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 43/73] staging: wilc1000: fixes a struct allocation to match coding standards
From: Leo Kim This patch fixes the checks reported by checkpatch.pl for prefer kmalloc(sizeof(*rqe)...) over kmalloc(sizeof(struct rxq_entry_t)...) Signed-off-by: Leo Kim Signed-off-by: Glen Lee --- drivers/staging/wilc1000/wilc_wlan.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/wilc1000/wilc_wlan.c b/drivers/staging/wilc1000/wilc_wlan.c index f1bb8af..c4118fe 100644 --- a/drivers/staging/wilc1000/wilc_wlan.c +++ b/drivers/staging/wilc1000/wilc_wlan.c @@ -1132,7 +1132,7 @@ _end_: offset += size; p->rx_buffer_offset = offset; #endif - rqe = kmalloc(sizeof(struct rxq_entry_t), GFP_KERNEL); + rqe = kmalloc(sizeof(*rqe), GFP_KERNEL); if (rqe) { rqe->buffer = buffer; rqe->buffer_size = size; -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 45/73] staging: wilc1000: fixes braces {} should be used on all arms of this statement
From: Leo Kim This patch fixes the error reported by checkpatch.pl for braces {} should be used on all arms of this statement Signed-off-by: Leo Kim Signed-off-by: Glen Lee --- drivers/staging/wilc1000/wilc_wlan.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/wilc1000/wilc_wlan.c b/drivers/staging/wilc1000/wilc_wlan.c index 458eef2b..3b097c1 100644 --- a/drivers/staging/wilc1000/wilc_wlan.c +++ b/drivers/staging/wilc1000/wilc_wlan.c @@ -1104,9 +1104,9 @@ static void wilc_wlan_handle_isr_ext(struct wilc *wilc, u32 int_status) if (LINUX_RX_SIZE - offset < size) offset = 0; - if (p->rx_buffer) + if (p->rx_buffer) { buffer = &p->rx_buffer[offset]; - else { + } else { wilc_debug(N_ERR, "[wilc isr]: fail Rx Buffer is NULL...drop the packets (%d)\n", size); goto _end_; } -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 48/73] staging: wilc1000: rename drvHandler in wilc_wlan_cfg_set function
From: Leo Kim This patch rename drvHandler to drv_handler that is seventh argument of wilc_wlan_cfg_set function to avoid camelcase. Signed-off-by: Leo Kim Signed-off-by: Glen Lee --- drivers/staging/wilc1000/wilc_wlan.c | 4 ++-- drivers/staging/wilc1000/wilc_wlan.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/wilc1000/wilc_wlan.c b/drivers/staging/wilc1000/wilc_wlan.c index 2e1d9b8..f0a8131 100644 --- a/drivers/staging/wilc1000/wilc_wlan.c +++ b/drivers/staging/wilc1000/wilc_wlan.c @@ -1477,7 +1477,7 @@ static int wilc_wlan_cfg_commit(int type, u32 drv_handler) } int wilc_wlan_cfg_set(int start, u32 wid, u8 *buffer, u32 buffer_size, - int commit, u32 drvHandler) + int commit, u32 drv_handler) { wilc_wlan_dev_t *p = &g_wlan; u32 offset; @@ -1500,7 +1500,7 @@ int wilc_wlan_cfg_set(int start, u32 wid, u8 *buffer, u32 buffer_size, PRINT_D(RX_DBG, "Processing cfg_set()\n"); p->cfg_frame_in_use = 1; - if (wilc_wlan_cfg_commit(WILC_CFG_SET, drvHandler)) + if (wilc_wlan_cfg_commit(WILC_CFG_SET, drv_handler)) ret_size = 0; if (linux_wlan_lock_timeout(&g_linux_wlan->cfg_event, diff --git a/drivers/staging/wilc1000/wilc_wlan.h b/drivers/staging/wilc1000/wilc_wlan.h index 1eaac9a..03af19b 100644 --- a/drivers/staging/wilc1000/wilc_wlan.h +++ b/drivers/staging/wilc1000/wilc_wlan.h @@ -304,7 +304,7 @@ int wilc_wlan_handle_txq(struct net_device *dev, u32 *txq_count); void wilc_handle_isr(void *wilc); void wilc_wlan_cleanup(struct net_device *dev); int wilc_wlan_cfg_set(int start, u32 wid, u8 *buffer, u32 buffer_size, - int commit, u32 drvHandler); + int commit, u32 drv_handler); int wilc_wlan_cfg_get(int start, u32 wid, int commit, u32 drvHandler); int wilc_wlan_cfg_get_val(u32 wid, u8 *buffer, u32 buffer_size); int wilc_wlan_txq_add_mgmt_pkt(struct net_device *dev, void *priv, u8 *buffer, -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 47/73] staging: wilc1000: rename drvHandler in wilc_wlan_cfg_commit function
From: Leo Kim This patch rename drvHandler to drv_handler that is third argument of wilc_wlan_cfg_commit function to avoid camelcase. Signed-off-by: Leo Kim Signed-off-by: Glen Lee --- drivers/staging/wilc1000/wilc_wlan.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/wilc1000/wilc_wlan.c b/drivers/staging/wilc1000/wilc_wlan.c index d7834c5..2e1d9b8 100644 --- a/drivers/staging/wilc1000/wilc_wlan.c +++ b/drivers/staging/wilc1000/wilc_wlan.c @@ -1449,13 +1449,13 @@ void wilc_wlan_cleanup(struct net_device *dev) p->hif_func.hif_deinit(NULL); } -static int wilc_wlan_cfg_commit(int type, u32 drvHandler) +static int wilc_wlan_cfg_commit(int type, u32 drv_handler) { wilc_wlan_dev_t *p = &g_wlan; wilc_cfg_frame_t *cfg = &p->cfg_frame; int total_len = p->cfg_frame_offset + 4 + DRIVER_HANDLER_SIZE; int seq_no = p->cfg_seq_no % 256; - int driver_handler = (u32)drvHandler; + int driver_handler = (u32)drv_handler; if (type == WILC_CFG_SET) cfg->wid_header[0] = 'W'; -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 49/73] staging: wilc1000: rename drvHandler in wilc_wlan_cfg_get function
From: Leo Kim This patch rename drvHandler to drv_handler that is fifth argument of wilc_wlan_cfg_get function to avoid camelcase. Signed-off-by: Leo Kim Signed-off-by: Glen Lee --- drivers/staging/wilc1000/wilc_wlan.c | 4 ++-- drivers/staging/wilc1000/wilc_wlan.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/wilc1000/wilc_wlan.c b/drivers/staging/wilc1000/wilc_wlan.c index f0a8131..09029b6 100644 --- a/drivers/staging/wilc1000/wilc_wlan.c +++ b/drivers/staging/wilc1000/wilc_wlan.c @@ -1516,7 +1516,7 @@ int wilc_wlan_cfg_set(int start, u32 wid, u8 *buffer, u32 buffer_size, return ret_size; } -int wilc_wlan_cfg_get(int start, u32 wid, int commit, u32 drvHandler) +int wilc_wlan_cfg_get(int start, u32 wid, int commit, u32 drv_handler) { wilc_wlan_dev_t *p = &g_wlan; u32 offset; @@ -1536,7 +1536,7 @@ int wilc_wlan_cfg_get(int start, u32 wid, int commit, u32 drvHandler) if (commit) { p->cfg_frame_in_use = 1; - if (wilc_wlan_cfg_commit(WILC_CFG_QUERY, drvHandler)) + if (wilc_wlan_cfg_commit(WILC_CFG_QUERY, drv_handler)) ret_size = 0; if (linux_wlan_lock_timeout(&g_linux_wlan->cfg_event, diff --git a/drivers/staging/wilc1000/wilc_wlan.h b/drivers/staging/wilc1000/wilc_wlan.h index 03af19b..55e4f19 100644 --- a/drivers/staging/wilc1000/wilc_wlan.h +++ b/drivers/staging/wilc1000/wilc_wlan.h @@ -305,7 +305,7 @@ void wilc_handle_isr(void *wilc); void wilc_wlan_cleanup(struct net_device *dev); int wilc_wlan_cfg_set(int start, u32 wid, u8 *buffer, u32 buffer_size, int commit, u32 drv_handler); -int wilc_wlan_cfg_get(int start, u32 wid, int commit, u32 drvHandler); +int wilc_wlan_cfg_get(int start, u32 wid, int commit, u32 drv_handler); int wilc_wlan_cfg_get_val(u32 wid, u8 *buffer, u32 buffer_size); int wilc_wlan_txq_add_mgmt_pkt(struct net_device *dev, void *priv, u8 *buffer, u32 buffer_size, wilc_tx_complete_func_t func); -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 46/73] staging: wilc1000: fixes braces {} are not necessary for any arm of this statement
From: Leo Kim This patch fixes the warning reported by checkpatch.pl for braces {} are not necessary for any arm of this statement Signed-off-by: Leo Kim Signed-off-by: Glen Lee --- drivers/staging/wilc1000/wilc_wlan.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/staging/wilc1000/wilc_wlan.c b/drivers/staging/wilc1000/wilc_wlan.c index 3b097c1..d7834c5 100644 --- a/drivers/staging/wilc1000/wilc_wlan.c +++ b/drivers/staging/wilc1000/wilc_wlan.c @@ -1457,11 +1457,10 @@ static int wilc_wlan_cfg_commit(int type, u32 drvHandler) int seq_no = p->cfg_seq_no % 256; int driver_handler = (u32)drvHandler; - if (type == WILC_CFG_SET) { + if (type == WILC_CFG_SET) cfg->wid_header[0] = 'W'; - } else { + else cfg->wid_header[0] = 'Q'; - } cfg->wid_header[1] = seq_no; cfg->wid_header[2] = (u8)total_len; cfg->wid_header[3] = (u8)(total_len >> 8); -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 51/73] staging: wilc1000: fixes alignment should match open parenthesis
From: Leo Kim This patch fixes the checks reported by checkpatch.pl for alignment should match open parenthesis. Signed-off-by: Leo Kim Signed-off-by: Glen Lee --- drivers/staging/wilc1000/wilc_wlan.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/wilc1000/wilc_wlan.c b/drivers/staging/wilc1000/wilc_wlan.c index 7e7e77f..68158c9 100644 --- a/drivers/staging/wilc1000/wilc_wlan.c +++ b/drivers/staging/wilc1000/wilc_wlan.c @@ -244,7 +244,7 @@ static inline int update_tcp_session(u32 index, u32 ack) } static inline int add_tcp_pending_ack(u32 ack, u32 session_index, - struct txq_entry_t *txqe) + struct txq_entry_t *txqe) { total_acks++; if (pending_acks < MAX_PENDING_ACKS) { -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 50/73] staging: wilc1000: wilc_wlan.c: remove unused pointer variables
From: Leo Kim This patch removes unused two pointer variable. - Free_head - Alloc_head It's pointer variables unused inside code. Signed-off-by: Leo Kim Signed-off-by: Glen Lee --- drivers/staging/wilc1000/wilc_wlan.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/staging/wilc1000/wilc_wlan.c b/drivers/staging/wilc1000/wilc_wlan.c index 09029b6..7e7e77f 100644 --- a/drivers/staging/wilc1000/wilc_wlan.c +++ b/drivers/staging/wilc1000/wilc_wlan.c @@ -208,9 +208,6 @@ struct pending_acks_info { struct txq_entry_t *txqe; }; -struct ack_session_info *Free_head; -struct ack_session_info *Alloc_head; - #define NOT_TCP_ACK(-1) #define MAX_TCP_SESSION25 -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 52/73] staging: wilc1000: rename tcp_PendingAck_index of struct txq_entry_t
From: Leo Kim This patch renames tcp_PendingAck_index of struct txq_entry_t to index to avoid CamelCase naming convention. Signed-off-by: Leo Kim Signed-off-by: Glen Lee --- drivers/staging/wilc1000/wilc_wlan.c | 12 ++-- drivers/staging/wilc1000/wilc_wlan.h | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/staging/wilc1000/wilc_wlan.c b/drivers/staging/wilc1000/wilc_wlan.c index 68158c9..679ae7e 100644 --- a/drivers/staging/wilc1000/wilc_wlan.c +++ b/drivers/staging/wilc1000/wilc_wlan.c @@ -251,7 +251,7 @@ static inline int add_tcp_pending_ack(u32 ack, u32 session_index, pending_acks_info[pending_base + pending_acks].ack_num = ack; pending_acks_info[pending_base + pending_acks].txqe = txqe; pending_acks_info[pending_base + pending_acks].session_index = session_index; - txqe->tcp_PendingAck_index = pending_base + pending_acks; + txqe->index = pending_base + pending_acks; pending_acks++; } return 0; @@ -422,7 +422,7 @@ static int wilc_wlan_txq_add_cfg_pkt(u8 *buffer, u32 buffer_size) tqe->tx_complete_func = NULL; tqe->priv = NULL; #ifdef TCP_ACK_FILTER - tqe->tcp_PendingAck_index = NOT_TCP_ACK; + tqe->index = NOT_TCP_ACK; #endif PRINT_D(TX_DBG, "Adding the config packet at the Queue tail\n"); @@ -452,7 +452,7 @@ int wilc_wlan_txq_add_net_pkt(struct net_device *dev, void *priv, u8 *buffer, PRINT_D(TX_DBG, "Adding mgmt packet at the Queue tail\n"); #ifdef TCP_ACK_FILTER - tqe->tcp_PendingAck_index = NOT_TCP_ACK; + tqe->index = NOT_TCP_ACK; if (is_tcp_ack_filter_enabled()) tcp_process(dev, tqe); #endif @@ -479,7 +479,7 @@ int wilc_wlan_txq_add_mgmt_pkt(struct net_device *dev, void *priv, u8 *buffer, tqe->tx_complete_func = func; tqe->priv = priv; #ifdef TCP_ACK_FILTER - tqe->tcp_PendingAck_index = NOT_TCP_ACK; + tqe->index = NOT_TCP_ACK; #endif PRINT_D(TX_DBG, "Adding Network packet at the Queue tail\n"); wilc_wlan_txq_add_to_tail(dev, tqe); @@ -911,8 +911,8 @@ int wilc_wlan_handle_txq(struct net_device *dev, u32 *txq_count) if (tqe->tx_complete_func) tqe->tx_complete_func(tqe->priv, tqe->status); #ifdef TCP_ACK_FILTER - if (tqe->tcp_PendingAck_index != NOT_TCP_ACK) - pending_acks_info[tqe->tcp_PendingAck_index].txqe = NULL; + if (tqe->index != NOT_TCP_ACK) + pending_acks_info[tqe->index].txqe = NULL; #endif kfree(tqe); } else { diff --git a/drivers/staging/wilc1000/wilc_wlan.h b/drivers/staging/wilc1000/wilc_wlan.h index 55e4f19..ff852b4 100644 --- a/drivers/staging/wilc1000/wilc_wlan.h +++ b/drivers/staging/wilc1000/wilc_wlan.h @@ -231,7 +231,7 @@ struct txq_entry_t { struct txq_entry_t *next; struct txq_entry_t *prev; int type; - int tcp_PendingAck_index; + int index; u8 *buffer; int buffer_size; void *priv; -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 56/73] staging: wilc1000: replace numeric type to kernel error type
From: Leo Kim This patch replaces numeric type to generic type by kernel style. -5 -> -EIO -105 -> -ENOBUFS Signed-off-by: Leo Kim Signed-off-by: Glen Lee --- drivers/staging/wilc1000/wilc_wlan.c | 24 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/drivers/staging/wilc1000/wilc_wlan.c b/drivers/staging/wilc1000/wilc_wlan.c index ffe7baa..283c506 100644 --- a/drivers/staging/wilc1000/wilc_wlan.c +++ b/drivers/staging/wilc1000/wilc_wlan.c @@ -1194,7 +1194,7 @@ int wilc_wlan_firmware_download(const u8 *buffer, u32 buffer_size) dma_buffer = kmalloc(blksz, GFP_KERNEL); if (!dma_buffer) { - ret = -5; + ret = -EIO; PRINT_ER("Can't allocate buffer for firmware download IO error\n "); goto _fail_1; } @@ -1229,7 +1229,7 @@ int wilc_wlan_firmware_download(const u8 *buffer, u32 buffer_size) release_bus(RELEASE_ONLY); if (!ret) { - ret = -5; + ret = -EIO; PRINT_ER("Can't download firmware IO error\n "); goto _fail_; } @@ -1263,7 +1263,7 @@ int wilc_wlan_start(void) if (!ret) { wilc_debug(N_ERR, "[wilc start]: fail write reg vmm_core_cfg...\n"); release_bus(RELEASE_ONLY); - ret = -5; + ret = -EIO; return ret; } reg = 0; @@ -1298,7 +1298,7 @@ int wilc_wlan_start(void) if (!ret) { wilc_debug(N_ERR, "[wilc start]: fail write WILC_GP_REG_1 ...\n"); release_bus(RELEASE_ONLY); - ret = -5; + ret = -EIO; return ret; } @@ -1308,7 +1308,7 @@ int wilc_wlan_start(void) if (!ret) { wilc_debug(N_ERR, "[wilc start]: fail read reg 0x1000 ...\n"); release_bus(RELEASE_ONLY); - ret = -5; + ret = -EIO; return ret; } @@ -1661,7 +1661,7 @@ int wilc_wlan_init(struct net_device *dev, wilc_wlan_inp_t *inp) if ((inp->io_func.io_type & 0x1) == HIF_SDIO) { if (!hif_sdio.hif_init(inp, wilc_debug)) { - ret = -5; + ret = -EIO; goto _fail_; } memcpy((void *)&g_wlan.hif_func, &hif_sdio, @@ -1669,19 +1669,19 @@ int wilc_wlan_init(struct net_device *dev, wilc_wlan_inp_t *inp) } else { if ((inp->io_func.io_type & 0x1) == HIF_SPI) { if (!hif_spi.hif_init(inp, wilc_debug)) { - ret = -5; + ret = -EIO; goto _fail_; } memcpy((void *)&g_wlan.hif_func, &hif_spi, sizeof(wilc_hif_func_t)); } else { - ret = -5; + ret = -EIO; goto _fail_; } } if (!wilc_wlan_cfg_init(wilc_debug)) { - ret = -105; + ret = -ENOBUFS; goto _fail_; } @@ -1690,7 +1690,7 @@ int wilc_wlan_init(struct net_device *dev, wilc_wlan_inp_t *inp) PRINT_D(TX_DBG, "g_wlan.tx_buffer = %p\n", g_wlan.tx_buffer); if (!g_wlan.tx_buffer) { - ret = -105; + ret = -ENOBUFS; PRINT_ER("Can't allocate Tx Buffer"); goto _fail_; } @@ -1700,14 +1700,14 @@ int wilc_wlan_init(struct net_device *dev, wilc_wlan_inp_t *inp) g_wlan.rx_buffer = kmalloc(LINUX_RX_SIZE, GFP_KERNEL); PRINT_D(TX_DBG, "g_wlan.rx_buffer =%p\n", g_wlan.rx_buffer); if (!g_wlan.rx_buffer) { - ret = -105; + ret = -ENOBUFS; PRINT_ER("Can't allocate Rx Buffer"); goto _fail_; } #endif if (!init_chip(dev)) { - ret = -5; + ret = -EIO; goto _fail_; } #ifdef TCP_ACK_FILTER -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 55/73] staging: wilc1000: remove warnings line over 80 characters
From: Leo Kim This patch removes the warnings reported by checkpatch.pl for line over 80 characters. Signed-off-by: Leo Kim Signed-off-by: Glen Lee --- drivers/staging/wilc1000/wilc_wlan.c | 50 1 file changed, 34 insertions(+), 16 deletions(-) diff --git a/drivers/staging/wilc1000/wilc_wlan.c b/drivers/staging/wilc1000/wilc_wlan.c index 70d794b..ffe7baa 100644 --- a/drivers/staging/wilc1000/wilc_wlan.c +++ b/drivers/staging/wilc1000/wilc_wlan.c @@ -361,7 +361,8 @@ static int wilc_wlan_txq_filter_dup_tcp_ack(struct net_device *dev) dropped_acks++; tqe->status = 1; if (tqe->tx_complete_func) - tqe->tx_complete_func(tqe->priv, tqe->status); + tqe->tx_complete_func(tqe->priv, + tqe->status); kfree(tqe); dropped++; } @@ -747,7 +748,8 @@ int wilc_wlan_handle_txq(struct net_device *dev, u32 *txq_count) PRINT_D(TX_DBG, "VMM Size AFTER alignment = %d\n", vmm_sz); vmm_table[i] = vmm_sz / 4; - PRINT_D(TX_DBG, "VMMTable entry size = %d\n", vmm_table[i]); + PRINT_D(TX_DBG, "VMMTable entry size = %d\n", + vmm_table[i]); if (tqe->type == WILC_CFG_PKT) { vmm_table[i] |= BIT(10); @@ -883,7 +885,9 @@ int wilc_wlan_handle_txq(struct net_device *dev, u32 *txq_count) #endif vmm_sz = (vmm_table[i] & 0x3ff); vmm_sz *= 4; - header = (tqe->type << 31) | (tqe->buffer_size << 15) | vmm_sz; + header = (tqe->type << 31) | +(tqe->buffer_size << 15) | +vmm_sz; if (tqe->type == WILC_MGMT_PKT) header |= BIT(30); else @@ -904,12 +908,14 @@ int wilc_wlan_handle_txq(struct net_device *dev, u32 *txq_count) buffer_offset = HOST_HDR_OFFSET; } - memcpy(&txb[offset + buffer_offset], tqe->buffer, tqe->buffer_size); + memcpy(&txb[offset + buffer_offset], + tqe->buffer, tqe->buffer_size); offset += vmm_sz; i++; tqe->status = 1; if (tqe->tx_complete_func) - tqe->tx_complete_func(tqe->priv, tqe->status); + tqe->tx_complete_func(tqe->priv, + tqe->status); #ifdef TCP_ACK_FILTER if (tqe->index != NOT_TCP_ACK) pending_acks_info[tqe->index].txqe = NULL; @@ -970,7 +976,8 @@ static void wilc_wlan_handle_rxq(struct wilc *wilc) } buffer = rqe->buffer; size = rqe->buffer_size; - PRINT_D(RX_DBG, "rxQ entery Size = %d - Address = %p\n", size, buffer); + PRINT_D(RX_DBG, "rxQ entery Size = %d - Address = %p\n", + size, buffer); offset = 0; do { @@ -983,7 +990,8 @@ static void wilc_wlan_handle_rxq(struct wilc *wilc) #ifdef BIG_ENDIAN header = BYTE_SWAP(header); #endif - PRINT_D(RX_DBG, "Header = %04x - Offset = %d\n", header, offset); + PRINT_D(RX_DBG, "Header = %04x - Offset = %d\n", + header, offset); is_cfg_packet = (header >> 31) & 0x1; pkt_offset = (header >> 22) & 0x1ff; @@ -1000,7 +1008,9 @@ static void wilc_wlan_handle_rxq(struct wilc *wilc) #define IS_MGMT_STATUS_SUCCES 0x040 if (pkt_offset & IS_MANAGMEMENT) { - pkt_offset &= ~(IS_MANAGMEMENT | IS_MANAGMEMENT_CALLBACK | IS_MGMT_STATUS_SUCCES); + pkt_offset &= ~(IS_MANAGMEMENT | + IS_MANAGMEMENT_CALLBACK | + IS_MGMT_STATUS_SUCCES); WILC_WFI_mgmt_rx(wilc, &buffer[offset + HOST_HDR_OFFSET], pkt_len); } else { @@ -1356,22 +
[PATCH 57/73] staging: wilc1000: wilc_wlan.h: alignment defines
From: Leo Kim This patch fixes alignment of defines. Signed-off-by: Leo Kim Signed-off-by: Glen Lee --- drivers/staging/wilc1000/wilc_wlan.h | 292 ++- 1 file changed, 148 insertions(+), 144 deletions(-) diff --git a/drivers/staging/wilc1000/wilc_wlan.h b/drivers/staging/wilc1000/wilc_wlan.h index ff852b4..ba70630 100644 --- a/drivers/staging/wilc1000/wilc_wlan.h +++ b/drivers/staging/wilc1000/wilc_wlan.h @@ -3,7 +3,7 @@ -#define ISWILC1000(id) (((id & 0xf000) == 0x10) ? 1 : 0) +#define ISWILC1000(id) ((id & 0xf000) == 0x10 ? 1 : 0) / @@ -11,27 +11,30 @@ * Mac eth header length * / -#define DRIVER_HANDLER_SIZE 4 -#define MAX_MAC_HDR_LEN 26 /* QOS_MAC_HDR_LEN */ -#define SUB_MSDU_HEADER_LENGTH 14 -#define SNAP_HDR_LEN8 -#define ETHERNET_HDR_LEN 14 -#define WORD_ALIGNMENT_PAD0 - -#define ETH_ETHERNET_HDR_OFFSET (MAX_MAC_HDR_LEN + SUB_MSDU_HEADER_LENGTH + \ - SNAP_HDR_LEN - ETHERNET_HDR_LEN + WORD_ALIGNMENT_PAD) - -#define HOST_HDR_OFFSET4 -#define ETHERNET_HDR_LEN 14 -#define IP_HDR_LEN20 -#define IP_HDR_OFFSET ETHERNET_HDR_LEN -#define UDP_HDR_OFFSET(IP_HDR_LEN + IP_HDR_OFFSET) -#define UDP_HDR_LEN 8 -#define UDP_DATA_OFFSET (UDP_HDR_OFFSET + UDP_HDR_LEN) -#define ETH_CONFIG_PKT_HDR_LENUDP_DATA_OFFSET - -#define ETH_CONFIG_PKT_HDR_OFFSET (ETH_ETHERNET_HDR_OFFSET + \ - ETH_CONFIG_PKT_HDR_LEN) +#define DRIVER_HANDLER_SIZE4 +#define MAX_MAC_HDR_LEN26 /* QOS_MAC_HDR_LEN */ +#define SUB_MSDU_HEADER_LENGTH 14 +#define SNAP_HDR_LEN 8 +#define ETHERNET_HDR_LEN 14 +#define WORD_ALIGNMENT_PAD 0 + +#define ETH_ETHERNET_HDR_OFFSET(MAX_MAC_HDR_LEN + \ +SUB_MSDU_HEADER_LENGTH + \ +SNAP_HDR_LEN - \ +ETHERNET_HDR_LEN + \ +WORD_ALIGNMENT_PAD) + +#define HOST_HDR_OFFSET4 +#define ETHERNET_HDR_LEN 14 +#define IP_HDR_LEN 20 +#define IP_HDR_OFFSET ETHERNET_HDR_LEN +#define UDP_HDR_OFFSET (IP_HDR_LEN + IP_HDR_OFFSET) +#define UDP_HDR_LEN8 +#define UDP_DATA_OFFSET(UDP_HDR_OFFSET + UDP_HDR_LEN) +#define ETH_CONFIG_PKT_HDR_LEN UDP_DATA_OFFSET + +#define ETH_CONFIG_PKT_HDR_OFFSET (ETH_ETHERNET_HDR_OFFSET + \ +ETH_CONFIG_PKT_HDR_LEN) / * @@ -39,91 +42,92 @@ * / -#define BYTE_SWAP(val) val) & 0x00FF) << 24) + \ - (((val) & 0xFF00) << 8) + \ - (((val) & 0x00FF) >> 8) + \ - (((val) & 0xFF00) >> 24)) +#define BYTE_SWAP(val) (((val & 0x00FF) << 24) + \ +((val & 0xFF00) << 8) + \ +((val & 0x00FF) >> 8) + \ +((val & 0xFF00) >> 24)) / * * Register Defines * / -#define WILC_PERIPH_REG_BASE 0x1000 -#define WILC_CHANGING_VIR_IF (0x108c) -#define WILC_CHIPID(WILC_PERIPH_REG_BASE) -#define WILC_GLB_RESET_0 (WILC_PERIPH_REG_BASE + 0x400) -#define WILC_PIN_MUX_0 (WILC_PERIPH_REG_BASE + 0x408) -#define WILC_HOST_TX_CTRL (WILC_PERIPH_REG_BASE + 0x6c) -#define WILC_HOST_RX_CTRL_0 (WILC_PERIPH_REG_BASE + 0x70) -#define WILC_HOST_RX_CTRL_1 (WILC_PERIPH_REG_BASE + 0x74) -#define WILC_HOST_VMM_CTL (WILC_PERIPH_REG_BASE + 0x78) -#define WILC_HOST_RX_CTRL (WILC_PERIPH_REG_BASE + 0x80) -#define WILC_HOST_RX_EXTRA_SIZE(WILC_PERIPH_REG_BASE + 0x84) -#define WILC_HOST_TX_CTRL_1(WILC_PERIPH_REG_BASE + 0x88) -#define WILC_MISC (WILC_PERIPH_REG_BASE + 0x428) -#define WILC_INTR_REG_BASE (WILC_PERIPH_REG_BASE + 0xa00) -#define WILC_INTR_ENABLE (WILC_INTR_REG_BASE) -#define WILC_INTR2_ENABLE (WILC_INTR_REG_BASE + 4) - -#define WILC_INTR_POLARITY (WILC_INTR_REG_BASE + 0x10) -#define WILC_INTR_TYPE (WILC_INTR_REG_BASE + 0x20) -#define WILC_INTR_CLEAR (WILC_INTR_REG_BASE + 0x30) -#define WILC_INTR_STATUS (WILC_INTR_REG_BASE + 0x40) - -#define WILC_VMM_TBL_SIZE 64 -#define WILC_VMM_TX_TBL_BASE (0x150400) -#define WILC_VMM_RX_TBL_BASE (0x150500) - -#define WILC_VMM_BASE 0x15 -#define WILC_VMM_CORE_CTL (WILC_VMM_BASE) -#define WILC_VMM_TBL_CTL (WILC_VMM_BASE + 0x4
[PATCH 54/73] staging: wilc1000: fixes possible unnecessary 'out of memory' message
From: Leo Kim This patch fixes the warning reported by checkpatch.pl for possible unnecessary 'out of memory' message Signed-off-by: Leo Kim Signed-off-by: Glen Lee --- drivers/staging/wilc1000/wilc_wlan.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/staging/wilc1000/wilc_wlan.c b/drivers/staging/wilc1000/wilc_wlan.c index ba50605..70d794b 100644 --- a/drivers/staging/wilc1000/wilc_wlan.c +++ b/drivers/staging/wilc1000/wilc_wlan.c @@ -,7 +,6 @@ static void wilc_wlan_handle_isr_ext(struct wilc *wilc, u32 int_status) #else buffer = kmalloc(size, GFP_KERNEL); if (!buffer) { - wilc_debug(N_ERR, "[wilc isr]: fail alloc host memory...drop the packets (%d)\n", size); usleep_range(100 * 1000, 100 * 1000); goto _end_; } -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 58/73] staging: wilc1000: fixes prefer using the BIT macro
From: Leo Kim This patch fixes the warning reported by checkpatch.pl for prefer using the BIT macro. And, removes unnecessary bit increase defines. Signed-off-by: Leo Kim Signed-off-by: Glen Lee --- drivers/staging/wilc1000/wilc_wlan.h | 39 +--- 1 file changed, 14 insertions(+), 25 deletions(-) diff --git a/drivers/staging/wilc1000/wilc_wlan.h b/drivers/staging/wilc1000/wilc_wlan.h index ba70630..6ca2544 100644 --- a/drivers/staging/wilc1000/wilc_wlan.h +++ b/drivers/staging/wilc1000/wilc_wlan.h @@ -110,25 +110,14 @@ #define WILC_GP_REG_0 0x149c #define WILC_GP_REG_1 0x14a0 -#define rHAVE_SDIO_IRQ_GPIO_BIT0 -#define rHAVE_USE_PMU_BIT 1 -#define rHAVE_SLEEP_CLK_SRC_RTC_BIT2 -#define rHAVE_SLEEP_CLK_SRC_XO_BIT 3 -#define rHAVE_EXT_PA_INV_TX_RX_BIT 4 -#define rHAVE_LEGACY_RF_SETTINGS_BIT 5 -#define rHAVE_XTAL_24_BIT 6 -#define rHAVE_DISABLE_WILC_UART_BIT7 - - -#define WILC_HAVE_SDIO_IRQ_GPIO(1 << rHAVE_SDIO_IRQ_GPIO_BIT) -#define WILC_HAVE_USE_PMU (1 << rHAVE_USE_PMU_BIT) -#define WILC_HAVE_SLEEP_CLK_SRC_RTC(1 << rHAVE_SLEEP_CLK_SRC_RTC_BIT) -#define WILC_HAVE_SLEEP_CLK_SRC_XO (1 << rHAVE_SLEEP_CLK_SRC_XO_BIT) -#define WILC_HAVE_EXT_PA_INV_TX_RX (1 << rHAVE_EXT_PA_INV_TX_RX_BIT) -#define WILC_HAVE_LEGACY_RF_SETTINGS (1 << rHAVE_LEGACY_RF_SETTINGS_BIT) -#define WILC_HAVE_XTAL_24 (1 << rHAVE_XTAL_24_BIT) -#define WILC_HAVE_DISABLE_WILC_UART(1 << rHAVE_DISABLE_WILC_UART_BIT) - +#define WILC_HAVE_SDIO_IRQ_GPIOBIT(0) +#define WILC_HAVE_USE_PMU BIT(1) +#define WILC_HAVE_SLEEP_CLK_SRC_RTCBIT(2) +#define WILC_HAVE_SLEEP_CLK_SRC_XO BIT(3) +#define WILC_HAVE_EXT_PA_INV_TX_RX BIT(4) +#define WILC_HAVE_LEGACY_RF_SETTINGS BIT(5) +#define WILC_HAVE_XTAL_24 BIT(6) +#define WILC_HAVE_DISABLE_WILC_UARTBIT(7) / * @@ -171,12 +160,12 @@ /***/ #define IRG_FLAGS_OFFSET 16 #define IRQ_DMA_WD_CNT_MASK((1ul << IRG_FLAGS_OFFSET) - 1) -#define INT_0 (1 << IRG_FLAGS_OFFSET) -#define INT_1 (1 << (IRG_FLAGS_OFFSET + 1)) -#define INT_2 (1 << (IRG_FLAGS_OFFSET + 2)) -#define INT_3 (1 << (IRG_FLAGS_OFFSET + 3)) -#define INT_4 (1 << (IRG_FLAGS_OFFSET + 4)) -#define INT_5 (1 << (IRG_FLAGS_OFFSET + 5)) +#define INT_0 BIT(IRG_FLAGS_OFFSET) +#define INT_1 BIT(IRG_FLAGS_OFFSET + 1) +#define INT_2 BIT(IRG_FLAGS_OFFSET + 2) +#define INT_3 BIT(IRG_FLAGS_OFFSET + 3) +#define INT_4 BIT(IRG_FLAGS_OFFSET + 4) +#define INT_5 BIT(IRG_FLAGS_OFFSET + 5) #define MAX_NUM_INT6 /***/ -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel