Beispiel #1
0
static ssize_t store_control(struct device *d,
		struct device_attribute *attr, const char *buf, size_t count)
{
	struct modemctl *mc = dev_get_drvdata(d);

	if (!strncmp(buf, "on", 2)) {
		modem_on(mc);
		return count;
	}

	if (!strncmp(buf, "off", 3)) {
		modem_off(mc);
		return count;
	}

	if (!strncmp(buf, "reset", 5)) {
		modem_reset(mc);
		return count;
	}

	if (!strncmp(buf, "boot", 4)) {
		modem_boot(mc);
		return count;
	}

	if (!strncmp(buf, "daolpu", 6)) {
		kernel_upload(mc);
		return count;
	}

	return count;
}
static ssize_t store_control(struct device *d,
		struct device_attribute *attr, const char *buf, size_t count)
{
	struct modemctl *mc = dev_get_drvdata(d);

	if (!strncmp(buf, "on", 2)) {
		modem_on(mc);
		return count;
	}

	if (!strncmp(buf, "off", 3)) {
		modem_off(mc);
		return count;
	}

	if (!strncmp(buf, "reset", 5)) {
		modem_reset(mc);
		return count;
	}

	if (!strncmp(buf, "boot", 4)) {
		//modem_boot(mc);
		ignore_irq_count = 1;		
		enable_irq(mc->irq[0]);           
		return count;
	}

	if (!strncmp(buf, "daolpu", 6)) {
		kernel_upload(mc);
		return count;
	}

	if (!strncmp(buf, "silent", 6)) {
		printk(KERN_ERR "%s -LTE Silent Reset!!!\n", __func__);        
		crash_event(1);
		return count;
	}    

	return count;
}