Re: [PATCH 08/12] staging: dgap: tty.c: fixes ioctl param list
On Fri, Aug 23, 2013 at 4:23 PM, Dan Carpenter wrote: > On Wed, Aug 21, 2013 at 09:48:38PM -0400, Lidza Louina wrote: >> -static int dgap_tty_ioctl(struct tty_struct *tty, struct file *file, >> unsigned int cmd, >> +static int dgap_tty_ioctl(struct tty_struct *tty, unsigned int cmd, >> unsigned long arg) > > Btw, now that this file compiles I see it in my static checker runs. > > dgap_tty_ioctl() takes a lock but always returns before unlocking. > >> { >> struct board_t *bd; >> @@ -3423,41 +3423,6 @@ static int dgap_tty_ioctl(struct tty_struct *tty, >> struct file *file, unsigned in >> >> return(-ENOIOCTLCMD); > > In other words, these return statements should be breaks so we hit > the call to: > > DGNC_UNLOCK(ch->ch_lock, lock_flags); Okay I am going to fix that today. Thanks. =] ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: dgnc: cls_uart_struct: adds marker and changes vars' types for sparse
This patch removes these sparse warnings found in the cls.c file: warning: incorrect type in argument 1 (different address spaces) expected void const volatile [noderef] *addr got unsigned char volatile * warning: incorrect type in argument 2 (different address spaces) expected void volatile [noderef] *addr got unsigned char volatile * The variables passed to readb and writeb need to be of type u8 with a __iomem marker. These warnings were popping up everytime the readb and writeb functions were called with a cls_uart_struct variable. The change made to the driver.h file adds the marker to the cls_uart_struct and the changes in cls.h changes its variables' types. Signed-off-by: Lidza Louina --- drivers/staging/dgnc/dgnc_cls.h| 16 drivers/staging/dgnc/dgnc_driver.h | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/drivers/staging/dgnc/dgnc_cls.h b/drivers/staging/dgnc/dgnc_cls.h index a273385..ffe8535 100644 --- a/drivers/staging/dgnc/dgnc_cls.h +++ b/drivers/staging/dgnc/dgnc_cls.h @@ -36,14 +36,14 @@ / struct cls_uart_struct { - volatile uchar txrx;/* WR RHR/THR - Holding Reg */ - volatile uchar ier; /* WR IER - Interrupt Enable Reg */ - volatile uchar isr_fcr; /* WR ISR/FCR - Interrupt Status Reg/Fifo Control Reg */ - volatile uchar lcr; /* WR LCR - Line Control Reg */ - volatile uchar mcr; /* WR MCR - Modem Control Reg */ - volatile uchar lsr; /* WR LSR - Line Status Reg */ - volatile uchar msr; /* WR MSR - Modem Status Reg */ - volatile uchar spr; /* WR SPR - Scratch Pad Reg */ + u8 txrx;/* WR RHR/THR - Holding Reg */ + u8 ier; /* WR IER - Interrupt Enable Reg */ + u8 isr_fcr; /* WR ISR/FCR - Interrupt Status Reg/Fifo Control Reg */ + u8 lcr; /* WR LCR - Line Control Reg */ + u8 mcr; /* WR MCR - Modem Control Reg */ + u8 lsr; /* WR LSR - Line Status Reg */ + u8 msr; /* WR MSR - Modem Status Reg */ + u8 spr; /* WR SPR - Scratch Pad Reg */ }; /* Where to read the interrupt register (8bits) */ diff --git a/drivers/staging/dgnc/dgnc_driver.h b/drivers/staging/dgnc/dgnc_driver.h index 47bc781..6644e95 100644 --- a/drivers/staging/dgnc/dgnc_driver.h +++ b/drivers/staging/dgnc/dgnc_driver.h @@ -481,7 +481,7 @@ struct channel_t { uchar ch_mistat; /* FEP input modem status */ struct neo_uart_struct *ch_neo_uart;/* Pointer to the "mapped" UART struct */ - struct cls_uart_struct *ch_cls_uart;/* Pointer to the "mapped" UART struct */ + struct cls_uart_struct __iomem *ch_cls_uart;/* Pointer to the "mapped" UART struct */ uchar ch_cached_lsr; /* Cached value of the LSR register */ -- 1.8.1.2 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 03/24] Staging: winbond: mto: deleted extern functions
Deleted declaration of external functions that weren't used on this driver. Signed-off-by: Iker Pedrosa --- drivers/staging/winbond/mto.h | 4 1 file changed, 4 deletions(-) diff --git a/drivers/staging/winbond/mto.h b/drivers/staging/winbond/mto.h index 22bb264..8d41eed 100644 --- a/drivers/staging/winbond/mto.h +++ b/drivers/staging/winbond/mto.h @@ -129,10 +129,6 @@ extern u16 MTO_Frag_Th_Tbl[]; void MTO_Init(struct wbsoft_priv *); void MTO_SetTxCount(struct wbsoft_priv *adapter, u8 t0, u8 index); -extern void MTO_PeriodicTimerExpired(struct wbsoft_priv *); -extern void MTO_SetDTORateRange(struct wbsoft_priv *, u8 *, u8); -extern u8 MTO_GetTxRate(struct wbsoft_priv *adapter, u32 fpdu_len); -extern u8 MTO_GetTxFallbackRate(struct wbsoft_priv *adapter); #endif /* __MTO_H__ */ -- 1.8.1.2 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 00/24] Staging: winbond: Fixed some coding style issues
Fixes some coding style issues from drivers/staging/winbond Iker Pedrosa (24): Staging: winbond: mto: removed function declaration Staging: winbond: mto: avoided use of extern functions Staging: winbond: mto: deleted extern functions Staging: winbond: phy_calibration: fixed some lines over 80 characters Staging: winbond: phy_calibration: fixed some lines over 80 characters Staging: winbond: reg: erased trailing whitespace Staging: winbond: reg: white space deleted Staging: winbond: reg: changed sleep function from msleep to usleep Staging: winbond: reg: fixed some lines over 80 characters Staging: winbond: reg: fixed some lines over 80 characters Staging: winbond: reg: fixed some lines over 80 characters Staging: winbond: reg: fixed some lines over 80 characters Staging: winbond: reg: fixed some lines over 80 characters Staging: winbond: reg: fixed some lines over 80 characters Staging: winbond: reg: fixed some lines over 80 characters Staging: winbond: wb35reg_f: fixed lines over 80 characters Staging: winbond: wb35reg_s: deleted space before tabulation Staging: winbond: wb35rx: changed sleep function from msleep to usleep Staging: winbond: wb35rx: fixed some lines over 80 characters Staging: winbond: wb35tx: changed sleep function from msleep to usleep Staging: winbond: wb35tx: Replace printk with netdev_err Staging: winbond: wb35tx_s: erased the spaces after opening a '[' Staging: winbond: wbusb: fixed some lines over 80 characters Staging: winbond: wbusb: changed sleep function from msleep to usleep drivers/staging/winbond/mto.c | 7 +- drivers/staging/winbond/mto.h | 8 +- drivers/staging/winbond/phy_calibration.c | 58 --- drivers/staging/winbond/reg.c | 274 ++ drivers/staging/winbond/wb35reg_f.h | 18 +- drivers/staging/winbond/wb35reg_s.h | 2 +- drivers/staging/winbond/wb35rx.c | 11 +- drivers/staging/winbond/wb35tx.c | 12 +- drivers/staging/winbond/wb35tx_s.h| 2 +- drivers/staging/winbond/wbusb.c | 18 +- 10 files changed, 245 insertions(+), 165 deletions(-) -- 1.8.1.2 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 05/24] Staging: winbond: phy_calibration: fixed some lines over 80 characters
Second of the patches that fixes the lines over 80 characters in phy_calibration.c Signed-off-by: Iker Pedrosa --- drivers/staging/winbond/phy_calibration.c | 12 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/staging/winbond/phy_calibration.c b/drivers/staging/winbond/phy_calibration.c index 6635c85..a4f3773 100644 --- a/drivers/staging/winbond/phy_calibration.c +++ b/drivers/staging/winbond/phy_calibration.c @@ -1233,8 +1233,10 @@ u8 _rx_iq_calibration_loop_winbond(struct hw_data *phw_data, u16 factor, u32 fre b_2 = (rot_image_q_b * 32768) / rot_tone_i_b - phw_data->iq_rsdl_phase_tx_d2; - PHY_DEBUG(("[CAL]** iq_rsdl_gain_tx_d2 = %d\n", phw_data->iq_rsdl_gain_tx_d2)); - PHY_DEBUG(("[CAL]** iq_rsdl_phase_tx_d2= %d\n", phw_data->iq_rsdl_phase_tx_d2)); + PHY_DEBUG(("[CAL]** iq_rsdl_gain_tx_d2 = %d\n", + phw_data->iq_rsdl_gain_tx_d2)); + PHY_DEBUG(("[CAL]** iq_rsdl_phase_tx_d2= %d\n", + phw_data->iq_rsdl_phase_tx_d2)); PHY_DEBUG(("[CAL]* EPSILON/2 = %d\n", a_2)); PHY_DEBUG(("[CAL]* THETA/2 = %d\n", b_2)); @@ -1280,7 +1282,8 @@ u8 _rx_iq_calibration_loop_winbond(struct hw_data *phw_data, u16 factor, u32 fre /* e. */ pwr_tone = (iqcal_tone_i*iqcal_tone_i + iqcal_tone_q*iqcal_tone_q); - pwr_image = (iqcal_image_i*iqcal_image_i + iqcal_image_q*iqcal_image_q)*factor; + pwr_image = (iqcal_image_i*iqcal_image_i + + iqcal_image_q*iqcal_image_q)*factor; PHY_DEBUG(("[CAL]** pwr_tone = %d\n", pwr_tone)); PHY_DEBUG(("[CAL]** pwr_image = %d\n", pwr_image)); @@ -1577,7 +1580,8 @@ unsigned char adjust_TXVGA_for_iq_mag(struct hw_data *phw_data) sqsum = iqcal_tone_i0*iqcal_tone_i0 + iqcal_tone_q0*iqcal_tone_q0; iq_mag_0_tx = (s32) _sqrt(sqsum); - PHY_DEBUG(("[CAL]** auto_adjust_txvga_for_iq_mag_0_tx=%d\n", iq_mag_0_tx)); + PHY_DEBUG(("[CAL]** auto_adjust_txvga_for_iq_mag_0_tx=%d\n", + iq_mag_0_tx)); if (iq_mag_0_tx >= 700 && iq_mag_0_tx <= 1750) break; -- 1.8.1.2 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 06/24] Staging: winbond: reg: erased trailing whitespace
Erased all the errors given by checkpatch stating trailing whitespace. Signed-off-by: Iker Pedrosa --- drivers/staging/winbond/reg.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/staging/winbond/reg.c b/drivers/staging/winbond/reg.c index 75b7752..5883d23 100644 --- a/drivers/staging/winbond/reg.c +++ b/drivers/staging/winbond/reg.c @@ -920,7 +920,7 @@ void Uxx_power_on_procedure(struct hw_data *pHwData) Wb35Reg_WriteSync(pHwData, 0x03f8, 0x7ff); } -static void Set_ChanIndep_RfData_al7230_24(struct hw_data *pHwData, u32 *pltmp, +static void Set_ChanIndep_RfData_al7230_24(struct hw_data *pHwData, u32 *pltmp, char number) { u8 i; @@ -930,7 +930,7 @@ static void Set_ChanIndep_RfData_al7230_24(struct hw_data *pHwData, u32 *pltmp, } } -static void Set_ChanIndep_RfData_al7230_50(struct hw_data *pHwData, u32 *pltmp, +static void Set_ChanIndep_RfData_al7230_50(struct hw_data *pHwData, u32 *pltmp, char number) { u8 i; @@ -1620,13 +1620,13 @@ void BBProcessor_initial(struct hw_data *pHwData) reg->SQ3_filter[i] = 0x2f; /* half of Bit 0 ~ 6 */ } -static inline void set_tx_power_per_channel_max2829(struct hw_data *pHwData, +static inline void set_tx_power_per_channel_max2829(struct hw_data *pHwData, struct chan_info Channel) { RFSynthesizer_SetPowerIndex(pHwData, 100); } -static void set_tx_power_per_channel_al2230(struct hw_data *pHwData, +static void set_tx_power_per_channel_al2230(struct hw_data *pHwData, struct chan_info Channel) { u8 index = 100; @@ -1636,7 +1636,7 @@ static void set_tx_power_per_channel_al2230(struct hw_data *pHwData, RFSynthesizer_SetPowerIndex(pHwData, index); } -static void set_tx_power_per_channel_al7230(struct hw_data *pHwData, +static void set_tx_power_per_channel_al7230(struct hw_data *pHwData, struct chan_info Channel) { u8 i, index = 100; @@ -1660,7 +1660,7 @@ static void set_tx_power_per_channel_al7230(struct hw_data *pHwData, RFSynthesizer_SetPowerIndex(pHwData, index); } -static void set_tx_power_per_channel_wb242(struct hw_data *pHwData, +static void set_tx_power_per_channel_wb242(struct hw_data *pHwData, struct chan_info Channel) { u8 index = 100; -- 1.8.1.2 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 01/24] Staging: winbond: mto: removed function declaration
The following function declarations have been removed because they aren't implemented. Signed-off-by: Iker Pedrosa --- drivers/staging/winbond/mto.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/staging/winbond/mto.c b/drivers/staging/winbond/mto.c index 560c0ab..0d0f9fb 100644 --- a/drivers/staging/winbond/mto.c +++ b/drivers/staging/winbond/mto.c @@ -46,10 +46,7 @@ static int retryrate_rec[MTO_MAX_DATA_RATE_LEVELS]; static u8 boSparseTxTraffic; void MTO_Init(struct wbsoft_priv *adapter); -void TxRateReductionCtrl(struct wbsoft_priv *adapter); void MTO_SetTxCount(struct wbsoft_priv *adapter, u8 t0, u8 index); -void MTO_TxFailed(struct wbsoft_priv *adapter); -void hal_get_dto_para(struct wbsoft_priv *adapter, char *buffer); /* * === -- 1.8.1.2 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 20/24] Staging: winbond: wb35tx: changed sleep function from msleep to usleep
According to the documentation it is not recommended to use msleep for 1ms - 20ms because it may sleep longer than 20ms. So, it is recommended to use usleep instead. Signed-off-by: Iker Pedrosa --- drivers/staging/winbond/wb35tx.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/winbond/wb35tx.c b/drivers/staging/winbond/wb35tx.c index 30a77cc..8c25cbd 100644 --- a/drivers/staging/winbond/wb35tx.c +++ b/drivers/staging/winbond/wb35tx.c @@ -166,9 +166,9 @@ void Wb35Tx_destroy(struct hw_data *pHwData) /* Wait for VM stop */ do { - msleep(10); /* Delay for waiting function enter 940623.1.a */ + usleep(1); /* Delay for waiting function enter 940623.1.a */ } while ((pWb35Tx->EP2vm_state != VM_STOP) && (pWb35Tx->EP4vm_state != VM_STOP)); - msleep(10); /* Delay for waiting function enter 940623.1.b */ + usleep(1); /* Delay for waiting function enter 940623.1.b */ usb_free_urb(pWb35Tx->Tx4Urb); usb_free_urb(pWb35Tx->Tx2Urb); -- 1.8.1.2 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 10/24] Staging: winbond: reg: fixed some lines over 80 characters
Second of the patches that fixes the lines over 80 characters in reg.c Signed-off-by: Iker Pedrosa --- drivers/staging/winbond/reg.c | 30 -- 1 file changed, 20 insertions(+), 10 deletions(-) diff --git a/drivers/staging/winbond/reg.c b/drivers/staging/winbond/reg.c index b1d977a..300038a 100644 --- a/drivers/staging/winbond/reg.c +++ b/drivers/staging/winbond/reg.c @@ -974,42 +974,48 @@ void RFSynthesizer_initial(struct hw_data *pHwData) number = ARRAY_SIZE(max2825_rf_data); for (i = 0; i < number; i++) { pHwData->phy_para[i] = max2825_rf_data[i]; /* Backup Rf parameter */ - pltmp[i] = (1 << 31) | (0 << 30) | (18 << 24) | BitReverse(max2825_rf_data[i], 18); + pltmp[i] = (1 << 31) | (0 << 30) | (18 << 24) + | BitReverse(max2825_rf_data[i], 18); } break; case RF_MAXIM_2827: number = ARRAY_SIZE(max2827_rf_data); for (i = 0; i < number; i++) { pHwData->phy_para[i] = max2827_rf_data[i]; - pltmp[i] = (1 << 31) | (0 << 30) | (18 << 24) | BitReverse(max2827_rf_data[i], 18); + pltmp[i] = (1 << 31) | (0 << 30) | (18 << 24) + | BitReverse(max2827_rf_data[i], 18); } break; case RF_MAXIM_2828: number = ARRAY_SIZE(max2828_rf_data); for (i = 0; i < number; i++) { pHwData->phy_para[i] = max2828_rf_data[i]; - pltmp[i] = (1 << 31) | (0 << 30) | (18 << 24) | BitReverse(max2828_rf_data[i], 18); + pltmp[i] = (1 << 31) | (0 << 30) | (18 << 24) + | BitReverse(max2828_rf_data[i], 18); } break; case RF_MAXIM_2829: number = ARRAY_SIZE(max2829_rf_data); for (i = 0; i < number; i++) { pHwData->phy_para[i] = max2829_rf_data[i]; - pltmp[i] = (1 << 31) | (0 << 30) | (18 << 24) | BitReverse(max2829_rf_data[i], 18); + pltmp[i] = (1 << 31) | (0 << 30) | (18 << 24) + | BitReverse(max2829_rf_data[i], 18); } break; case RF_AIROHA_2230: number = ARRAY_SIZE(al2230_rf_data); for (i = 0; i < number; i++) { pHwData->phy_para[i] = al2230_rf_data[i]; - pltmp[i] = (1 << 31) | (0 << 30) | (20 << 24) | BitReverse(al2230_rf_data[i], 20); + pltmp[i] = (1 << 31) | (0 << 30) | (20 << 24) + | BitReverse(al2230_rf_data[i], 20); } break; case RF_AIROHA_2230S: number = ARRAY_SIZE(al2230s_rf_data); for (i = 0; i < number; i++) { pHwData->phy_para[i] = al2230s_rf_data[i]; - pltmp[i] = (1 << 31) | (0 << 30) | (20 << 24) | BitReverse(al2230s_rf_data[i], 20); + pltmp[i] = (1 << 31) | (0 << 30) | (20 << 24) + | BitReverse(al2230s_rf_data[i], 20); } break; case RF_AIROHA_7230: @@ -1030,7 +1036,8 @@ void RFSynthesizer_initial(struct hw_data *pHwData) } pHwData->phy_para[i] = ltmp; - pltmp[i] = (1 << 31) | (0 << 30) | (24 << 24) | BitReverse(ltmp, 24); + pltmp[i] = (1 << 31) | (0 << 30) | (24 << 24) + | BitReverse(ltmp, 24); } break; } @@ -1057,10 +1064,12 @@ void RFSynthesizer_initial(struct hw_data *pHwData) switch (pHwData->phy_type) { case RF_AIROHA_2230: - ltmp = (1 << 31) | (0 << 30) | (20 << 24) | BitReverse((0x07 << 20) | 0xE168E, 20); + ltmp = (1 << 31) | (0 << 30) | (20 << 24) + | BitReverse((0x07 << 20) | 0xE168E, 20); Wb35Reg_WriteSync(pHwData, 0x0864, ltmp); usleep(1); - ltmp = (1 << 31) | (0 << 30) | (20 << 24) | BitReverse(al2230_rf_data[7], 20); + ltmp = (1 << 31) | (0 << 30) | (20 << 24) + | BitReverse(al2230_rf_data[7], 20); Wb35Reg_WriteSync(pHwData, 0x0864, ltmp); usleep(1); case RF_AIROHA_2230S: @@ -1074,7 +1083,8 @@ void RFSynthesizer_initial(struct hw_data *pHwData) /* = */ /* The follow code doesn't use the burst-write mode */ - ltmp = (1 << 31) | (0 << 30)
[PATCH 12/24] Staging: winbond: reg: fixed some lines over 80 characters
Fourth of the patches that fixes the lines over 80 characters in reg.c Signed-off-by: Iker Pedrosa --- drivers/staging/winbond/reg.c | 33 ++--- 1 file changed, 22 insertions(+), 11 deletions(-) diff --git a/drivers/staging/winbond/reg.c b/drivers/staging/winbond/reg.c index 0cb0798..acdc003 100644 --- a/drivers/staging/winbond/reg.c +++ b/drivers/staging/winbond/reg.c @@ -1197,46 +1197,57 @@ void RFSynthesizer_initial(struct hw_data *pHwData) /* - Calibration (3). RX baseband Gm-C filter auto-tuning */ /* Calibration (3a). turn off ENCAL signal */ - ltmp = (1 << 31) | (0 << 30) | (24 << 24) | BitReverse((0x00<<24) | 0xFAEDC0, 24); + ltmp = (1 << 31) | (0 << 30) | (24 << 24) + | BitReverse((0x00<<24) | 0xFAEDC0, 24); Wb35Reg_WriteSync(pHwData, 0x0864, ltmp); /* Calibration (3b.0). RX filter auto-tuning BW: RFLBW=100 (TC5376A+corner default;) */ - ltmp = (1 << 31) | (0 << 30) | (24 << 24) | BitReverse((0x07<<24) | 0x0C68CE, 24); + ltmp = (1 << 31) | (0 << 30) | (24 << 24) + | BitReverse((0x07<<24) | 0x0C68CE, 24); Wb35Reg_WriteSync(pHwData, 0x0864, ltmp); /* Calibration (3b). send RX reset signal */ - ltmp = (1 << 31) | (0 << 30) | (24 << 24) | BitReverse((0x0F<<24) | 0x00401E, 24); + ltmp = (1 << 31) | (0 << 30) | (24 << 24) + | BitReverse((0x0F<<24) | 0x00401E, 24); Wb35Reg_WriteSync(pHwData, 0x0864, ltmp); /* Calibration (3c). turn-on RX Gm-C filter auto-tuning */ - ltmp = (1 << 31) | (0 << 30) | (24 << 24) | BitReverse((0x00<<24) | 0xFEEDC0, 24); + ltmp = (1 << 31) | (0 << 30) | (24 << 24) + | BitReverse((0x00<<24) | 0xFEEDC0, 24); Wb35Reg_WriteSync(pHwData, 0x0864, ltmp); udelay(150); /* Sleep 150 us */ /* Calibration (3e). turn off ENCAL signal */ - ltmp = (1 << 31) | (0 << 30) | (24 << 24) | BitReverse((0x00<<24) | 0xFAEDC0, 24); + ltmp = (1 << 31) | (0 << 30) | (24 << 24) + | BitReverse((0x00<<24) | 0xFAEDC0, 24); Wb35Reg_WriteSync(pHwData, 0x0864, ltmp); /* - Calibration (4). TX LO leakage calibration */ /* Calibration (4a). TX LO leakage calibration */ - ltmp = (1 << 31) | (0 << 30) | (24 << 24) | BitReverse((0x00<<24) | 0xFD6BC0, 24); + ltmp = (1 << 31) | (0 << 30) | (24 << 24) + | BitReverse((0x00<<24) | 0xFD6BC0, 24); Wb35Reg_WriteSync(pHwData, 0x0864, ltmp); udelay(150); /* Sleep 150 us */ /* - Calibration (5). RX DC offset calibration */ /* Calibration (5a). turn off ENCAL signal and set to RX SW DC calibration mode */ - ltmp = (1 << 31) | (0 << 30) | (24 << 24) | BitReverse((0x00<<24) | 0xFAEDC0, 24); + ltmp = (1 << 31) | (0 << 30) | (24 << 24) + | BitReverse((0x00<<24) | 0xFAEDC0, 24); Wb35Reg_WriteSync(pHwData, 0x0864, ltmp); /* Calibration (5b). turn off AGC servo-loop & RSSI */ - ltmp = (1 << 31) | (0 << 30) | (24 << 24) | BitReverse((0x01<<24) | 0xEBFFC2, 24); + ltmp = (1 << 31) | (0 << 30) | (24 << 24) + | BitReverse((0x01<<24) | 0xEBFFC2, 24); Wb35Reg_WriteSync(pHwData, 0x0864, ltmp); /* for LNA=11 */ /* Calibration (5c-h). RX DC offset current bias ON; & LNA=11; RXVGA=11 */ - ltmp = (1 << 31) | (0 << 30) | (24 << 24) | BitReverse((0x06<<24) | 0x343FCC, 24); + ltmp = (1 << 31) | (0 << 30) | (24 << 24) + | BitReverse((0x06<<24) | 0x343FCC, 24); Wb35Reg_WriteSync(pHwData, 0x0864, ltmp); /* Calibration (5d). turn on RX DC offset cal function; and waiting 2 msec cal time */ - ltmp = (1 << 31) | (0 << 30) | (24 << 24) | BitReverse((0x00<<24) | 0xFF6DC0, 24); + ltmp = (1 << 31) | (0 << 30) | (24 << 24) + | BitReverse((0x00<<24) | 0xFF6DC0, 24); Wb35Reg_WriteSync(pHwData, 0x0864, ltmp); usleep(2000); /* Calibration (5f). turn off ENCAL signal */ - ltmp = (1 << 31) | (0 << 30) | (24 << 24) | BitReverse((0x00<<24) | 0xFAEDC0, 24); + ltmp = (1 << 31) | (0 << 30) | (24 << 24) + | BitReverse((0x00<<24) | 0xFAEDC0, 24); Wb35Reg_WriteSync(pHwData, 0x0864, ltmp); /* for LNA=10 */ -- 1.8.1.2
[PATCH 14/24] Staging: winbond: reg: fixed some lines over 80 characters
Sixth of the patches that fixes the lines over 80 characters in reg.c Signed-off-by: Iker Pedrosa --- drivers/staging/winbond/reg.c | 28 ++-- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/drivers/staging/winbond/reg.c b/drivers/staging/winbond/reg.c index b05f9bd..50ca7dd 100644 --- a/drivers/staging/winbond/reg.c +++ b/drivers/staging/winbond/reg.c @@ -1738,7 +1738,8 @@ static void set_tx_power_per_channel_wb242(struct hw_data *pHwData, * None. * === */ -void RFSynthesizer_SwitchingChannel(struct hw_data *pHwData, struct chan_info Channel) +void RFSynthesizer_SwitchingChannel(struct hw_data *pHwData, + struct chan_info Channel) { struct wb35_reg *reg = &pHwData->reg; u32 pltmp[16]; /* The 16 is the maximum capability of hardware */ @@ -1891,9 +1892,9 @@ void RFSynthesizer_SwitchingChannel(struct hw_data *pHwData, struct chan_info C /* BB: select 5 GHz */ reg->BB50 &= ~(BIT(11) | BIT(12)); if (Channel.ChanNo <= 64) - reg->BB50 |= BIT(12); /* 10-5.25GHz */ + reg->BB50 |= BIT(12); /* 10-5.25GHz */ else if ((Channel.ChanNo >= 100) && (Channel.ChanNo <= 124)) - reg->BB50 |= BIT(11); /* 01-5.48GHz */ + reg->BB50 |= BIT(11); /* 01-5.48GHz */ else if ((Channel.ChanNo >= 128) && (Channel.ChanNo <= 161)) reg->BB50 |= (BIT(12) | BIT(11)); /* 11-5.775GHz */ else/* Chan 184 ~ 196 will use bit[12-11] = 10 in version sh-src-1.2.25 */ @@ -1968,7 +1969,8 @@ u8 RFSynthesizer_SetMaxim2828_24Power(struct hw_data *pHwData, u8 index) u32 PowerData; if (index > 1) index = 1; - PowerData = (1 << 31) | (0 << 30) | (18 << 24) | BitReverse(max2828_power_data_24[index], 18); + PowerData = (1 << 31) | (0 << 30) | (18 << 24) + | BitReverse(max2828_power_data_24[index], 18); Wb35Reg_Write(pHwData, 0x0864, PowerData); return index; } @@ -1978,7 +1980,8 @@ u8 RFSynthesizer_SetMaxim2828_50Power(struct hw_data *pHwData, u8 index) u32 PowerData; if (index > 1) index = 1; - PowerData = (1 << 31) | (0 << 30) | (18 << 24) | BitReverse(max2828_power_data_50[index], 18); + PowerData = (1 << 31) | (0 << 30) | (18 << 24) + | BitReverse(max2828_power_data_50[index], 18); Wb35Reg_Write(pHwData, 0x0864, PowerData); return index; } @@ -1988,7 +1991,8 @@ u8 RFSynthesizer_SetMaxim2827_24Power(struct hw_data *pHwData, u8 index) u32 PowerData; if (index > 1) index = 1; - PowerData = (1 << 31) | (0 << 30) | (18 << 24) | BitReverse(max2827_power_data_24[index], 18); + PowerData = (1 << 31) | (0 << 30) | (18 << 24) + | BitReverse(max2827_power_data_24[index], 18); Wb35Reg_Write(pHwData, 0x0864, PowerData); return index; } @@ -1998,7 +2002,8 @@ u8 RFSynthesizer_SetMaxim2827_50Power(struct hw_data *pHwData, u8 index) u32 PowerData; if (index > 1) index = 1; - PowerData = (1 << 31) | (0 << 30) | (18 << 24) | BitReverse(max2827_power_data_50[index], 18); + PowerData = (1 << 31) | (0 << 30) | (18 << 24) + | BitReverse(max2827_power_data_50[index], 18); Wb35Reg_Write(pHwData, 0x0864, PowerData); return index; } @@ -2008,7 +2013,8 @@ u8 RFSynthesizer_SetMaxim2825Power(struct hw_data *pHwData, u8 index) u32 PowerData; if (index > 1) index = 1; - PowerData = (1 << 31) | (0 << 30) | (18 << 24) | BitReverse(max2825_power_data_24[index], 18); + PowerData = (1 << 31) | (0 << 30) | (18 << 24) + | BitReverse(max2825_power_data_24[index], 18); Wb35Reg_Write(pHwData, 0x0864, PowerData); return index; } @@ -2026,7 +2032,8 @@ u8 RFSynthesizer_SetAiroha2230Power(struct hw_data *pHwData, u8 index) if (i == count) i--; - PowerData = (1 << 31) | (0 << 30) | (20 << 24) | BitReverse(al2230_txvga_data[i][0], 20); + PowerData = (1 << 31) | (0 << 30) | (20 << 24) + | BitReverse(al2230_txvga_data[i][0], 20); Wb35Reg_Write(pHwData, 0x0864, PowerData); return i; } @@ -2043,7 +2050,8 @@ u8 RFSynthesizer_SetAiroha7230Power(struct hw_data *pHwData, u8 index) } if (i == count) i--; - PowerData = (1 << 31) | (0 << 30) | (24 << 24) | (al7230_txvga_data[i][0] & 0xff); + PowerData = (1 << 31) | (0 << 30) | (24 << 24)
[PATCH 23/24] Staging: winbond: wbusb: fixed some lines over 80 characters
Fixed some lines over 80 characters. Signed-off-by: Iker Pedrosa --- drivers/staging/winbond/wbusb.c | 16 +++- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/drivers/staging/winbond/wbusb.c b/drivers/staging/winbond/wbusb.c index 3fa1ae4..c128bc9 100644 --- a/drivers/staging/winbond/wbusb.c +++ b/drivers/staging/winbond/wbusb.c @@ -169,7 +169,8 @@ static void hal_set_radio_mode(struct hw_data *pHwData, unsigned char radio_off) Wb35Reg_Write(pHwData, 0x0824, reg->M24_MacControl); } -static void hal_set_current_channel_ex(struct hw_data *pHwData, struct chan_info channel) +static void hal_set_current_channel_ex(struct hw_data *pHwData, + struct chan_info channel) { struct wb35_reg *reg = &pHwData->reg; @@ -186,7 +187,8 @@ static void hal_set_current_channel_ex(struct hw_data *pHwData, struct chan_info sizeof(struct chan_info)); } -static void hal_set_current_channel(struct hw_data *pHwData, struct chan_info channel) +static void hal_set_current_channel(struct hw_data *pHwData, + struct chan_info channel) { hal_set_current_channel_ex(pHwData, channel); } @@ -206,7 +208,9 @@ static void hal_set_accept_broadcast(struct hw_data *pHwData, u8 enable) Wb35Reg_Write(pHwData, 0x0800, reg->M00_MacControl); } -/* For wep key error detection, we need to accept broadcast packets to be received temporary. */ +/* For wep key error detection, we need to accept broadcast packets to be + * received temporary. +*/ static void hal_set_accept_promiscuous(struct hw_data *pHwData, u8 enable) { struct wb35_reg *reg = &pHwData->reg; @@ -290,7 +294,8 @@ static const struct ieee80211_ops wbsoft_ops = { .get_tsf= wbsoft_get_tsf, }; -static void hal_set_ethernet_address(struct hw_data *pHwData, u8 *current_address) +static void hal_set_ethernet_address(struct hw_data *pHwData, +u8 *current_address) { u32 ltmp[2]; @@ -305,7 +310,8 @@ static void hal_set_ethernet_address(struct hw_data *pHwData, u8 *current_addres Wb35Reg_BurstWrite(pHwData, 0x03e8, ltmp, 2, AUTO_INCREMENT); } -static void hal_get_permanent_address(struct hw_data *pHwData, u8 *pethernet_address) +static void hal_get_permanent_address(struct hw_data *pHwData, + u8 *pethernet_address) { if (pHwData->SurpriseRemove) return; -- 1.8.1.2 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 08/24] Staging: winbond: reg: changed sleep function from msleep to usleep
According to the documentation it is not recommended to use msleep for 1ms - 20ms because it may sleep longer than 20ms. So, it is recommended to use usleep instead. Signed-off-by: Iker Pedrosa --- drivers/staging/winbond/reg.c | 52 +-- 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/drivers/staging/winbond/reg.c b/drivers/staging/winbond/reg.c index 80b4b34..61916f5 100644 --- a/drivers/staging/winbond/reg.c +++ b/drivers/staging/winbond/reg.c @@ -890,9 +890,9 @@ void Uxx_power_on_procedure(struct hw_data *pHwData) else { Wb35Reg_WriteSync(pHwData, 0x03f4, 0xFF5807FF); Wb35Reg_WriteSync(pHwData, 0x03d4, 0x80); /* regulator on only */ - msleep(10); + usleep(1); Wb35Reg_WriteSync(pHwData, 0x03d4, 0xb8); /* REG_ON RF_RSTN on, and */ - msleep(10); + usleep(1); ltmp = 0x4968; if ((pHwData->phy_type == RF_WB_242) || (RF_WB_242_1 == pHwData->phy_type)) @@ -905,7 +905,7 @@ void Uxx_power_on_procedure(struct hw_data *pHwData) Wb35Reg_ReadSync(pHwData, 0x03d0,reg.BB50 |= 0x13; /* (MASK_IQCAL_MODE|MASK_CALIB_START) */ Wb35Reg_WriteSync(pHwData, 0x1050, pHwData->reg.BB50); - msleep(5); + usleep(5000); ltmp = (1 << 31) | (0 << 30) | (20 << 24) | BitReverse((0x0F << 20) | 0xF01B0, 20); Wb35Reg_WriteSync(pHwData, 0x0864, ltmp); - msleep(5); + usleep(5000); ltmp = (1 << 31) | (0 << 30) | (20 << 24) | BitReverse((0x0F << 20) | 0xF01E0, 20); Wb35Reg_WriteSync(pHwData, 0x0864, ltmp); - msleep(5); + usleep(5000); ltmp = (1 << 31) | (0 << 30) | (20 << 24) | BitReverse((0x0F << 20) | 0xF01A0, 20); Wb35Reg_WriteSync(pHwData, 0x0864, ltmp); @@ -1102,13 +1102,13 @@ void RFSynthesizer_initial(struct hw_data *pHwData) /* 2.4GHz */ ltmp = (1 << 31) | (0 << 30) | (24 << 24) | 0x9ABA8F; Wb35Reg_WriteSync(pHwData, 0x0864, ltmp); - msleep(5); + usleep(5000); ltmp = (1 << 31) | (0 << 30) | (24 << 24) | 0x3ABA8F; Wb35Reg_WriteSync(pHwData, 0x0864, ltmp); - msleep(5); + usleep(5000); ltmp = (1 << 31) | (0 << 30) | (24 << 24) | 0x1ABA8F; Wb35Reg_WriteSync(pHwData, 0x0864, ltmp); - msleep(5); + usleep(5000); /* 5GHz */ Wb35Reg_WriteSync(pHwData, 0x03dc, 0x); @@ -1119,20 +1119,20 @@ void RFSynthesizer_initial(struct hw_data *pHwData) /* Write to register. number must less and equal than 16 */ for (i = 0; i < number; i++) Wb35Reg_WriteSync(pHwData, 0x0864, pl
[PATCH 09/24] Staging: winbond: reg: fixed some lines over 80 characters
First of the patches that fixes the lines over 80 characters in reg.c Signed-off-by: Iker Pedrosa --- drivers/staging/winbond/reg.c | 30 +- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/drivers/staging/winbond/reg.c b/drivers/staging/winbond/reg.c index 61916f5..b1d977a 100644 --- a/drivers/staging/winbond/reg.c +++ b/drivers/staging/winbond/reg.c @@ -809,12 +809,12 @@ u32 w89rf242_txvga_data[][5] = { {(0x05 << 24) | 0x24C7CA, 34, 0x00292315, 0x0800FEFF, 0x72724242} }; -/* == */ +/* = */ /* - * = + * * Uxx_ReadEthernetAddress -- * * Routine Description: @@ -826,15 +826,16 @@ u32 w89rf242_txvga_data[][5] = { * Return Value: * *The address is stored in EthernetIDAddr. - * = + * */ void Uxx_ReadEthernetAddress(struct hw_data *pHwData) { u32 ltmp; /* -* Reading Ethernet address from EEPROM and set into hardware due to MAC address maybe change. -* Only unplug and plug again can make hardware read EEPROM again. +* Reading Ethernet address from EEPROM and set into hardware due to +* MAC address maybe change. Only unplug and plug again can make +* hardware read EEPROM again. */ Wb35Reg_WriteSync(pHwData, 0x03b4, 0x0800); /* Start EEPROM access + Read + address(0x0d) */ Wb35Reg_ReadSync(pHwData, 0x03b4,phy_para[i] = al7230_rf_data_24[i]; - pltmp[i] = (1 << 31) | (0 << 30) | (24 << 24) | (al7230_rf_data_24[i] & 0xff); + pltmp[i] = (1 << 31) | (0 << 30) | (24 << 24) + | (al7230_rf_data_24[i] & 0xff); } } @@ -936,15 +939,16 @@ static void Set_ChanIndep_RfData_al7230_50(struct hw_data *pHwData, u32 *pltmp, u8 i; for (i = 0; i < number; i++) { pHwData->phy_para[i] = al7230_rf_data_50[i]; - pltmp[i] = (1 << 31) | (0 << 30) | (24 << 24) | (al7230_rf_data_50[i] & 0xff); + pltmp[i] = (1 << 31) | (0 << 30) | (24 << 24) + | (al7230_rf_data_50[i] & 0xff); } } /* - * = + * * RFSynthesizer_initial -- - * = + * */ void RFSynthesizer_initial(struct hw_data *pHwData) { -- 1.8.1.2 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 13/24] Staging: winbond: reg: fixed some lines over 80 characters
Fifth of the patches that fixes the lines over 80 characters in reg.c Signed-off-by: Iker Pedrosa --- drivers/staging/winbond/reg.c | 33 ++--- 1 file changed, 22 insertions(+), 11 deletions(-) diff --git a/drivers/staging/winbond/reg.c b/drivers/staging/winbond/reg.c index acdc003..b05f9bd 100644 --- a/drivers/staging/winbond/reg.c +++ b/drivers/staging/winbond/reg.c @@ -1252,46 +1252,57 @@ void RFSynthesizer_initial(struct hw_data *pHwData) /* for LNA=10 */ /* Calibration (5c-m). RX DC offset current bias ON; & LNA=10; RXVGA=11 */ - ltmp = (1 << 31) | (0 << 30) | (24 << 24) | BitReverse((0x06<<24) | 0x342FCC, 24); + ltmp = (1 << 31) | (0 << 30) | (24 << 24) + | BitReverse((0x06<<24) | 0x342FCC, 24); Wb35Reg_WriteSync(pHwData, 0x0864, ltmp); /* Calibration (5d). turn on RX DC offset cal function; and waiting 2 msec cal time */ - ltmp = (1 << 31) | (0 << 30) | (24 << 24) | BitReverse((0x00<<24) | 0xFF6DC0, 24); + ltmp = (1 << 31) | (0 << 30) | (24 << 24) + | BitReverse((0x00<<24) | 0xFF6DC0, 24); Wb35Reg_WriteSync(pHwData, 0x0864, ltmp); usleep(2000); /* Calibration (5f). turn off ENCAL signal */ - ltmp = (1 << 31) | (0 << 30) | (24 << 24) | BitReverse((0x00<<24) | 0xFAEDC0, 24); + ltmp = (1 << 31) | (0 << 30) | (24 << 24) + | BitReverse((0x00<<24) | 0xFAEDC0, 24); Wb35Reg_WriteSync(pHwData, 0x0864, ltmp); /* for LNA=01 */ /* Calibration (5c-m). RX DC offset current bias ON; & LNA=01; RXVGA=11 */ - ltmp = (1 << 31) | (0 << 30) | (24 << 24) | BitReverse((0x06<<24) | 0x341FCC, 24); + ltmp = (1 << 31) | (0 << 30) | (24 << 24) + | BitReverse((0x06<<24) | 0x341FCC, 24); Wb35Reg_WriteSync(pHwData, 0x0864, ltmp); /* Calibration (5d). turn on RX DC offset cal function; and waiting 2 msec cal time */ - ltmp = (1 << 31) | (0 << 30) | (24 << 24) | BitReverse((0x00<<24) | 0xFF6DC0, 24); + ltmp = (1 << 31) | (0 << 30) | (24 << 24) + | BitReverse((0x00<<24) | 0xFF6DC0, 24); Wb35Reg_WriteSync(pHwData, 0x0864, ltmp); usleep(2000); /* Calibration (5f). turn off ENCAL signal */ - ltmp = (1 << 31) | (0 << 30) | (24 << 24) | BitReverse((0x00<<24) | 0xFAEDC0, 24); + ltmp = (1 << 31) | (0 << 30) | (24 << 24) + | BitReverse((0x00<<24) | 0xFAEDC0, 24); Wb35Reg_WriteSync(pHwData, 0x0864, ltmp); /* for LNA=00 */ /* Calibration (5c-l). RX DC offset current bias ON; & LNA=00; RXVGA=11 */ - ltmp = (1 << 31) | (0 << 30) | (24 << 24) | BitReverse((0x06<<24) | 0x340FCC, 24); + ltmp = (1 << 31) | (0 << 30) | (24 << 24) + | BitReverse((0x06<<24) | 0x340FCC, 24); Wb35Reg_WriteSync(pHwData, 0x0864, ltmp); /* Calibration (5d). turn on RX DC offset cal function; and waiting 2 msec cal time */ - ltmp = (1 << 31) | (0 << 30) | (24 << 24) | BitReverse((0x00<<24) | 0xFF6DC0, 24); + ltmp = (1 << 31) | (0 << 30) | (24 << 24) + | BitReverse((0x00<<24) | 0xFF6DC0, 24); Wb35Reg_WriteSync(pHwData, 0x0864, ltmp); usleep(2000); /* Calibration (5f). turn off ENCAL signal */ - ltmp = (1 << 31) | (0 << 30) | (24 << 24) | BitReverse((0x00<<24) | 0xFAEDC0, 24); + ltmp = (1 << 31) | (0 << 30) | (24 << 24) + | BitReverse((0x00<<24) | 0xFAEDC0, 24); Wb35Reg_WriteSync(pHwData, 0x0864, ltmp); /* Calibration (5g). turn on AGC servo-loop */ - ltmp = (1 << 31) | (0 << 30) | (24 << 24) | BitReverse((0x01<<24) | 0xEFFFC2, 24); + ltmp = (1 << 31) | (0 << 30) | (24 << 24) + | BitReverse((0x01<<24) | 0xEFFFC2, 24); Wb35Reg_WriteSync(pHwData, 0x0864, ltmp); /* - Calibration (7). Switch RF chip to normal mode */ /* 0x00 0xF86100 ; 3E184 ; Switch RF chip to normal mode */ - ltmp = (1 << 31) | (0 << 30) | (24 << 24) | BitReverse((0x00<<24) | 0xF86100, 24); + ltmp = (1 << 31) | (0 << 30) | (24 << 24) + | BitReverse((0x00<<24) | 0xF86100, 24); Wb35Reg_WriteSync(pHwData, 0x0864, ltmp); usleep(5000); break; -- 1.8.1.2 ___ devel mailin
[PATCH 17/24] Staging: winbond: wb35reg_s: deleted space before tabulation
Deleted an space before a tabulation. Signed-off-by: Iker Pedrosa --- drivers/staging/winbond/wb35reg_s.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/winbond/wb35reg_s.h b/drivers/staging/winbond/wb35reg_s.h index dc79faa..cdbbf35 100644 --- a/drivers/staging/winbond/wb35reg_s.h +++ b/drivers/staging/winbond/wb35reg_s.h @@ -12,7 +12,7 @@ struct hw_data; * HAL setting function * * - * |Uxx| |Dxx| |Mxx| |BB||RF| + * |Uxx| |Dxx| |Mxx| |BB||RF| * * | | * Wb35Reg_ReadWb35Reg_Write -- 1.8.1.2 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 24/24] Staging: winbond: wbusb: changed sleep function from msleep to usleep
According to the documentation it is not recommended to use msleep for 1ms - 20ms because it may sleep longer than 20ms. So, it is recommended to use usleep instead. Signed-off-by: Iker Pedrosa --- drivers/staging/winbond/wbusb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/winbond/wbusb.c b/drivers/staging/winbond/wbusb.c index c128bc9..a2140da 100644 --- a/drivers/staging/winbond/wbusb.c +++ b/drivers/staging/winbond/wbusb.c @@ -717,7 +717,7 @@ static int wb35_hw_init(struct ieee80211_hw *hw) /* Waiting for HAL setting OK */ while (!hal_idle(pHwData)) - msleep(10); + usleep(1); MTO_Init(priv); -- 1.8.1.2 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 21/24] Staging: winbond: wb35tx: Replace printk with netdev_err
The previously used printk lacked the warning level, now we've got a more accurate way to know the error. Signed-off-by: Iker Pedrosa --- drivers/staging/winbond/wb35tx.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/staging/winbond/wb35tx.c b/drivers/staging/winbond/wb35tx.c index 8c25cbd..18b28f2 100644 --- a/drivers/staging/winbond/wb35tx.c +++ b/drivers/staging/winbond/wb35tx.c @@ -32,7 +32,7 @@ static void Wb35Tx_complete(struct urb *pUrb) struct wb35_tx *pWb35Tx = &pHwData->Wb35Tx; struct wb35_mds *pMds = &adapter->Mds; - printk("wb35: tx complete\n"); + netdev_err(pUrb->dev, "wb35: tx complete\n"); /* Variable setting */ pWb35Tx->EP4vm_state = VM_COMPLETED; pWb35Tx->EP4VM_status = pUrb->status; /* Store the last result of Irp */ @@ -49,7 +49,7 @@ static void Wb35Tx_complete(struct urb *pUrb) /* The URB is completed, check the result */ if (pWb35Tx->EP4VM_status != 0) { - printk("URB submission failed\n"); + netdev_err(pUrb->dev, "URB submission failed\n"); pWb35Tx->EP4vm_state = VM_STOP; goto error; } @@ -96,7 +96,7 @@ static void Wb35Tx(struct wbsoft_priv *adapter) pWb35Tx->EP4vm_state = VM_RUNNING; retv = usb_submit_urb(pUrb, GFP_ATOMIC); if (retv < 0) { - printk("EP4 Tx Irp sending error\n"); + netdev_err(pUrb->dev, "EP4 Tx Irp sending error\n"); goto cleanup; } @@ -218,7 +218,7 @@ static void Wb35Tx_EP2VM_complete(struct urb *pUrb) /* The Urb is completed, check the result */ if (pWb35Tx->EP2VM_status != 0) { - printk("EP2 IoCompleteRoutine return error\n"); + netdev_err(pUrb->dev, "EP2 IoCompleteRoutine return error\n"); pWb35Tx->EP2vm_state = VM_STOP; goto error; } -- 1.8.1.2 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 11/24] Staging: winbond: reg: fixed some lines over 80 characters
Third of the patches that fixes the lines over 80 characters in reg.c Signed-off-by: Iker Pedrosa --- drivers/staging/winbond/reg.c | 30 -- 1 file changed, 20 insertions(+), 10 deletions(-) diff --git a/drivers/staging/winbond/reg.c b/drivers/staging/winbond/reg.c index 300038a..0cb0798 100644 --- a/drivers/staging/winbond/reg.c +++ b/drivers/staging/winbond/reg.c @@ -1093,15 +1093,18 @@ void RFSynthesizer_initial(struct hw_data *pHwData) Wb35Reg_WriteSync(pHwData, 0x1050, pHwData->reg.BB50); usleep(5000); - ltmp = (1 << 31) | (0 << 30) | (20 << 24) | BitReverse((0x0F << 20) | 0xF01B0, 20); + ltmp = (1 << 31) | (0 << 30) | (20 << 24) + | BitReverse((0x0F << 20) | 0xF01B0, 20); Wb35Reg_WriteSync(pHwData, 0x0864, ltmp); usleep(5000); - ltmp = (1 << 31) | (0 << 30) | (20 << 24) | BitReverse((0x0F << 20) | 0xF01E0, 20); + ltmp = (1 << 31) | (0 << 30) | (20 << 24) + | BitReverse((0x0F << 20) | 0xF01E0, 20); Wb35Reg_WriteSync(pHwData, 0x0864, ltmp); usleep(5000); - ltmp = (1 << 31) | (0 << 30) | (20 << 24) | BitReverse((0x0F << 20) | 0xF01A0, 20); + ltmp = (1 << 31) | (0 << 30) | (20 << 24) + | BitReverse((0x0F << 20) | 0xF01A0, 20); Wb35Reg_WriteSync(pHwData, 0x0864, ltmp); Wb35Reg_WriteSync(pHwData, 0x105c, pHwData->reg.BB5C); @@ -1159,30 +1162,37 @@ void RFSynthesizer_initial(struct hw_data *pHwData) /* - Calibration (1). VCO frequency calibration */ /* Calibration (1a.0). Synthesizer reset */ - ltmp = (1 << 31) | (0 << 30) | (24 << 24) | BitReverse((0x0F<<24) | 0x00101E, 24); + ltmp = (1 << 31) | (0 << 30) | (24 << 24) + | BitReverse((0x0F<<24) | 0x00101E, 24); Wb35Reg_WriteSync(pHwData, 0x0864, ltmp); usleep(5000); /* Calibration (1a). VCO frequency calibration mode ; waiting 2msec VCO calibration time */ - ltmp = (1 << 31) | (0 << 30) | (24 << 24) | BitReverse((0x00<<24) | 0xFE69c0, 24); + ltmp = (1 << 31) | (0 << 30) | (24 << 24) + | BitReverse((0x00<<24) | 0xFE69c0, 24); Wb35Reg_WriteSync(pHwData, 0x0864, ltmp); usleep(2000); /* - Calibration (2). TX baseband Gm-C filter auto-tuning */ /* Calibration (2a). turn off ENCAL signal */ - ltmp = (1 << 31) | (0 << 30) | (24 << 24) | BitReverse((0x00<<24) | 0xF8EBC0, 24); + ltmp = (1 << 31) | (0 << 30) | (24 << 24) + | BitReverse((0x00<<24) | 0xF8EBC0, 24); Wb35Reg_WriteSync(pHwData, 0x0864, ltmp); /* Calibration (2b.0). TX filter auto-tuning BW: TFLBW=101 (TC5376A default) */ - ltmp = (1 << 31) | (0 << 30) | (24 << 24) | BitReverse((0x07<<24) | 0x0C68CE, 24); + ltmp = (1 << 31) | (0 << 30) | (24 << 24) + | BitReverse((0x07<<24) | 0x0C68CE, 24); Wb35Reg_WriteSync(pHwData, 0x0864, ltmp); /* Calibration (2b). send TX reset signal */ - ltmp = (1 << 31) | (0 << 30) | (24 << 24) | BitReverse((0x0F<<24) | 0x00201E, 24); + ltmp = (1 << 31) | (0 << 30) | (24 << 24) + | BitReverse((0x0F<<24) | 0x00201E, 24); Wb35Reg_WriteSync(pHwData, 0x0864, ltmp); /* Calibration (2c). turn-on TX Gm-C filter auto-tuning */ - ltmp = (1 << 31) | (0 << 30) | (24 << 24) | BitReverse((0x00<<24) | 0xFCEBC0, 24); + ltmp = (1 << 31) | (0 << 30) | (24 << 24) + | BitReverse((0x00<<24) | 0xFCEBC0, 24); Wb35Reg_WriteSync(pHwData, 0x0864, ltmp); udelay(150); /* Sleep 150 us */ /* turn off ENCAL signal */ - ltmp = (1 << 31) | (0 << 30) | (24 << 24) | BitReverse((0x00<<24) | 0xF8EBC0, 24); + ltmp = (1 << 31) | (0 << 30) | (24 << 24) + | BitReverse((0x00<<24) | 0xF8EBC0, 24); Wb35Reg_WriteSync(pHwData, 0x0864, ltmp); /* - Calibration (3). RX baseband Gm-C filter auto-tuning */ -- 1.8.1.2 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 02/24] Staging: winbond: mto: avoided use of extern functions
Prototype of two functions added to the header to avoid the use of extern. Signed-off-by: Iker Pedrosa --- drivers/staging/winbond/mto.c | 4 +--- drivers/staging/winbond/mto.h | 4 ++-- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/staging/winbond/mto.c b/drivers/staging/winbond/mto.c index 0d0f9fb..b031ecd 100644 --- a/drivers/staging/winbond/mto.c +++ b/drivers/staging/winbond/mto.c @@ -21,6 +21,7 @@ #include "wbhal.h" #include "wb35reg_f.h" #include "core.h" +#include "mto.h" /* Declare SQ3 to rate and fragmentation threshold table */ /* Declare fragmentation threshold table */ @@ -45,9 +46,6 @@ static int retryrate_rec[MTO_MAX_DATA_RATE_LEVELS]; static u8 boSparseTxTraffic; -void MTO_Init(struct wbsoft_priv *adapter); -void MTO_SetTxCount(struct wbsoft_priv *adapter, u8 t0, u8 index); - /* * === * MTO_Init -- diff --git a/drivers/staging/winbond/mto.h b/drivers/staging/winbond/mto.h index a0f659c..22bb264 100644 --- a/drivers/staging/winbond/mto.h +++ b/drivers/staging/winbond/mto.h @@ -127,12 +127,12 @@ extern u16 MTO_Frag_Th_Tbl[]; #define MTO_DATA_RATE() MTO_Data_Rate_Tbl[MTO_RATE_LEVEL()] #define MTO_FRAG_TH() MTO_Frag_Th_Tbl[MTO_FRAG_TH_LEVEL()] -extern void MTO_Init(struct wbsoft_priv *); +void MTO_Init(struct wbsoft_priv *); +void MTO_SetTxCount(struct wbsoft_priv *adapter, u8 t0, u8 index); extern void MTO_PeriodicTimerExpired(struct wbsoft_priv *); extern void MTO_SetDTORateRange(struct wbsoft_priv *, u8 *, u8); extern u8 MTO_GetTxRate(struct wbsoft_priv *adapter, u32 fpdu_len); extern u8 MTO_GetTxFallbackRate(struct wbsoft_priv *adapter); -extern void MTO_SetTxCount(struct wbsoft_priv *adapter, u8 t0, u8 index); #endif /* __MTO_H__ */ -- 1.8.1.2 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 15/24] Staging: winbond: reg: fixed some lines over 80 characters
Seventh of the patches that fixes the lines over 80 characters in reg.c Signed-off-by: Iker Pedrosa --- drivers/staging/winbond/reg.c | 24 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/drivers/staging/winbond/reg.c b/drivers/staging/winbond/reg.c index 50ca7dd..6cafd69 100644 --- a/drivers/staging/winbond/reg.c +++ b/drivers/staging/winbond/reg.c @@ -2070,7 +2070,8 @@ u8 RFSynthesizer_SetWinbond242Power(struct hw_data *pHwData, u8 index) i--; /* Set TxVga into RF */ - PowerData = (1 << 31) | (0 << 30) | (24 << 24) | BitReverse(w89rf242_txvga_data[i][0], 24); + PowerData = (1 << 31) | (0 << 30) | (24 << 24) + | BitReverse(w89rf242_txvga_data[i][0], 24); Wb35Reg_Write(pHwData, 0x0864, PowerData); /* Update BB48 BB4C BB58 for high precision txvga */ @@ -2146,11 +2147,15 @@ void Mxx_initial(struct hw_data *pHwData) pltmp[4] = tmp; /* M38 */ - reg->M38_MacControl = (DEFAULT_RATE_RETRY_LIMIT << 8) | (DEFAULT_LONG_RETRY_LIMIT << 4) | DEFAULT_SHORT_RETRY_LIMIT; + reg->M38_MacControl = (DEFAULT_RATE_RETRY_LIMIT << 8) | + (DEFAULT_LONG_RETRY_LIMIT << 4) | + DEFAULT_SHORT_RETRY_LIMIT; pltmp[5] = reg->M38_MacControl; /* M3C */ - tmp = (DEFAULT_PIFST << 26) | (DEFAULT_EIFST << 16) | (DEFAULT_DIFST << 8) | (DEFAULT_SIFST << 4) | DEFAULT_OSIFST; + tmp = (DEFAULT_PIFST << 26) | (DEFAULT_EIFST << 16) | + (DEFAULT_DIFST << 8) | (DEFAULT_SIFST << 4) | + DEFAULT_OSIFST; reg->M3C_MacControl = tmp; pltmp[6] = tmp; @@ -2173,7 +2178,9 @@ void Mxx_initial(struct hw_data *pHwData) pltmp[9] = tmp; /* M4C */ - reg->M4C_MacStatus = (DEFAULT_PROTOCOL_VERSION << 30) | (DEFAULT_MAC_POWER_STATE << 28) | (DEFAULT_DTIM_ALERT_TIME << 24); + reg->M4C_MacStatus = (DEFAULT_PROTOCOL_VERSION << 30) | + (DEFAULT_MAC_POWER_STATE << 28) | + (DEFAULT_DTIM_ALERT_TIME << 24); pltmp[10] = reg->M4C_MacStatus; for (i = 0; i < 11; i++) @@ -2245,10 +2252,11 @@ void GetTxVgaFromEEPROM(struct hw_data *pHwData) } /* - * This function will affect the TxVga parameter in HAL. If hal_set_current_channel - * or RFSynthesizer_SetPowerIndex be called, new TxVga will take effect. - * TxVgaSettingInEEPROM of sHwData is an u8 array point to EEPROM contain for IS89C35 - * This function will use default TxVgaSettingInEEPROM data to calculate new TxVga. + * This function will affect the TxVga parameter in HAL. If + * hal_set_current_channel or RFSynthesizer_SetPowerIndex be called, new TxVga + * will take effect. TxVgaSettingInEEPROM of sHwData is an u8 array point to + * EEPROM contain for IS89C35. This function will use default + * TxVgaSettingInEEPROM data to calculate new TxVga. */ void EEPROMTxVgaAdjust(struct hw_data *pHwData) { -- 1.8.1.2 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 18/24] Staging: winbond: wb35rx: changed sleep function from msleep to usleep
According to the documentation it is not recommended to use msleep for 1ms - 20ms because it may sleep longer than 20ms. So, it is recommended to use usleep instead. Signed-off-by: Iker Pedrosa --- drivers/staging/winbond/wb35rx.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/winbond/wb35rx.c b/drivers/staging/winbond/wb35rx.c index 8d71bc2..48ed95c 100644 --- a/drivers/staging/winbond/wb35rx.c +++ b/drivers/staging/winbond/wb35rx.c @@ -339,9 +339,9 @@ void Wb35Rx_destroy(struct hw_data *pHwData) struct wb35_rx *pWb35Rx = &pHwData->Wb35Rx; do { - msleep(10); /* Delay for waiting function enter */ + usleep(1); /* Delay for waiting function enter */ } while (pWb35Rx->EP3vm_state != VM_STOP); - msleep(10); /* Delay for waiting function exit */ + usleep(1); /* Delay for waiting function exit */ usb_free_urb(pWb35Rx->RxUrb); pr_debug("Wb35Rx_destroy OK\n"); -- 1.8.1.2 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 19/24] Staging: winbond: wb35rx: fixed some lines over 80 characters
Fixed some lines over 80 characters. Signed-off-by: Iker Pedrosa --- drivers/staging/winbond/wb35rx.c | 7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/staging/winbond/wb35rx.c b/drivers/staging/winbond/wb35rx.c index 48ed95c..999b7046 100644 --- a/drivers/staging/winbond/wb35rx.c +++ b/drivers/staging/winbond/wb35rx.c @@ -16,7 +16,8 @@ #include "core.h" #include "wb35rx_f.h" -static void packet_came(struct ieee80211_hw *hw, char *pRxBufferAddress, int PacketSize) +static void packet_came(struct ieee80211_hw *hw, char *pRxBufferAddress, + int PacketSize) { struct wbsoft_priv *priv = hw->priv; struct sk_buff *skb; @@ -306,7 +307,9 @@ static void Wb35Rx_reset_descriptor(struct hw_data *pHwData) pWb35Rx->EP3vm_state = VM_STOP; pWb35Rx->rx_halt = 0; - /* Initial the Queue. The last buffer is reserved for used if the Rx resource is unavailable. */ + /* Initial the Queue. The last buffer is reserved for used if the Rx +* resource is unavailable. + */ for (i = 0; i < MAX_USB_RX_BUFFER_NUMBER; i++) pWb35Rx->RxOwner[i] = 1; } -- 1.8.1.2 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 07/24] Staging: winbond: reg: white space deleted
White space deleted before semicolons. Signed-off-by: Iker Pedrosa --- drivers/staging/winbond/reg.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/winbond/reg.c b/drivers/staging/winbond/reg.c index 5883d23..80b4b34 100644 --- a/drivers/staging/winbond/reg.c +++ b/drivers/staging/winbond/reg.c @@ -1088,7 +1088,7 @@ void RFSynthesizer_initial(struct hw_data *pHwData) msleep(5); ltmp = (1 << 31) | (0 << 30) | (20 << 24) | BitReverse((0x0F << 20) | 0xF01A0, 20); - Wb35Reg_WriteSync(pHwData, 0x0864, ltmp) ; + Wb35Reg_WriteSync(pHwData, 0x0864, ltmp); Wb35Reg_WriteSync(pHwData, 0x105c, pHwData->reg.BB5C); pHwData->reg.BB50 &= ~0x13; /* (MASK_IQCAL_MODE|MASK_CALIB_START); */ @@ -2096,7 +2096,7 @@ void Mxx_initial(struct hw_data *pHwData) pltmp[5] = reg->M38_MacControl; /* M3C */ - tmp = (DEFAULT_PIFST << 26) | (DEFAULT_EIFST << 16) | (DEFAULT_DIFST << 8) | (DEFAULT_SIFST << 4) | DEFAULT_OSIFST ; + tmp = (DEFAULT_PIFST << 26) | (DEFAULT_EIFST << 16) | (DEFAULT_DIFST << 8) | (DEFAULT_SIFST << 4) | DEFAULT_OSIFST; reg->M3C_MacControl = tmp; pltmp[6] = tmp; -- 1.8.1.2 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 04/24] Staging: winbond: phy_calibration: fixed some lines over 80 characters
First of the patches that fixes the lines over 80 characters in phy_calibration.c Signed-off-by: Iker Pedrosa --- drivers/staging/winbond/phy_calibration.c | 46 ++- 1 file changed, 27 insertions(+), 19 deletions(-) diff --git a/drivers/staging/winbond/phy_calibration.c b/drivers/staging/winbond/phy_calibration.c index cfbfbbb..6635c85 100644 --- a/drivers/staging/winbond/phy_calibration.c +++ b/drivers/staging/winbond/phy_calibration.c @@ -27,10 +27,12 @@ #define DEG2RAD(X) (0.017453 * (X)) static const s32 Angles[] = { - FIXED(DEG2RAD(45.0)), FIXED(DEG2RAD(26.565)), FIXED(DEG2RAD(14.0362)), - FIXED(DEG2RAD(7.12502)), FIXED(DEG2RAD(3.57633)), FIXED(DEG2RAD(1.78991)), - FIXED(DEG2RAD(0.895174)), FIXED(DEG2RAD(0.447614)), FIXED(DEG2RAD(0.223811)), - FIXED(DEG2RAD(0.111906)), FIXED(DEG2RAD(0.055953)), FIXED(DEG2RAD(0.027977)) + FIXED(DEG2RAD(45.0)), FIXED(DEG2RAD(26.565)), + FIXED(DEG2RAD(14.0362)), FIXED(DEG2RAD(7.12502)), + FIXED(DEG2RAD(3.57633)), FIXED(DEG2RAD(1.78991)), + FIXED(DEG2RAD(0.895174)), FIXED(DEG2RAD(0.447614)), + FIXED(DEG2RAD(0.223811)), FIXED(DEG2RAD(0.111906)), + FIXED(DEG2RAD(0.055953)), FIXED(DEG2RAD(0.027977)) }; /** LOCAL FUNCTION DECLARATION SECTION **/ @@ -296,7 +298,8 @@ void _sin_cos(s32 angle, s32 *sin, s32 *cos) } } -static unsigned char hal_get_dxx_reg(struct hw_data *pHwData, u16 number, u32 *pValue) +static unsigned char hal_get_dxx_reg(struct hw_data *pHwData, u16 number, +u32 *pValue) { if (number < 0x1000) number += 0x1000; @@ -304,7 +307,8 @@ static unsigned char hal_get_dxx_reg(struct hw_data *pHwData, u16 number, u32 *p } #define hw_get_dxx_reg(_A, _B, _C) hal_get_dxx_reg(_A, _B, (u32 *)_C) -static unsigned char hal_set_dxx_reg(struct hw_data *pHwData, u16 number, u32 value) +static unsigned char hal_set_dxx_reg(struct hw_data *pHwData, u16 number, +u32 value) { unsigned char ret; @@ -407,7 +411,8 @@ void _rxadc_dc_offset_cancellation_winbond(struct hw_data *phw_data, u32 frequen PHY_DEBUG(("[CAL]** adc_dc_cal_i = %d (0x%04X)\n", _s9_to_s32(val&0x01FF), val&0x01FF)); PHY_DEBUG(("[CAL]** adc_dc_cal_q = %d (0x%04X)\n", - _s9_to_s32((val&0x0003FE00)>>9), (val&0x0003FE00)>>9)); + _s9_to_s32((val&0x0003FE00)>>9), + (val&0x0003FE00)>>9)); #endif hw_get_dxx_reg(phw_data, REG_MODE_CTRL, &val); @@ -535,7 +540,8 @@ void _txidac_dc_offset_cancellation_winbond(struct hw_data *phw_data) } PHY_DEBUG(("[CAL]** fix_cancel_dc_i = %d (0x%04X)\n", - fix_cancel_dc_i, _s32_to_s5(fix_cancel_dc_i))); + fix_cancel_dc_i, + _s32_to_s5(fix_cancel_dc_i))); if ((abs(mag_1-mag_0)*6) > mag_0) break; @@ -711,7 +717,8 @@ u8 _tx_iq_calibration_loop_winbond(struct hw_data *phw_data, loop = LOOP_TIMES; while (loop > 0) { - PHY_DEBUG(("[CAL] [%d.] <_tx_iq_calibration_loop>\n", (LOOP_TIMES-loop+1))); + PHY_DEBUG(("[CAL] [%d.] <_tx_iq_calibration_loop>\n", + (LOOP_TIMES-loop+1))); iqcal_tone_i_avg = 0; iqcal_tone_q_avg = 0; @@ -719,8 +726,8 @@ u8 _tx_iq_calibration_loop_winbond(struct hw_data *phw_data, return 0; for (capture_time = 0; capture_time < 10; capture_time++) { /* -* a. Set iqcal_mode[1:0] to 0x2 and set "calib_start" to 0x1 to -*enable "IQ calibration Mode II" +* a. Set iqcal_mode[1:0] to 0x2 and set "calib_start" +*to 0x1 to enable "IQ calibration Mode II" */ reg_mode_ctrl &= ~(MASK_IQCAL_TONE_SEL|MASK_IQCAL_MODE); reg_mode_ctrl &= ~MASK_IQCAL_MODE; @@ -749,8 +756,8 @@ u8 _tx_iq_calibration_loop_winbond(struct hw_data *phw_data, PHY_DEBUG(("[CAL]MODE_CTRL (write) = 0x%08X\n", reg_mode_ctrl)); /* -* d. Set iqcal_mode[1:0] to 0x3 and set "calib_start" to 0x1 to -*enable "IQ calibration Mode II" +* d. Set iqcal_mode[1:0] to 0x3 and set "calib_start" +*to 0x1 to enable "IQ calibration Mode II" */ /* hw_get_dxx_reg(phw_data, REG_MODE_CTRL, &val); */ hw_get_dxx_reg(phw_data, REG_MODE_CTRL, ®_mode_ctrl); @@ -766,7 +773,7
[PATCH 16/24] Staging: winbond: wb35reg_f: fixed lines over 80 characters
Fixed lines over 80 characters. Signed-off-by: Iker Pedrosa --- drivers/staging/winbond/wb35reg_f.h | 18 -- 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/drivers/staging/winbond/wb35reg_f.h b/drivers/staging/winbond/wb35reg_f.h index 95dc980..cd6710c 100644 --- a/drivers/staging/winbond/wb35reg_f.h +++ b/drivers/staging/winbond/wb35reg_f.h @@ -15,7 +15,8 @@ void Uxx_ReadEthernetAddress(struct hw_data *hw_data); void Dxx_initial(struct hw_data *hw_data); void Mxx_initial(struct hw_data *hw_data); void RFSynthesizer_initial(struct hw_data *hw_data); -void RFSynthesizer_SwitchingChannel(struct hw_data *hw_data, struct chan_info channel); +void RFSynthesizer_SwitchingChannel(struct hw_data *hw_data, + struct chan_info channel); void BBProcessor_initial(struct hw_data *hw_data); void BBProcessor_RateChanging(struct hw_data *hw_data, u8 rate); u8 RFSynthesizer_SetPowerIndex(struct hw_data *hw_data, u8 power_index); @@ -34,10 +35,14 @@ void EEPROMTxVgaAdjust(struct hw_data *hw_data); void Wb35Reg_destroy(struct hw_data *hw_data); -unsigned char Wb35Reg_Read(struct hw_data *hw_data, u16 register_no, u32 *register_value); -unsigned char Wb35Reg_ReadSync(struct hw_data *hw_data, u16 register_no, u32 *register_value); -unsigned char Wb35Reg_Write(struct hw_data *hw_data, u16 register_no, u32 register_value); -unsigned char Wb35Reg_WriteSync(struct hw_data *hw_data, u16 register_no, u32 register_value); +unsigned char Wb35Reg_Read(struct hw_data *hw_data, u16 register_no, + u32 *register_value); +unsigned char Wb35Reg_ReadSync(struct hw_data *hw_data, u16 register_no, + u32 *register_value); +unsigned char Wb35Reg_Write(struct hw_data *hw_data, u16 register_no, + u32 register_value); +unsigned char Wb35Reg_WriteSync(struct hw_data *hw_data, u16 register_no, + u32 register_value); unsigned char Wb35Reg_WriteWithCallbackValue(struct hw_data *hw_data, u16 register_no, u32 register_value, @@ -59,7 +64,8 @@ void CardGetMulticastBit(u8 address[MAC_ADDR_LENGTH], u8 *byte, u8 *value); u32 CardComputeCrc(u8 *buffer, u32 length); void Wb35Reg_phy_calibration(struct hw_data *hw_data); -void Wb35Reg_Update(struct hw_data *hw_data, u16 register_no, u32 register_value); +void Wb35Reg_Update(struct hw_data *hw_data, u16 register_no, + u32 register_value); unsigned char adjust_TXVGA_for_iq_mag(struct hw_data *hw_data); #endif -- 1.8.1.2 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: dgnc: neo_uart_struct: adds marker and changes vars' types for sparse
This patch fixes these warnings found in the neo.c file: warning: incorrect type in argument 1 (different address spaces) expected void const volatile [noderef] *addr got unsigned char volatile * warning: incorrect type in argument 2 (different address spaces) expected void volatile [noderef] *addr got unsigned char volatile * The variables passed to readb and writeb need to be of type u8 with a __iomem marker. These warnings were popping up everytime the readb and writeb functions were called with a neo_uart_struct variable. The change made to the driver.h file adds the marker to the neo_uart_struct and the changes in neo.h changes the variables' types. Signed-off-by: Lidza Louina --- drivers/staging/dgnc/dgnc_driver.h | 2 +- drivers/staging/dgnc/dgnc_neo.h| 42 +++--- 2 files changed, 22 insertions(+), 22 deletions(-) diff --git a/drivers/staging/dgnc/dgnc_driver.h b/drivers/staging/dgnc/dgnc_driver.h index 6644e95..953d904 100644 --- a/drivers/staging/dgnc/dgnc_driver.h +++ b/drivers/staging/dgnc/dgnc_driver.h @@ -480,7 +480,7 @@ struct channel_t { uchar ch_mostat; /* FEP output modem status */ uchar ch_mistat; /* FEP input modem status */ - struct neo_uart_struct *ch_neo_uart;/* Pointer to the "mapped" UART struct */ + struct neo_uart_struct __iomem *ch_neo_uart;/* Pointer to the "mapped" UART struct */ struct cls_uart_struct __iomem *ch_cls_uart;/* Pointer to the "mapped" UART struct */ uchar ch_cached_lsr; /* Cached value of the LSR register */ diff --git a/drivers/staging/dgnc/dgnc_neo.h b/drivers/staging/dgnc/dgnc_neo.h index f7f569b..7ec5710 100644 --- a/drivers/staging/dgnc/dgnc_neo.h +++ b/drivers/staging/dgnc/dgnc_neo.h @@ -36,27 +36,27 @@ / struct neo_uart_struct { - volatile uchar txrx;/* WR RHR/THR - Holding Reg */ - volatile uchar ier; /* WR IER - Interrupt Enable Reg */ - volatile uchar isr_fcr; /* WR ISR/FCR - Interrupt Status Reg/Fifo Control Reg */ - volatile uchar lcr; /* WR LCR - Line Control Reg */ - volatile uchar mcr; /* WR MCR - Modem Control Reg */ - volatile uchar lsr; /* WR LSR - Line Status Reg */ - volatile uchar msr; /* WR MSR - Modem Status Reg */ - volatile uchar spr; /* WR SPR - Scratch Pad Reg */ - volatile uchar fctr;/* WR FCTR - Feature Control Reg */ - volatile uchar efr; /* WR EFR - Enhanced Function Reg */ - volatile uchar tfifo; /* WR TXCNT/TXTRG - Transmit FIFO Reg */ - volatile uchar rfifo; /* WR RXCNT/RXTRG - Recieve FIFO Reg */ - volatile uchar xoffchar1; /* WR XOFF 1 - XOff Character 1 Reg */ - volatile uchar xoffchar2; /* WR XOFF 2 - XOff Character 2 Reg */ - volatile uchar xonchar1;/* WR XON 1 - Xon Character 1 Reg */ - volatile uchar xonchar2;/* WR XON 2 - XOn Character 2 Reg */ - - volatile uchar reserved1[0x2ff - 0x200]; /* U Reserved by Exar */ - volatile uchar txrxburst[64]; /* RW 64 bytes of RX/TX FIFO Data */ - volatile uchar reserved2[0x37f - 0x340]; /* U Reserved by Exar */ - volatile uchar rxburst_with_errors[64]; /* R 64 bytes of RX FIFO Data + LSR */ + u8 txrx;/* WR RHR/THR - Holding Reg */ + u8 ier; /* WR IER - Interrupt Enable Reg */ + u8 isr_fcr; /* WR ISR/FCR - Interrupt Status Reg/Fifo Control Reg */ + u8 lcr; /* WR LCR - Line Control Reg */ + u8 mcr; /* WR MCR - Modem Control Reg */ + u8 lsr; /* WR LSR - Line Status Reg */ + u8 msr; /* WR MSR - Modem Status Reg */ + u8 spr; /* WR SPR - Scratch Pad Reg */ + u8 fctr;/* WR FCTR - Feature Control Reg */ + u8 efr; /* WR EFR - Enhanced Function Reg */ + u8 tfifo; /* WR TXCNT/TXTRG - Transmit FIFO Reg */ + u8 rfifo; /* WR RXCNT/RXTRG - Recieve FIFO Reg */ + u8 xoffchar1; /* WR XOFF 1 - XOff Character 1 Reg */ + u8 xoffchar2; /* WR XOFF 2 - XOff Character 2 Reg */ + u8 xonchar1;/* WR XON 1 - Xon Character 1 Reg */ + u8 xonchar2;/* WR XON 2 - XOn Character 2 Reg */ + + u8 reserved1[0x2ff - 0x200]; /* U Reserved by Exar */ + u8 txrxburst[64]; /* RW 64 bytes of RX/TX FIFO Data */ + u8 reserved2[0x37f - 0x340]; /* U Reserved by Exar */ + u8 rxburst_with_errors[64]; /* R 64 bytes of RX FIFO Data + LSR */ }; /* Where to read the extended interrupt register (32bits instead of 8bits) */ -- 1.8.1.2 ___ devel mailing list
Re: [PATCH 05/24] Staging: winbond: phy_calibration: fixed some lines over 80 characters
On Mon, Aug 26, 2013 at 05:10:04PM +0200, Iker Pedrosa wrote: > Second of the patches that fixes the lines over 80 characters in > phy_calibration.c > > Signed-off-by: Iker Pedrosa > --- > drivers/staging/winbond/phy_calibration.c | 12 > 1 file changed, 8 insertions(+), 4 deletions(-) > > diff --git a/drivers/staging/winbond/phy_calibration.c > b/drivers/staging/winbond/phy_calibration.c > index 6635c85..a4f3773 100644 > --- a/drivers/staging/winbond/phy_calibration.c > +++ b/drivers/staging/winbond/phy_calibration.c > @@ -1233,8 +1233,10 @@ u8 _rx_iq_calibration_loop_winbond(struct hw_data > *phw_data, u16 factor, u32 fre > b_2 = (rot_image_q_b * 32768) / rot_tone_i_b - > phw_data->iq_rsdl_phase_tx_d2; > > - PHY_DEBUG(("[CAL]** iq_rsdl_gain_tx_d2 = %d\n", > phw_data->iq_rsdl_gain_tx_d2)); > - PHY_DEBUG(("[CAL]** iq_rsdl_phase_tx_d2= %d\n", > phw_data->iq_rsdl_phase_tx_d2)); > + PHY_DEBUG(("[CAL]** iq_rsdl_gain_tx_d2 = %d\n", > +phw_data->iq_rsdl_gain_tx_d2)); Don't redo this, but really these should be aligned like this: PHY_DEBUG(("[CAL]** iq_rsdl_gain_tx_d2 = %d\n", phw_data->iq_rsdl_gain_tx_d2)); In the end, we're going to remove all these debugging prints so it's not worth redoing in a later patch. What you have is fine. The message itself is sort of nonsense. > + PHY_DEBUG(("[CAL]** iq_rsdl_phase_tx_d2= %d\n", > +phw_data->iq_rsdl_phase_tx_d2)); > PHY_DEBUG(("[CAL]* EPSILON/2 = %d\n", a_2)); > PHY_DEBUG(("[CAL]* THETA/2 = %d\n", b_2)); > > @@ -1280,7 +1282,8 @@ u8 _rx_iq_calibration_loop_winbond(struct hw_data > *phw_data, u16 factor, u32 fre > > /* e. */ > pwr_tone = (iqcal_tone_i*iqcal_tone_i + > iqcal_tone_q*iqcal_tone_q); > - pwr_image = (iqcal_image_i*iqcal_image_i + > iqcal_image_q*iqcal_image_q)*factor; > + pwr_image = (iqcal_image_i*iqcal_image_i + > +iqcal_image_q*iqcal_image_q)*factor; Don't resend, eventually, someone will have to fix these across the whole driver but this should be: pwr_image = (iqcal_image_i * iqcal_image_i + iqcal_image_q * iqcal_image_q) * factor; I've changed the alignment and added spaces around the math operations. regards, dan carpenter ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 09/24] Staging: winbond: reg: fixed some lines over 80 characters
On Mon, Aug 26, 2013 at 05:10:08PM +0200, Iker Pedrosa wrote: > First of the patches that fixes the lines over 80 characters in reg.c > > Signed-off-by: Iker Pedrosa > --- > drivers/staging/winbond/reg.c | 30 +- > 1 file changed, 17 insertions(+), 13 deletions(-) > > diff --git a/drivers/staging/winbond/reg.c b/drivers/staging/winbond/reg.c > index 61916f5..b1d977a 100644 > --- a/drivers/staging/winbond/reg.c > +++ b/drivers/staging/winbond/reg.c > @@ -809,12 +809,12 @@ u32 w89rf242_txvga_data[][5] = { > {(0x05 << 24) | 0x24C7CA, 34, 0x00292315, 0x0800FEFF, 0x72724242} > }; > > -/* > == > */ > +/* = > */ Just delete these. They are not kernel style. regards, dan carpenter ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 22/24] Staging: winbond: wb35tx_s: erased the spaces after opening a '['
Erased the spaces that existed after opening some square brackets '['. Signed-off-by: Iker Pedrosa --- drivers/staging/winbond/wb35tx_s.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/winbond/wb35tx_s.h b/drivers/staging/winbond/wb35tx_s.h index 715f87d..dc12008 100644 --- a/drivers/staging/winbond/wb35tx_s.h +++ b/drivers/staging/winbond/wb35tx_s.h @@ -12,7 +12,7 @@ /* Internal variable for module */ struct wb35_tx { /* For Tx buffer */ - u8 TxBuffer[ MAX_USB_TX_BUFFER_NUMBER ][ MAX_USB_TX_BUFFER ]; + u8 TxBuffer[MAX_USB_TX_BUFFER_NUMBER][MAX_USB_TX_BUFFER]; /* For Interrupt pipe */ u8 EP2_buf[MAX_INTERRUPT_LENGTH]; -- 1.8.1.2 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 09/24] Staging: winbond: reg: fixed some lines over 80 characters
On Mon, Aug 26, 2013 at 05:10:08PM +0200, Iker Pedrosa wrote: > @@ -926,7 +928,8 @@ static void Set_ChanIndep_RfData_al7230_24(struct hw_data > *pHwData, u32 *pltmp, > u8 i; > for (i = 0; i < number; i++) { > pHwData->phy_para[i] = al7230_rf_data_24[i]; > - pltmp[i] = (1 << 31) | (0 << 30) | (24 << 24) | > (al7230_rf_data_24[i] & 0xff); > + pltmp[i] = (1 << 31) | (0 << 30) | (24 << 24) > +| (al7230_rf_data_24[i] & 0xff); It's always a bit hard for me to know how picky to be. Normally the '|' would be on the first line here. regards, dan carpenter ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 23/24] Staging: winbond: wbusb: fixed some lines over 80 characters
On Mon, Aug 26, 2013 at 05:10:22PM +0200, Iker Pedrosa wrote: > Fixed some lines over 80 characters. > > Signed-off-by: Iker Pedrosa > --- > drivers/staging/winbond/wbusb.c | 16 +++- > 1 file changed, 11 insertions(+), 5 deletions(-) > > diff --git a/drivers/staging/winbond/wbusb.c b/drivers/staging/winbond/wbusb.c > index 3fa1ae4..c128bc9 100644 > --- a/drivers/staging/winbond/wbusb.c > +++ b/drivers/staging/winbond/wbusb.c > @@ -169,7 +169,8 @@ static void hal_set_radio_mode(struct hw_data *pHwData, > unsigned char radio_off) > Wb35Reg_Write(pHwData, 0x0824, reg->M24_MacControl); > } > > -static void hal_set_current_channel_ex(struct hw_data *pHwData, struct > chan_info channel) > +static void hal_set_current_channel_ex(struct hw_data *pHwData, > +struct chan_info channel) These should be aligned like this: static void hal_set_current_channel_ex(struct hw_data *pHwData, struct chan_info channel) { regards, dan carpenter ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 00/24] Staging: winbond: Fixed some coding style issues
Btw, all the white space nit-pick I pointed out were pretty minor. I don't like making people redo stuff so you can fix anything you want to in later patches. regards, dan carpenter ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 05/24] Staging: winbond: phy_calibration: fixed some lines over 80 characters
On Mon, 2013-08-26 at 19:02 +0300, Dan Carpenter wrote: > On Mon, Aug 26, 2013 at 05:10:04PM +0200, Iker Pedrosa wrote: [] > > diff --git a/drivers/staging/winbond/phy_calibration.c > > b/drivers/staging/winbond/phy_calibration.c [] > > @@ -1233,8 +1233,10 @@ u8 _rx_iq_calibration_loop_winbond(struct hw_data > > *phw_data, u16 factor, u32 fre > > b_2 = (rot_image_q_b * 32768) / rot_tone_i_b - > > phw_data->iq_rsdl_phase_tx_d2; > > > > - PHY_DEBUG(("[CAL]** iq_rsdl_gain_tx_d2 = %d\n", > > phw_data->iq_rsdl_gain_tx_d2)); > > - PHY_DEBUG(("[CAL]** iq_rsdl_phase_tx_d2= %d\n", > > phw_data->iq_rsdl_phase_tx_d2)); > > + PHY_DEBUG(("[CAL]** iq_rsdl_gain_tx_d2 = %d\n", > > + phw_data->iq_rsdl_gain_tx_d2)); > > Don't redo this, but really these should be aligned like this: > > PHY_DEBUG(("[CAL]** iq_rsdl_gain_tx_d2 = %d\n", > phw_data->iq_rsdl_gain_tx_d2)); > > In the end, we're going to remove all these debugging prints so it's > not worth redoing in a later patch. What you have is fine. The > message itself is sort of nonsense. Especially true because the only #define for PHY_DEBUG is: #define PHY_DEBUG(msg, args...) None of this does anything anyway. It'd be better to send a removal of the whole lot. Does anyone still use this driver? ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: dgnc: driver.h: changes a struct board_t var's type and marker for sparse
This patch changes the board_t->re_map_membase variable type and marker. It removes these warnings found in the neo.c, driver.c and cls.c files: warning: incorrect type in argument 1 (different address spaces) expected void const volatile [noderef] *addr got unsigned char volatile * warning: incorrect type in argument 2 (different address spaces) expected void volatile [noderef] *addr got unsigned char volatile * The variables passed to readb and writeb need to be of type u8 with a __iomem marker. These warnings were popping up everytime the readb and writeb functions were called with a board_t->re_map_membase variable. The change made to the driver.h file adds the marker and changes the variable type. Signed-off-by: Lidza Louina --- drivers/staging/dgnc/dgnc_driver.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/dgnc/dgnc_driver.h b/drivers/staging/dgnc/dgnc_driver.h index 953d904..e77303c 100644 --- a/drivers/staging/dgnc/dgnc_driver.h +++ b/drivers/staging/dgnc/dgnc_driver.h @@ -324,7 +324,7 @@ struct board_t { ulong membase;/* Start of base memory of the card */ ulong membase_end;/* End of base memory of the card */ - uchar *re_map_membase;/* Remapped memory of the card */ + u8 __iomem *re_map_membase;/* Remapped memory of the card */ ulong iobase; /* Start of io base of the card */ ulong iobase_end; /* End of io base of the card */ -- 1.8.1.2 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: dgnc: cls.c: changes var in cls_vpd function for sparse
This patch changes cls_vpd function's re_map_vpdbase variable type and marker. It removes these warnings found in cls.c: warning: incorrect type in assignment (different address spaces) expected unsigned char [usertype] *re_map_vpdbase got void [noderef] * warning: incorrect type in argument 1 (different address spaces) expected void const volatile [noderef] *addr got unsigned char [usertype] * warning: incorrect type in argument 1 (different address spaces) expected void volatile [noderef] *addr got unsigned char [usertype] *re_map_vpdbase The variables passed to readb needs to be of type u8 with a __iomem marker. re_map_vpdbase is passed into readb in the code. Signed-off-by: Lidza Louina --- drivers/staging/dgnc/dgnc_cls.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/dgnc/dgnc_cls.c b/drivers/staging/dgnc/dgnc_cls.c index 92ecbfb..117e158 100644 --- a/drivers/staging/dgnc/dgnc_cls.c +++ b/drivers/staging/dgnc/dgnc_cls.c @@ -1381,7 +1381,7 @@ static void cls_send_immediate_char(struct channel_t *ch, unsigned char c) static void cls_vpd(struct board_t *brd) { ulong vpdbase;/* Start of io base of the card */ -uchar *re_map_vpdbase;/* Remapped memory of the card */ +u8 __iomem *re_map_vpdbase;/* Remapped memory of the card */ int i = 0; -- 1.8.1.2 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: dgnc: neo.c: changes param in neo_read_eeprom function for sparse
This patch adds a marker to neo_read_eeprom function's base parameter. It removes these warnings found in neo.c: warning: incorrect type in argument 1 (different address spaces) expected unsigned char *base got unsigned char [noderef] [usertype] *re_map_membase warning: incorrect type in argument 2 (different address spaces) expected void volatile [noderef] *addr got unsigned char * These warnings happen because this function gets called with a board_t->re_map_base variable. A previous patch added the __iomem marker to this variable. This patch ensures that the changes are consistent. Signed-off-by: Lidza Louina --- drivers/staging/dgnc/dgnc_neo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/dgnc/dgnc_neo.c b/drivers/staging/dgnc/dgnc_neo.c index 22c8ce3..8b9e09a 100644 --- a/drivers/staging/dgnc/dgnc_neo.c +++ b/drivers/staging/dgnc/dgnc_neo.c @@ -1898,7 +1898,7 @@ static void neo_send_immediate_char(struct channel_t *ch, unsigned char c) } -static unsigned int neo_read_eeprom(unsigned char *base, unsigned int address) +static unsigned int neo_read_eeprom(unsigned char __iomem *base, unsigned int address) { unsigned int enable; unsigned int bits; -- 1.8.1.2 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: dgnc: tty.c: edits var in init func for sparse
This patch edits the vaddr variable in dgnc_tty_init. The variable gets set to board_t->re_map_membase. A previous patch changed the re_map_membase variable's marker and type. This patch makes sure that the changes are consistent and that it doesn't cause sparse warnings. Signed-off-by: Lidza Louina --- drivers/staging/dgnc/dgnc_tty.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/dgnc/dgnc_tty.c b/drivers/staging/dgnc/dgnc_tty.c index f0ecc65..a54b829 100644 --- a/drivers/staging/dgnc/dgnc_tty.c +++ b/drivers/staging/dgnc/dgnc_tty.c @@ -344,7 +344,7 @@ int dgnc_tty_register(struct board_t *brd) int dgnc_tty_init(struct board_t *brd) { int i; - uchar *vaddr; + u8 __iomem *vaddr; struct channel_t *ch; if (!brd) -- 1.8.1.2 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 1/1] Drivers: hv: vmbus: Fix a bug in the handling of channel offers
The channel state should be correctly set before registering the device. In the current code the driver probe would fail for channels that have been rescinded and subsequently re-offered. Fix the bug. Signed-off-by: K. Y. Srinivasan Cc: --- drivers/hv/channel_mgmt.c | 14 +++--- 1 files changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/hv/channel_mgmt.c b/drivers/hv/channel_mgmt.c index 12ec8c8..bbff5f2 100644 --- a/drivers/hv/channel_mgmt.c +++ b/drivers/hv/channel_mgmt.c @@ -293,6 +293,13 @@ static void vmbus_process_offer(struct work_struct *work) } /* +* This state is used to indicate a successful open +* so that when we do close the channel normally, we +* can cleanup properly +*/ + newchannel->state = CHANNEL_OPEN_STATE; + + /* * Start the process of binding this offer to the driver * We need to set the DeviceObject field before calling * vmbus_child_dev_add() @@ -318,13 +325,6 @@ static void vmbus_process_offer(struct work_struct *work) kfree(newchannel->device_obj); free_channel(newchannel); - } else { - /* -* This state is used to indicate a successful open -* so that when we do close the channel normally, we -* can cleanup properly -*/ - newchannel->state = CHANNEL_OPEN_STATE; } } -- 1.7.4.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 1/1] Drivers: hv: vmbus: Fix a bug in the handling of channel offers
On Mon, Aug 26, 2013 at 02:08:58PM -0700, K. Y. Srinivasan wrote: > The channel state should be correctly set before registering the device. In > the current > code the driver probe would fail for channels that have been rescinded and > subsequently > re-offered. Fix the bug. > > Signed-off-by: K. Y. Srinivasan > Cc: What older kernel versions have this bug? When did it show up? thanks, greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 1/1] X86: Hyper-V: Get the local APIC timer frequency from the hypervisor
Hyper-V supports a mechanism for retrieving the local API frequency.Use this and bypass the calibration code in the kernel. This would allow us to boot the Linux kernel as a "modern VM" on Hyper-V where many of the legacy devices (such as PIT) are not emulated. I would like to thank Olaf Hering , Jan Beulich and H. Peter Anvin for their help in this effort. Signed-off-by: K. Y. Srinivasan --- arch/x86/include/uapi/asm/hyperv.h | 13 + arch/x86/kernel/cpu/mshyperv.c | 17 + 2 files changed, 30 insertions(+), 0 deletions(-) diff --git a/arch/x86/include/uapi/asm/hyperv.h b/arch/x86/include/uapi/asm/hyperv.h index b80420b..df3d680 100644 --- a/arch/x86/include/uapi/asm/hyperv.h +++ b/arch/x86/include/uapi/asm/hyperv.h @@ -27,6 +27,13 @@ #define HV_X64_MSR_VP_RUNTIME_AVAILABLE(1 << 0) /* Partition Reference Counter (HV_X64_MSR_TIME_REF_COUNT) available*/ #define HV_X64_MSR_TIME_REF_COUNT_AVAILABLE(1 << 1) + +/* Local APIC timer frequency MSR (HV_X64_MSR_APIC_FREQUENCY) is available */ +#define HV_X64_MSR_APIC_FREQUENCY_AVAILABLE (1 << 11) + +/* TSC frequency MSR (HV_X64_MSR_TSC_FREQUENCY) is available */ +#define HV_X64_MSR_TSC_FREQUENCY_AVAILABLE (1 << 11) + /* * Basic SynIC MSRs (HV_X64_MSR_SCONTROL through HV_X64_MSR_EOM * and HV_X64_MSR_SINT0 through HV_X64_MSR_SINT15) available @@ -136,6 +143,12 @@ /* MSR used to read the per-partition time reference counter */ #define HV_X64_MSR_TIME_REF_COUNT 0x4020 +/* MSR used to retrive the TSC frequency */ +#define HV_X64_MSR_TSC_FREQUENCY 0x4022 + +/* MSR used to retrive the local APIC timer frequency */ +#define HV_X64_MSR_APIC_FREQUENCY 0x4023 + /* Define the virtual APIC registers */ #define HV_X64_MSR_EOI 0x4070 #define HV_X64_MSR_ICR 0x4071 diff --git a/arch/x86/kernel/cpu/mshyperv.c b/arch/x86/kernel/cpu/mshyperv.c index 71a39f3..0593fd9 100644 --- a/arch/x86/kernel/cpu/mshyperv.c +++ b/arch/x86/kernel/cpu/mshyperv.c @@ -23,6 +23,7 @@ #include #include #include +#include struct ms_hyperv_info ms_hyperv; EXPORT_SYMBOL_GPL(ms_hyperv); @@ -76,6 +77,22 @@ static void __init ms_hyperv_init_platform(void) printk(KERN_INFO "HyperV: features 0x%x, hints 0x%x\n", ms_hyperv.features, ms_hyperv.hints); + if (ms_hyperv.features & HV_X64_MSR_APIC_FREQUENCY_AVAILABLE) { + /* +* There is no need to calibrate APIC timer frequency; +* nor is there a need to calibrate timer. +*/ + legacy_pic = &null_legacy_pic; + + /* +* Get the APIC frequency. +*/ + rdmsrl(HV_X64_MSR_APIC_FREQUENCY, lapic_timer_frequency); + lapic_timer_frequency /= HZ; + printk(KERN_INFO "HyperV: LAPIC Timer Frequency: 0x%x\n", + lapic_timer_frequency); + } + if (ms_hyperv.features & HV_X64_MSR_TIME_REF_COUNT_AVAILABLE) clocksource_register_hz(&hyperv_cs, NSEC_PER_SEC/100); } -- 1.7.4.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
RE: [PATCH 1/1] Drivers: hv: vmbus: Fix a bug in the handling of channel offers
> -Original Message- > From: Greg KH [mailto:gre...@linuxfoundation.org] > Sent: Monday, August 26, 2013 2:57 PM > To: KY Srinivasan > Cc: linux-ker...@vger.kernel.org; de...@linuxdriverproject.org; > o...@aepfle.de; > a...@canonical.com; jasow...@redhat.com; sta...@vger.kernel.org > Subject: Re: [PATCH 1/1] Drivers: hv: vmbus: Fix a bug in the handling of > channel > offers > > On Mon, Aug 26, 2013 at 02:08:58PM -0700, K. Y. Srinivasan wrote: > > The channel state should be correctly set before registering the device. In > > the > current > > code the driver probe would fail for channels that have been rescinded and > subsequently > > re-offered. Fix the bug. > > > > Signed-off-by: K. Y. Srinivasan > > Cc: > > What older kernel versions have this bug? When did it show up? The patch that introduced the bug is: commit e68d2971d26577b932a16333ce165af98a96e068 Author: K. Y. Srinivasan Date: Thu May 23 12:02:32 2013 -0700 Drivers: hv: vmbus: Implement multi-channel support I think 3.10 shipped with this bug. Regards, K. Y > > thanks, > > greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 1/1] Drivers: hv: vmbus: Fix a bug in the handling of channel offers
On Mon, Aug 26, 2013 at 10:48:16PM +, KY Srinivasan wrote: > > > > -Original Message- > > From: Greg KH [mailto:gre...@linuxfoundation.org] > > Sent: Monday, August 26, 2013 2:57 PM > > To: KY Srinivasan > > Cc: linux-ker...@vger.kernel.org; de...@linuxdriverproject.org; > > o...@aepfle.de; > > a...@canonical.com; jasow...@redhat.com; sta...@vger.kernel.org > > Subject: Re: [PATCH 1/1] Drivers: hv: vmbus: Fix a bug in the handling of > > channel > > offers > > > > On Mon, Aug 26, 2013 at 02:08:58PM -0700, K. Y. Srinivasan wrote: > > > The channel state should be correctly set before registering the device. > > > In the > > current > > > code the driver probe would fail for channels that have been rescinded and > > subsequently > > > re-offered. Fix the bug. > > > > > > Signed-off-by: K. Y. Srinivasan > > > Cc: > > > > What older kernel versions have this bug? When did it show up? > > The patch that introduced the bug is: > > commit e68d2971d26577b932a16333ce165af98a96e068 > Author: K. Y. Srinivasan > Date: Thu May 23 12:02:32 2013 -0700 > > Drivers: hv: vmbus: Implement multi-channel support > > I think 3.10 shipped with this bug. Why do you think that, it's not what git shows: $ git describe --contains e68d2971d26577b932a16333ce165af98a96e068 v3.11-rc1~157^2~64 So this is a 3.11-only thing, right? thanks, greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
RE: [PATCH 1/1] Drivers: hv: vmbus: Fix a bug in the handling of channel offers
> -Original Message- > From: Greg KH [mailto:gre...@linuxfoundation.org] > Sent: Monday, August 26, 2013 4:14 PM > To: KY Srinivasan > Cc: linux-ker...@vger.kernel.org; de...@linuxdriverproject.org; > o...@aepfle.de; > a...@canonical.com; jasow...@redhat.com; sta...@vger.kernel.org > Subject: Re: [PATCH 1/1] Drivers: hv: vmbus: Fix a bug in the handling of > channel > offers > > On Mon, Aug 26, 2013 at 10:48:16PM +, KY Srinivasan wrote: > > > > > > > -Original Message- > > > From: Greg KH [mailto:gre...@linuxfoundation.org] > > > Sent: Monday, August 26, 2013 2:57 PM > > > To: KY Srinivasan > > > Cc: linux-ker...@vger.kernel.org; de...@linuxdriverproject.org; > o...@aepfle.de; > > > a...@canonical.com; jasow...@redhat.com; sta...@vger.kernel.org > > > Subject: Re: [PATCH 1/1] Drivers: hv: vmbus: Fix a bug in the handling of > channel > > > offers > > > > > > On Mon, Aug 26, 2013 at 02:08:58PM -0700, K. Y. Srinivasan wrote: > > > > The channel state should be correctly set before registering the > > > > device. In > the > > > current > > > > code the driver probe would fail for channels that have been rescinded > > > > and > > > subsequently > > > > re-offered. Fix the bug. > > > > > > > > Signed-off-by: K. Y. Srinivasan > > > > Cc: > > > > > > What older kernel versions have this bug? When did it show up? > > > > The patch that introduced the bug is: > > > > commit e68d2971d26577b932a16333ce165af98a96e068 > > Author: K. Y. Srinivasan > > Date: Thu May 23 12:02:32 2013 -0700 > > > > Drivers: hv: vmbus: Implement multi-channel support > > > > I think 3.10 shipped with this bug. > > Why do you think that, it's not what git shows: > $ git describe --contains e68d2971d26577b932a16333ce165af98a96e068 > v3.11-rc1~157^2~64 > > So this is a 3.11-only thing, right? My mistake; I was looking at some version of linux-3.10 code that had this problem and so I assumed it must have shipped in 3.10. Regards, K. Y > > thanks, > > greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 3/4] staging: comedi: dmm32at: fix dmm32at_dio_insn_config()
This is the (*insn_config) function for a DIO subdevice. It should be using the data[0] value as the "instruction" to perform on the subdevice. Use the comedi_dio_insn_config() helper to properly handle instructions. Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/dmm32at.c | 35 +--- 1 file changed, 19 insertions(+), 16 deletions(-) diff --git a/drivers/staging/comedi/drivers/dmm32at.c b/drivers/staging/comedi/drivers/dmm32at.c index 5237f47..118a4fd 100644 --- a/drivers/staging/comedi/drivers/dmm32at.c +++ b/drivers/staging/comedi/drivers/dmm32at.c @@ -648,31 +648,34 @@ static int dmm32at_dio_insn_bits(struct comedi_device *dev, static int dmm32at_dio_insn_config(struct comedi_device *dev, struct comedi_subdevice *s, - struct comedi_insn *insn, unsigned int *data) + struct comedi_insn *insn, + unsigned int *data) { struct dmm32at_private *devpriv = dev->private; + unsigned int chan = CR_CHAN(insn->chanspec); + unsigned int mask; unsigned char chanbit; - int chan = CR_CHAN(insn->chanspec); - - if (insn->n != 1) - return -EINVAL; + int ret; - if (chan < 8) + if (chan < 8) { + mask = 0xff; chanbit = DMM32AT_DIRA; - else if (chan < 16) + } else if (chan < 16) { + mask = 0x00ff00; chanbit = DMM32AT_DIRB; - else if (chan < 20) + } else if (chan < 20) { + mask = 0x0f; chanbit = DMM32AT_DIRCL; - else + } else { + mask = 0xf0; chanbit = DMM32AT_DIRCH; + } - /* The input or output configuration of each digital line is -* configured by a special insn_config instruction. chanspec -* contains the channel to be changed, and data[0] contains the -* value COMEDI_INPUT or COMEDI_OUTPUT. */ + ret = comedi_dio_insn_config(dev, s, insn, data, mask); + if (ret) + return ret; - /* if output clear the bit, otherwise set it */ - if (data[0] == COMEDI_OUTPUT) + if (data[0] == INSN_CONFIG_DIO_OUTPUT) devpriv->dio_config &= ~chanbit; else devpriv->dio_config |= chanbit; @@ -681,7 +684,7 @@ static int dmm32at_dio_insn_config(struct comedi_device *dev, /* set the DIO's to the new configuration setting */ outb(devpriv->dio_config, dev->iobase + DMM32AT_DIOCONF); - return 1; + return insn->n; } static int dmm32at_attach(struct comedi_device *dev, -- 1.8.3.2 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 1/4] staging: comedi: dt2817: fix dt2817_dio_insn_config()
This is the (*insn_config) function for a DIO subdevice. It should be using the data[0] value as the "instruction" to perform on the subdevice. Use the comedi_dio_insn_config() helper to properly handle instructions. Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/dt2817.c | 30 ++ 1 file changed, 14 insertions(+), 16 deletions(-) diff --git a/drivers/staging/comedi/drivers/dt2817.c b/drivers/staging/comedi/drivers/dt2817.c index 51cf121..f4a8529 100644 --- a/drivers/staging/comedi/drivers/dt2817.c +++ b/drivers/staging/comedi/drivers/dt2817.c @@ -43,28 +43,26 @@ Configuration options: static int dt2817_dio_insn_config(struct comedi_device *dev, struct comedi_subdevice *s, - struct comedi_insn *insn, unsigned int *data) + struct comedi_insn *insn, + unsigned int *data) { - int mask; - int chan; - int oe = 0; - - if (insn->n != 1) - return -EINVAL; + unsigned int chan = CR_CHAN(insn->chanspec); + unsigned int oe = 0; + unsigned int mask; + int ret; - chan = CR_CHAN(insn->chanspec); if (chan < 8) - mask = 0xff; + mask = 0x00ff; else if (chan < 16) - mask = 0xff00; + mask = 0xff00; else if (chan < 24) - mask = 0xff; + mask = 0x00ff; else mask = 0xff00; - if (data[0]) - s->io_bits |= mask; - else - s->io_bits &= ~mask; + + ret = comedi_dio_insn_config(dev, s, insn, data, mask); + if (ret) + return ret; if (s->io_bits & 0x00ff) oe |= 0x1; @@ -77,7 +75,7 @@ static int dt2817_dio_insn_config(struct comedi_device *dev, outb(oe, dev->iobase + DT2817_CR); - return 1; + return insn->n; } static int dt2817_dio_insn_bits(struct comedi_device *dev, -- 1.8.3.2 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 0/4] staging: comedi: drivers: more users of comedi_dio_insn_config()
These drivers all improperly implement the (*insn_config) for a DIO subdevice. They all treat the data[0] value as a flag to configure the channel in insn->chanspec as either an output or an input. The data[0] value is actually the 'instruction' to be performed on the channel. Use the comedi_dio_insn_config() helper to properly handle instructions. H Hartley Sweeten (4): staging: comedi: dt2817: fix dt2817_dio_insn_config() staging: comedi: dt282x: fix dt282x_dio_insn_config() staging: comedi: dmm32at: fix dmm32at_dio_insn_config() staging: comedi: ni_atmio16d: fix atmio16d_dio_insn_config() drivers/staging/comedi/drivers/dmm32at.c | 35 +++- drivers/staging/comedi/drivers/dt2817.c | 30 +++- drivers/staging/comedi/drivers/dt282x.c | 25 +++- drivers/staging/comedi/drivers/ni_atmio16d.c | 22 ++--- 4 files changed, 60 insertions(+), 52 deletions(-) -- 1.8.3.2 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 2/4] staging: comedi: dt282x: fix dt282x_dio_insn_config()
This is the (*insn_config) function for a DIO subdevice. It should be using the data[0] value as the "instruction" to perform on the subdevice. Use the comedi_dio_insn_config() helper to properly handle instructions. Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/dt282x.c | 25 ++--- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/drivers/staging/comedi/drivers/dt282x.c b/drivers/staging/comedi/drivers/dt282x.c index 4a25382..da3ee85 100644 --- a/drivers/staging/comedi/drivers/dt282x.c +++ b/drivers/staging/comedi/drivers/dt282x.c @@ -982,29 +982,32 @@ static int dt282x_dio_insn_bits(struct comedi_device *dev, static int dt282x_dio_insn_config(struct comedi_device *dev, struct comedi_subdevice *s, - struct comedi_insn *insn, unsigned int *data) + struct comedi_insn *insn, + unsigned int *data) { struct dt282x_private *devpriv = dev->private; - int mask; + unsigned int chan = CR_CHAN(insn->chanspec); + unsigned int mask; + int ret; - mask = (CR_CHAN(insn->chanspec) < 8) ? 0x00ff : 0xff00; - if (data[0]) - s->io_bits |= mask; + if (chan < 8) + mask = 0x00ff; else - s->io_bits &= ~mask; + mask = 0xff00; + + ret = comedi_dio_insn_config(dev, s, insn, data, mask); + if (ret) + return ret; + devpriv->dacsr &= ~(DT2821_LBOE | DT2821_HBOE); if (s->io_bits & 0x00ff) devpriv->dacsr |= DT2821_LBOE; - else - devpriv->dacsr &= ~DT2821_LBOE; if (s->io_bits & 0xff00) devpriv->dacsr |= DT2821_HBOE; - else - devpriv->dacsr &= ~DT2821_HBOE; outw(devpriv->dacsr, dev->iobase + DT2821_DACSR); - return 1; + return insn->n; } static const struct comedi_lrange *const ai_range_table[] = { -- 1.8.3.2 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 4/4] staging: comedi: ni_atmio16d: fix atmio16d_dio_insn_config()
This is the (*insn_config) function for a DIO subdevice. It should be using the data[0] value as the "instruction" to perform on the subdevice. Use the comedi_dio_insn_config() helper to properly handle instructions. Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/ni_atmio16d.c | 22 +- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/drivers/staging/comedi/drivers/ni_atmio16d.c b/drivers/staging/comedi/drivers/ni_atmio16d.c index 8520d83..bb3491f 100644 --- a/drivers/staging/comedi/drivers/ni_atmio16d.c +++ b/drivers/staging/comedi/drivers/ni_atmio16d.c @@ -576,15 +576,19 @@ static int atmio16d_dio_insn_config(struct comedi_device *dev, unsigned int *data) { struct atmio16d_private *devpriv = dev->private; - int i; - int mask; + unsigned int chan = CR_CHAN(insn->chanspec); + unsigned int mask; + int ret; + + if (chan < 4) + mask = 0x0f; + else + mask = 0xf0; + + ret = comedi_dio_insn_config(dev, s, insn, data, mask); + if (ret) + return ret; - for (i = 0; i < insn->n; i++) { - mask = (CR_CHAN(insn->chanspec) < 4) ? 0x0f : 0xf0; - s->io_bits &= ~mask; - if (data[i]) - s->io_bits |= mask; - } devpriv->com_reg_2_state &= ~(COMREG2_DOUTEN0 | COMREG2_DOUTEN1); if (s->io_bits & 0x0f) devpriv->com_reg_2_state |= COMREG2_DOUTEN0; @@ -592,7 +596,7 @@ static int atmio16d_dio_insn_config(struct comedi_device *dev, devpriv->com_reg_2_state |= COMREG2_DOUTEN1; outw(devpriv->com_reg_2_state, dev->iobase + COM_REG_2); - return i; + return insn->n; } /* -- 1.8.3.2 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel