On Mon, Jan 30, 2012 at 03:23:15PM +0100, Luigi Tarenga wrote: > - int rssi0 = rt2x00_get_field32(rxwi_w2, RXWI_W2_RSSI0); > - int rssi1 = rt2x00_get_field32(rxwi_w2, RXWI_W2_RSSI1); > - int rssi2 = rt2x00_get_field32(rxwi_w2, RXWI_W2_RSSI2); > + s8 rssi0 = rt2x00_get_field32(rxwi_w2, RXWI_W2_RSSI0); > + s8 rssi1 = rt2x00_get_field32(rxwi_w2, RXWI_W2_RSSI1); > + s8 rssi2 = rt2x00_get_field32(rxwi_w2, RXWI_W2_RSSI2); > u16 eeprom; > u8 offset0; > u8 offset1; > @@ -539,11 +539,12 @@ > /* > * Convert the value from the descriptor into the RSSI value > * If the value in the descriptor is 0, it is considered invalid > - * and the default (extremely low) rssi value is assumed > + * and the default (extremely low) rssi value is assumed. > + * HW rssiX values go from -13 (strongest) to positive number > (weakest). > */ > - rssi0 = (rssi0) ? (-12 - offset0 - rt2x00dev->lna_gain - rssi0) : -128; > - rssi1 = (rssi1) ? (-12 - offset1 - rt2x00dev->lna_gain - rssi1) : -128; > - rssi2 = (rssi2) ? (-12 - offset2 - rt2x00dev->lna_gain - rssi2) : -128; > + rssi0 = (rssi0) ? (-13 - offset0 - rt2x00dev->lna_gain - rssi0) : -128; > + rssi1 = (rssi1) ? (-13 - offset1 - rt2x00dev->lna_gain - rssi1) : -128; > + rssi2 = (rssi2) ? (-13 - offset2 - rt2x00dev->lna_gain - rssi2) : -128; Not sure if change -12 to -13 is needed, seems not compatible with vendor driver. If you just change rssiX type to s8, will it fix the problem? That seems to be correct and enough to fix (example why this make difference: 0xc0 gives s8: -64 int: 192). If you will be reposting please follow http://linux.yyz.us/patch-format.html especially add Signed-off-by: line. Thanks Stanislaw -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html