Exemple #1
0
static int proc_write_eeprom(struct file *foke, const char *buffer,
		unsigned long count, void *data)
{
	if (count != 5)
		return count;

	if (strncmp(buffer, "wb00", 4) == 0) {
		dump_debug("Write EEPROM!!");
		eeprom_write_boot();
	} else if (strncmp(buffer, "rb00", 4) == 0) {
		dump_debug("Read Boot!!");
		eeprom_read_boot();
	} else if (strncmp(buffer, "re00", 4) == 0) {
		dump_debug("Read EEPROM!!");
		eeprom_read_all();
	} else if (strncmp(buffer, "ee00", 4) == 0) {
		dump_debug("Erase EEPROM!!");
		eeprom_erase_all();
	} else if (strncmp(buffer, "rcal", 4) == 0) {
		dump_debug("Check Cal!!");
		eeprom_check_cal();
	} else if (strncmp(buffer, "ecer", 4) == 0) {
		dump_debug("Erase Cert!!");
		eeprom_erase_cert();
	} else if (strncmp(buffer, "rcer", 4) == 0) {
		dump_debug("Check Cert!!");
		eeprom_check_cert();
	} else if (strncmp(buffer, "wrev", 4) == 0) {
		dump_debug("Write Rev!!");
		eeprom_write_rev();
	} else if (strncmp(buffer, "ons0", 4) == 0) {
		dump_debug("Power On - SDIO MODE!!");
		g_pdata->power(0);
		g_pdata->g_cfg->wimax_mode = SDIO_MODE;
		g_pdata->power(1);
	} else if (strncmp(buffer, "off0", 4) == 0) {
		dump_debug("Power Off!!");
		g_pdata->power(0);
	} else if (strncmp(buffer, "wu00", 4) == 0) {
		dump_debug("WiMAX UART!!");
		g_pdata->switch_uart_wimax();
	} else if (strncmp(buffer, "au00", 4) == 0) {
		dump_debug("AP UART!!");
		g_pdata->switch_uart_ap();
	} else if (strncmp(buffer, "don0", 4) == 0) {
		dump_debug("Enable Dump!!");
		g_pdata->g_cfg->enable_dump_msg = 1;
	} else if (strncmp(buffer, "doff", 4) == 0) {
		dump_debug("Disable Dump!!");
		g_pdata->g_cfg->enable_dump_msg = 0;
	} else if (strncmp(buffer, "gpio", 4) == 0) {
		dump_debug("Display GPIOs!!");
		g_pdata->display_gpios();
	} else if (strncmp(buffer, "wake", 4) == 0) {
		dump_debug("g_pdata->wimax_wakeup!!");
		g_pdata->wakeup_assert(1);
		msleep(10);
		g_pdata->wakeup_assert(0);
	}

	return count - 1;
}
Exemple #2
0
static ssize_t eeprom_store(struct device *dev,
		struct device_attribute *attr,
		const char *buffer, size_t count)
{
	struct wimax732_platform_data   *pdata = dev_get_drvdata(dev);

	if (count != 5)
		return count;

	if (strncmp(buffer, "wb00", 4) == 0) {
		dump_debug("Write EEPROM!!");
		eeprom_write_boot();
	} else if (strncmp(buffer, "rb00", 4) == 0) {
		dump_debug("Read Boot!!");
		eeprom_read_boot();
	} else if (strncmp(buffer, "re00", 4) == 0) {
		dump_debug("Read EEPROM!!");
		eeprom_read_all();
	} else if (strncmp(buffer, "rrdb", 4) == 0) {
		dump_debug("Read EEPROM(RDB)!!");
		eeprom_read_RDB();
	} else if (strncmp(buffer, "srdb", 4) == 0) {
		dump_debug("Store EEPROM(RDB)!!");
		eeprom_store_RDB();
	} else if (strncmp(buffer, "rcrt", 4) == 0) {
		dump_debug("Read EEPROM(CERTI)!!");
		eeprom_read_CERTI();
	} else if (strncmp(buffer, "ee00", 4) == 0) {
		dump_debug("Erase EEPROM!!");
		eeprom_erase_all();
	} else if (strncmp(buffer, "rcal", 4) == 0) {
		dump_debug("Check Cal!!");
		eeprom_check_cal();
	} else if (strncmp(buffer, "ecer", 4) == 0) {
		dump_debug("Erase Cert!!");
		eeprom_erase_cert();
	} else if (strncmp(buffer, "rcer", 4) == 0) {
		dump_debug("Check Cert!!");
		eeprom_check_cert();
	} else if (strncmp(buffer, "wrev", 4) == 0) {
		dump_debug("Write Rev!!");
		eeprom_write_rev();
	} else if (strncmp(buffer, "ons0", 4) == 0) {
		dump_debug("Power On - SDIO MODE!!");
		pdata->power(0);
		pdata->g_cfg->wimax_mode = SDIO_MODE ;
		pdata->power(1);
	} else if (strncmp(buffer, "off0", 4) == 0) {
		dump_debug("Power Off!!");
		pdata->power(0);
	} else if (strncmp(buffer, "wu00", 4) == 0) {
		dump_debug("WiMAX UART!!");
		pdata->uart_wimax();
	} else if (strncmp(buffer, "au00", 4) == 0) {
		dump_debug("AP UART!!");
		pdata->uart_ap();
	} else if (strncmp(buffer, "don0", 4) == 0) {
		dump_debug("Enable Dump!!");
		pdata->g_cfg->enable_dump_msg = 1;
	} else if (strncmp(buffer, "doff", 4) == 0) {
		dump_debug("Disable Dump!!");
		pdata->g_cfg->enable_dump_msg = 0;
	} else if (strncmp(buffer, "gpio", 4) == 0) {
		dump_debug("Display GPIOs!!");
		pdata->gpio_display();
	} else if (strncmp(buffer, "wake", 4) == 0) {
		dump_debug("WIMAX_WAKEUP!!");
		pdata->wakeup_assert(1);
		msleep(10);
		pdata->wakeup_assert(0);
	}

	return count - 1;


}