@@ -672,7 +672,8 @@ static struct input_dev *ps_gamepad_create(struct hid_device *hdev,
672
672
return gamepad ;
673
673
}
674
674
675
- static int ps_get_report (struct hid_device * hdev , uint8_t report_id , uint8_t * buf , size_t size )
675
+ static int ps_get_report (struct hid_device * hdev , uint8_t report_id , uint8_t * buf , size_t size ,
676
+ bool check_crc )
676
677
{
677
678
int ret ;
678
679
@@ -693,7 +694,7 @@ static int ps_get_report(struct hid_device *hdev, uint8_t report_id, uint8_t *bu
693
694
return - EINVAL ;
694
695
}
695
696
696
- if (hdev -> bus == BUS_BLUETOOTH ) {
697
+ if (hdev -> bus == BUS_BLUETOOTH && check_crc ) {
697
698
/* Last 4 bytes contains crc32. */
698
699
uint8_t crc_offset = size - 4 ;
699
700
uint32_t report_crc = get_unaligned_le32 (& buf [crc_offset ]);
@@ -894,7 +895,7 @@ static int dualsense_get_calibration_data(struct dualsense *ds)
894
895
return - ENOMEM ;
895
896
896
897
ret = ps_get_report (ds -> base .hdev , DS_FEATURE_REPORT_CALIBRATION , buf ,
897
- DS_FEATURE_REPORT_CALIBRATION_SIZE );
898
+ DS_FEATURE_REPORT_CALIBRATION_SIZE , true );
898
899
if (ret ) {
899
900
hid_err (ds -> base .hdev , "Failed to retrieve DualSense calibration info: %d\n" , ret );
900
901
goto err_free ;
@@ -976,7 +977,7 @@ static int dualsense_get_firmware_info(struct dualsense *ds)
976
977
return - ENOMEM ;
977
978
978
979
ret = ps_get_report (ds -> base .hdev , DS_FEATURE_REPORT_FIRMWARE_INFO , buf ,
979
- DS_FEATURE_REPORT_FIRMWARE_INFO_SIZE );
980
+ DS_FEATURE_REPORT_FIRMWARE_INFO_SIZE , true );
980
981
if (ret ) {
981
982
hid_err (ds -> base .hdev , "Failed to retrieve DualSense firmware info: %d\n" , ret );
982
983
goto err_free ;
@@ -1009,7 +1010,7 @@ static int dualsense_get_mac_address(struct dualsense *ds)
1009
1010
return - ENOMEM ;
1010
1011
1011
1012
ret = ps_get_report (ds -> base .hdev , DS_FEATURE_REPORT_PAIRING_INFO , buf ,
1012
- DS_FEATURE_REPORT_PAIRING_INFO_SIZE );
1013
+ DS_FEATURE_REPORT_PAIRING_INFO_SIZE , true );
1013
1014
if (ret ) {
1014
1015
hid_err (ds -> base .hdev , "Failed to retrieve DualSense pairing info: %d\n" , ret );
1015
1016
goto err_free ;
@@ -1650,7 +1651,7 @@ static int dualshock4_get_calibration_data(struct dualshock4 *ds4)
1650
1651
return - ENOMEM ;
1651
1652
1652
1653
ret = ps_get_report (hdev , DS4_FEATURE_REPORT_CALIBRATION , buf ,
1653
- DS4_FEATURE_REPORT_CALIBRATION_SIZE );
1654
+ DS4_FEATURE_REPORT_CALIBRATION_SIZE , true );
1654
1655
if (ret ) {
1655
1656
hid_err (hdev , "Failed to retrieve DualShock4 calibration info: %d\n" , ret );
1656
1657
goto err_free ;
@@ -1731,7 +1732,7 @@ static int dualshock4_get_firmware_info(struct dualshock4 *ds4)
1731
1732
return - ENOMEM ;
1732
1733
1733
1734
ret = ps_get_report (ds4 -> base .hdev , DS4_FEATURE_REPORT_FIRMWARE_INFO , buf ,
1734
- DS4_FEATURE_REPORT_FIRMWARE_INFO_SIZE );
1735
+ DS4_FEATURE_REPORT_FIRMWARE_INFO_SIZE , true );
1735
1736
if (ret ) {
1736
1737
hid_err (ds4 -> base .hdev , "Failed to retrieve DualShock4 firmware info: %d\n" , ret );
1737
1738
goto err_free ;
@@ -1755,7 +1756,7 @@ static int dualshock4_get_mac_address(struct dualshock4 *ds4)
1755
1756
return - ENOMEM ;
1756
1757
1757
1758
ret = ps_get_report (ds4 -> base .hdev , DS4_FEATURE_REPORT_PAIRING_INFO , buf ,
1758
- DS4_FEATURE_REPORT_PAIRING_INFO_SIZE );
1759
+ DS4_FEATURE_REPORT_PAIRING_INFO_SIZE , true );
1759
1760
if (ret ) {
1760
1761
hid_err (ds4 -> base .hdev , "Failed to retrieve DualShock4 pairing info: %d\n" , ret );
1761
1762
goto err_free ;
0 commit comments