Beispiel #1
0
bool
KoboExportUSBStorage()
{
#ifdef KOBO
  bool result = false;

  RmMod("g_ether");
  RmMod("g_file_storage");

  switch (DetectKoboModel())
  {
  case KoboModel::UNKNOWN: // Let unknown try the old device
  case KoboModel::MINI:
  case KoboModel::TOUCH:
  case KoboModel::AURA:
    InsMod("/drivers/ntx508/usb/gadget/arcotg_udc.ko");
    result = InsMod("/drivers/ntx508/usb/gadget/g_file_storage.ko",
                    "file=/dev/mmcblk0p3", "stall=0");
    break;

  case KoboModel::GLO_HD:
    InsMod("/drivers/mx6sl-ntx/usb/gadget/arcotg_udc.ko");
    result = InsMod("/drivers/mx6sl-ntx/usb/gadget/g_file_storage.ko",
                    "file=/dev/mmcblk0p3", "stall=0");
    break;
  }
  return result;
#else
  return true;
#endif
}
Beispiel #2
0
bool
KoboWifiOn()
{
#ifdef KOBO
  InsMod("/drivers/ntx508/wifi/sdio_wifi_pwr.ko");
  InsMod("/drivers/ntx508/wifi/dhd.ko");

  Sleep(2000);

  Run("/sbin/ifconfig", "eth0", "up");
  Run("/bin/wlarm_le", "-i", "eth0", "up");
  Run("/bin/wpa_supplicant", "-i", "eth0",
      "-c", "/etc/wpa_supplicant/wpa_supplicant.conf",
      "-C", "/var/run/wpa_supplicant", "-B");

  Sleep(2000);

  Start("/sbin/udhcpc", "-S", "-i", "eth0",
        "-s", "/etc/udhcpc.d/default.script",
        "-t15", "-T10", "-A3", "-f", "-q");

  return true;
#else
  return false;
#endif
}
Beispiel #3
0
bool
KoboExportUSBStorage()
{
#ifdef KOBO
  RmMod("g_ether");
  RmMod("g_file_storage");

  InsMod("/drivers/ntx508/usb/gadget/arcotg_udc.ko");
  return InsMod("/drivers/ntx508/usb/gadget/g_file_storage.ko",
                "file=/dev/mmcblk0p3", "stall=0");
#else
  return true;
#endif
}
Beispiel #4
0
bool
KoboExportSerial()
{
#ifdef KOBO
  RmMod("g_ether");
  RmMod("g_file_storage");

  InsMod("/drivers/current/usb/gadget/arcotg_udc.ko");
  if(InsMod("/drivers/current/usb/gadget/g_serial.ko")) {
    for(unsigned i = 0; i < 5; ++i ) {
      if(File::Exists("/dev/ttyGS0")) {
        return true;
      }
      Sleep(100);
    }
  }
      return false;
#else
  return true;
#endif
}
Beispiel #5
0
bool
KoboWifiOn()
{
#ifdef KOBO

  switch (DetectKoboModel())
  {
  case KoboModel::UNKNOWN: // Let unknown try the old device
  case KoboModel::MINI:
  case KoboModel::TOUCH:
  case KoboModel::AURA:
    InsMod("/drivers/ntx508/wifi/sdio_wifi_pwr.ko");
    InsMod("/drivers/ntx508/wifi/dhd.ko");
    break;

  case KoboModel::GLO_HD:
    InsMod("/drivers/mx6sl-ntx/wifi/sdio_wifi_pwr.ko");
    InsMod("/drivers/mx6sl-ntx/wifi/dhd.ko");
    break;
  }

  Sleep(2000);

  Run("/sbin/ifconfig", "eth0", "up");
  Run("/bin/wlarm_le", "-i", "eth0", "up");
  Run("/bin/wpa_supplicant", "-i", "eth0",
      "-c", "/etc/wpa_supplicant/wpa_supplicant.conf",
      "-C", "/var/run/wpa_supplicant", "-B");

  Sleep(2000);

  Start("/sbin/udhcpc", "-S", "-i", "eth0",
        "-s", "/etc/udhcpc.d/default.script",
        "-t15", "-T10", "-A3", "-f", "-q");

  return true;
#else
  return false;
#endif
}
Beispiel #6
0
bool
KoboWifiOn()
{
#ifdef KOBO
  InsMod("/drivers/current/wifi/sdio_wifi_pwr.ko");

  const char * szModule = std::getenv("WIFI_MODULE_PATH");
  if(!szModule) {
    szModule = "/drivers/current/wifi/dhd.ko";
  }
  InsMod(szModule);

  Sleep(2000);
  
  const char* szInterface = std::getenv("INTERFACE");
  if(!szInterface) {
    szInterface = "eth0";
  }


  Run("/sbin/ifconfig", szInterface, "up");
  Run("/sbin/iwconfig", szInterface, "power", "off");
  Run("/bin/wlarm_le", "-i", szInterface, "up");
  Run("/bin/wpa_supplicant", "-i", szInterface,
      "-c", "/etc/wpa_supplicant/wpa_supplicant.conf",
      "-C", "/var/run/wpa_supplicant", "-B");

  Sleep(2000);

  Start("/sbin/udhcpc", "-S", "-i", szInterface,
        "-s", "/etc/udhcpc.d/default.script",
        "-t15", "-T10", "-A3", "-f", "-q");

  return true;
#else
  return false;
#endif
}