Skip to content

Commit

Permalink
Add wifi support to Cervantes Touch Light devices (koreader#12148)
Browse files Browse the repository at this point in the history
  • Loading branch information
jsanpe authored Oct 6, 2024
1 parent 80975ea commit 93935f3
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 4 deletions.
7 changes: 6 additions & 1 deletion platform/cervantes/disable-wifi.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
#!/bin/sh

PCB_ID=$(/usr/bin/ntxinfo /dev/mmcblk0 | grep pcb | cut -d ":" -f2)

# disable wifi and remove all modules
killall udhcpc wpa_supplicant 2>/dev/null
ifconfig eth0 down 2>/dev/null
modprobe -r 8189fs 2>/dev/null
if [ "${PCB_ID}" -ne 22 ] && [ "${PCB_ID}" -ne 23 ]; then #For pcb_id==22 or 23 we avoid removing the module as it's known to freeze the wifi subsystem
MODULE="8189fs"
modprobe -r ${MODULE} 2>/dev/null
fi
18 changes: 15 additions & 3 deletions platform/cervantes/enable-wifi.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,26 @@

# Do not run this script twice (ie: when no wireless is available or wireless
# association to ap failed.

# select wifi driver based on pcb.
PCB_ID=$(/usr/bin/ntxinfo /dev/mmcblk0 | grep pcb | cut -d ":" -f2)
if [ "${PCB_ID}" -eq 22 ] || [ "${PCB_ID}" -eq 23 ]; then
MODULE="dhd"
WPA_DRIVER="nl80211"
else
MODULE="8189fs"
WPA_DRIVER="wext"
fi

./disable-wifi.sh

if ! lsmod | grep -q 8189fs; then
modprobe 8189fs
if ! lsmod | grep -q ${MODULE}; then
modprobe ${MODULE}
sleep 1
fi

ifconfig eth0 up
sleep 1

wpa_supplicant -i eth0 -C /var/run/wpa_supplicant -B -D wext 2>/dev/null
wpa_supplicant -i eth0 -C /var/run/wpa_supplicant -B -D ${WPA_DRIVER} 2>/dev/null
sleep 1

0 comments on commit 93935f3

Please sign in to comment.