4 echo "rt2x00 eeprom: " "$*"
8 rt2x00_eeprom_extract() {
16 mtd=$(find_mtd_part $part)
18 rt2x00_eeprom_die "no mtd device found for partition $part"
20 dd if=$mtd of=/lib/firmware/$FIRMWARE bs=1 skip=$offset count=$count 2>/dev/null || \
21 rt2x00_eeprom_die "failed to extract from $mtd"
24 rt2x00_eeprom_set_macaddr() {
27 [ -n "$macaddr" ] || \
28 rt2x00_eeprom_die "invalid wlan mac address"
30 macaddr_2bin $macaddr | dd of=/lib/firmware/$FIRMWARE \
31 conv=notrunc bs=1 seek=4 count=6 2>/dev/null || \
32 rt2x00_eeprom_die "failed to write mac address to eeprom file"
35 FW="/lib/firmware/$FIRMWARE"
36 [ -e "$FW" ] && exit 0
39 . /lib/functions/system.sh
41 board=$(ramips_board_name)
47 rt2x00_eeprom_die "Please define mtd-eeprom in $board DTS file!"
52 "rt2x00pci_1_0.eeprom")
55 rt2x00_eeprom_extract "factory" 8192 512
57 br-6475nd | rt-n56u | whr-600d | whr-1166d)
58 rt2x00_eeprom_extract "factory" 32768 512