Closed
Bug 898506
Opened 11 years ago
Closed 11 years ago
(jb-gonk) Adapt to netd protocol changes for USB tethering
Categories
(Firefox OS Graveyard :: General, defect)
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: m1, Assigned: poojas)
References
Details
Attachments
(1 file, 2 obsolete files)
(deleted),
patch
|
Details | Diff | Splinter Review |
Minor changes were made to the netd commands used to enable/disable USB tethering. We can adapt in net_worker.js.
Below net_worker.js patch help us to enable USB tethering.
# HG changeset patch
# User poojas <poojas@codeaurora.org>
# Date 1375084372 -19800
# Node ID 35aca0b8b6d7f98a44cbde599248e2dd44a4239e
# Parent 2ade54c1de9a0257a00b3d5b1b5d2af1473317fc
Bug 898506 - (jb-gonk) Adapt to netd protocol changes for USB tethering r=<reviewer>
diff --git a/dom/system/gonk/net_worker.js b/dom/system/gonk/net_worker.js
--- a/dom/system/gonk/net_worker.js
+++ b/dom/system/gonk/net_worker.js
@@ -371,23 +371,35 @@ function nextNetdCommand() {
[gCurrentCommand, gCurrentCallback] = gCommandQueue.shift();
debug("Sending '" + gCurrentCommand + "' command to netd.");
gPending = true;
return postNetdCommand(gCurrentCommand);
}
function setInterfaceUp(params, callback) {
let command = "interface setcfg " + params.ifname + " " + params.ip + " " +
- params.prefix + " " + "[" + params.link + "]";
+ params.prefix + ";
+ let sdkVersion = parseInt(libcutils.property_get("ro.build.version.sdk"), 10);
+ if (sdkVersion > 15) {
+ command += params.link;
+ } else {
+ command += "[" + params.link + "]";
+ }
return doCommand(command, callback);
}
function setInterfaceDown(params, callback) {
let command = "interface setcfg " + params.ifname + " " + params.ip + " " +
- params.prefix + " " + "[" + params.link + "]";
+ params.prefix + ";
+ let sdkVersion = parseInt(libcutils.property_get("ro.build.version.sdk"), 10);
+ if (sdkVersion > 15) {
+ command += params.link;
+ } else {
+ command += "[" + params.link + "]";
+ }
return doCommand(command, callback);
}
function setIpForwardingEnabled(params, callback) {
let command;
if (params.enable) {
command = "ipfwd enable";
Comment 2•11 years ago
|
||
PoojaS, thanks for the patch. Can you add your patch as an attachment and request review from :vchang ?
Also, I believe you can avoid reading ro.build.version.sdk more than once - you can define sdkVersion outside of the function definitions and it should work.
Fix for gecko to adapt netd protocol changes for Usb tethering
Attachment #783559 -
Flags: review?(vchang)
Comment 5•11 years ago
|
||
I apply this patch to my nexus 4 in jb4.3. But I can't turn on the usb tethering successfully. Any other steps I should do to support usb tethering ?
Flags: needinfo?(vchang)
Reporter | ||
Comment 6•11 years ago
|
||
Hmm, hey Pooja could you please this this on our MR2 device?
Flags: needinfo?(poojas)
Comment 8•11 years ago
|
||
Comment on attachment 783559 [details] [diff] [review]
usbTethering.patch
Review of attachment 783559 [details] [diff] [review]:
-----------------------------------------------------------------
Thanks for your patch, looks good.
Please rebase the patch before you can land it.
Attachment #783559 -
Flags: review?(vchang) → review+
@Please rebase the patch before you can land it.
>>> Done. attached latest patch Enable_USBTethering.patch
Thanks,
Pooja
Attachment #783559 -
Attachment is obsolete: true
Attachment #788889 -
Flags: review?(vchang)
Comment 10•11 years ago
|
||
Comment on attachment 788889 [details] [diff] [review]
Enable_USBTethering.patch
Review of attachment 788889 [details] [diff] [review]:
-----------------------------------------------------------------
Please fix the small nits.
You don't need to ask for review since I have given you a r+.
::: dom/system/gonk/net_worker.js
@@ +417,5 @@
> return postNetdCommand(command);
> }
>
> function setInterfaceUp(params, callback) {
> + let command = "interface setcfg " + params.ifname + " " + params.ip + " " +
nit: 2 spaces from the start of line.
@@ +428,5 @@
> return doCommand(command, callback);
> }
>
> function setInterfaceDown(params, callback) {
> + let command = "interface setcfg " + params.ifname + " " + params.ip + " " +
nit: 2 spaces please.
Attachment #788889 -
Flags: review?(vchang) → review+
Assignee | ||
Comment 11•11 years ago
|
||
Re-attached patch as per above review comment
Attachment #788889 -
Attachment is obsolete: true
Updated•11 years ago
|
Keywords: checkin-needed
Comment 12•11 years ago
|
||
Keywords: checkin-needed
Comment 13•11 years ago
|
||
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•