M7350v3_en_gpl

This commit is contained in:
T
2024-09-09 08:55:19 +00:00
parent 801e6d2ad8
commit 2d95e8761a
2791 changed files with 89608 additions and 390711 deletions

View File

@ -1756,7 +1756,7 @@ static int mass_storage_function_init(struct android_usb_function *f,
config->fsg.nluns = 2;
config->fsg.luns[1].cdrom = 1;
config->fsg.luns[1].ro = 1;
config->fsg.luns[1].removable = 1;
config->fsg.luns[1].removable = 0;
name[1] = "lun0";
}
@ -1825,29 +1825,8 @@ static DEVICE_ATTR(inquiry_string, S_IRUGO | S_IWUSR,
mass_storage_inquiry_show,
mass_storage_inquiry_store);
//[yanghuaying start] export whether mass storage is connect to pc
static int in_suspend_mode = 0;
static ssize_t mass_storage_connect2pc_show(struct device *dev,
struct device_attribute *attr, char *buf)
{
struct android_usb_function *f = dev_get_drvdata(dev);
struct mass_storage_function_config *config = f->config;
int available = 0;
if(config->common->new_fsg != NULL && !in_suspend_mode)
available = 1;
pr_info("in_suspend_mode = %d\n", in_suspend_mode);
return snprintf(buf, PAGE_SIZE, "%d\n", available);
}
static DEVICE_ATTR(connect2pc, 0444,
mass_storage_connect2pc_show,
NULL);
//[yanghuaying end]
static struct device_attribute *mass_storage_function_attributes[] = {
&dev_attr_inquiry_string,
&dev_attr_connect2pc,
NULL
};
@ -2693,11 +2672,6 @@ android_setup(struct usb_gadget *gadget, const struct usb_ctrlrequest *c)
if (value < 0)
value = composite_setup(gadget, c);
/*[yanghuaying] when device discnnect from pc, it will first receive a
suspend event,but when reconnect to pc,may not receive corresponding
resume event(may just receive a connect event), now reinit in_suspend_mode*/
in_suspend_mode = 0;
spin_lock_irqsave(&cdev->lock, flags);
if (!dev->connected) {
dev->connected = 1;
@ -2736,11 +2710,6 @@ static void android_suspend(struct usb_gadget *gadget)
struct android_dev *dev = cdev_to_android_dev(cdev);
unsigned long flags;
/*[yanghuaying] when device connect to pc by hub, afetr hub disconnect
from pc,device will go into suspend mode(a suspend event,not a
disconnect event),mass storage function is unusable*/
in_suspend_mode = 1;
spin_lock_irqsave(&cdev->lock, flags);
dev->suspended = 1;
schedule_work(&dev->work);
@ -2755,10 +2724,6 @@ static void android_resume(struct usb_gadget *gadget)
struct android_dev *dev = cdev_to_android_dev(cdev);
unsigned long flags;
/*[yanghuaying] when device connect to pc by hub, afetr hub reconnect to pc
device will leave suspend mode,mass storage function is usable again*/
in_suspend_mode = 0;
spin_lock_irqsave(&cdev->lock, flags);
dev->suspended = 0;
schedule_work(&dev->work);

View File

@ -3004,11 +3004,6 @@ buffhds_first_it:
i = 0x0399;
}
}
/* [ouyangyi] Change mass storage device's name to "TP-LINK MMC Storage USB Device" */
#if 1
snprintf(common->inquiry_string, sizeof common->inquiry_string,
"TP-LINK MMC Storage");
#else
snprintf(common->inquiry_string, sizeof common->inquiry_string,
"%-8s%-16s%04x", cfg->vendor_name ?: "Linux",
/* Assume product name dependent on the first LUN */
@ -3016,7 +3011,6 @@ buffhds_first_it:
? "File-Stor Gadget"
: "File-CD Gadget"),
i);
#endif
/*
* Some peripheral controllers are known not to be able to

View File

@ -663,9 +663,7 @@ static void ecm_qc_suspend(struct usb_function *f)
{
struct f_ecm_qc *ecm = func_to_ecm_qc(f);
//[yanghuaying] fix reconnect fail after ecm_qc disconnect from MacOS Virtual machine
//if (f->config->cdev->gadget->remote_wakeup) {
if (1) {
if (f->config->cdev->gadget->remote_wakeup) {
bam_data_suspend(ECM_QC_ACTIVE_PORT);
} else {
/*
@ -680,7 +678,6 @@ static void ecm_qc_suspend(struct usb_function *f)
ecm_qc_bam_disconnect(ecm);
}
pr_info("%s remote_wakeup=%d\n",__func__,f->config->cdev->gadget->remote_wakeup);
pr_debug("ecm suspended\n");
}
@ -688,9 +685,7 @@ static void ecm_qc_resume(struct usb_function *f)
{
struct f_ecm_qc *ecm = func_to_ecm_qc(f);
//[yanghuaying] fix reconnect fail after ecm_qc disconnect from MacOS Virtual machine
//if (f->config->cdev->gadget->remote_wakeup) {
if (1) {
if (f->config->cdev->gadget->remote_wakeup) {
bam_data_resume(ECM_QC_ACTIVE_PORT);
} else {
/* Restore endpoint descriptors info. */
@ -698,7 +693,7 @@ static void ecm_qc_resume(struct usb_function *f)
ecm->bam_port.out->desc = ecm->out_ep_desc_backup;
ecm_qc_bam_connect(ecm);
}
pr_info("%s remote_wakeup=%d\n",__func__,f->config->cdev->gadget->remote_wakeup);
pr_debug("ecm resumed\n");
}

View File

@ -126,12 +126,7 @@ static unsigned int bitrate(struct usb_gadget *g)
if (gadget_is_superspeed(g) && g->speed == USB_SPEED_SUPER)
return 13 * 1024 * 8 * 1000 * 8;
else if (gadget_is_dualspeed(g) && g->speed == USB_SPEED_HIGH)
/* [ouyangyi] change rndis' peak rate from 425.9Mbps to 150Mbps */
#if 1
return 150 * 1000 * 1000;
#else
return 13 * 512 * 8 * 1000 * 8;
#endif
else
return 19 * 64 * 1 * 1000 * 8;
}

View File

@ -118,8 +118,8 @@ static int grmnet_ctrl_qti_send_cpkt_tomodem(u8 portno,
/* drop cpkt if port is not open */
if (!port->is_open) {
// pr_err("rmnet file handler %p(index=%d) is not open",
// port, port->index);
pr_err("rmnet file handler %p(index=%d) is not open",
port, port->index);
spin_unlock_irqrestore(&port->lock, flags);
free_rmnet_ctrl_pkt(cpkt);
return 0;