5 Commits
Author SHA1 Message Date
Hauke MehrtensandFelix Fietkau 021ded363d tools: Fix compile error with glibc
This fixes the following compile error when compiling against recent
glibc:
------------
/tools/eeprom.c:223:9: error: ignoring return value of 'fread' declared with attribute 'warn_unused_result' [-Werror=unused-result]
  223 |         fread(buf, 1, EEPROM_PART_SIZE, f);
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
------------

Signed-off-by: Hauke Mehrtens <[email protected]>
2023-03-02 22:23:43 +01:00
Hauke MehrtensandFelix Fietkau f81f42fe87 mt76: Print error message when reading EEPROM from mtd failed
When the EEPROM data is stored on a MTD partition print an error message
when reading this MTD partition failed. This is currently happening
often in OpenWrt because the initial data was written with using a flash
driver which ignores the error detection data and now OpenWrt uses a
driver which checks it.

With this patch a better error message is shown:
[    8.986988] mt7915e 0000:01:00.0: WA Firmware Version: DEV_000000, Build Time: 20201105222323
[    9.100508] mt7915e 0000:01:00.0: reading EEPROM from mtd factory failed: -117
[    9.144289] mt7915e: probe of 0000:01:00.0 failed with error -22

mt7915 does not work without an EEPROM, MT7922 still works.

Signed-off-by: Hauke Mehrtens <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-10-23 07:27:31 +02:00
Hauke MehrtensandFelix Fietkau 4c8a09cc45 tools: Set mode for new file /tmp/mt76-test-%s
Set the file system mode for the newly created file /tmp/mt76-test-%s,
this is mandatory according to the man page and fixes a compile error
with glibc.

Signed-off-by: Hauke Mehrtens <[email protected]>
2021-01-14 14:04:18 +01:00
Hauke MehrtensandFelix Fietkau eb076ae8db mt76: Add missing include of linux/module.h
MODULE_FIRMWARE() is used in usb_mcu.c and provided by linux/module.h,
but this header file is not directly included. This causes problems in
backports with some kernel versions.

Add the missing include.

Signed-off-by: Hauke Mehrtens <[email protected]>
2018-12-28 13:43:56 +01:00
Hauke MehrtensandFelix Fietkau bddaa9c449 mt76: use skb_pad() instead of __skb_pad()
mt76 uses __skb_pad() with free_on_error set to true, this is the same
as calling skb_pad().
This patch does not change any functionality, but it makes it easier to
backport this driver in backports, because skb_pad() is also available
in older kernel versions.

Fixes: b40b15e1521f ("mt76: add usb support to mt76 layer")
Signed-off-by: Hauke Mehrtens <[email protected]>
2018-09-26 22:04:27 +02:00