Closed
Bug 776212
Opened 12 years ago
Closed 11 years ago
Get usb rndis interface's name automatically
Categories
(Firefox OS Graveyard :: General, defect)
Tracking
(blocking-b2g:leo+, firefox21 wontfix, firefox22 wontfix, firefox23 fixed, b2g18 fixed, b2g18-v1.0.0 wontfix, b2g18-v1.0.1 wontfix)
RESOLVED
FIXED
blocking-b2g | leo+ |
People
(Reporter: vchang, Assigned: vchang)
References
Details
Attachments
(1 file, 2 obsolete files)
(deleted),
patch
|
dhylands
:
review+
|
Details | Diff | Splinter Review |
When enable usb tethering, the usb driver will create a rndis network interface.
Rather than hard code the name, we need to get it automatically.
The default name for ICS is "rndis0".
Assignee | ||
Updated•11 years ago
|
Assignee: nobody → vchang
Assignee | ||
Comment 1•11 years ago
|
||
The interface name could be one of rndis0/usb0.... My approach is to get network interface lists and compare them with possible name lists.
Assignee | ||
Comment 2•11 years ago
|
||
The interface name of rndis could be one of rndis0(unagi)/usb0(leo).... My approach is to get network interface lists from /sys/class/net and compare them with possible name lists.
Attachment #743539 -
Flags: review?(dhylands)
Comment 3•11 years ago
|
||
Comment on attachment 743539 [details] [diff] [review]
Possible fix, patch v1.0
Review of attachment 743539 [details] [diff] [review]:
-----------------------------------------------------------------
::: dom/system/gonk/NetworkManager.js
@@ +848,5 @@
> + getUsbInterface: function getUsbInterface() {
> + let array = [];
> + try {
> + let file = new FileUtils.File(KERNEL_NETWORK_ENTRY);
> + let entries = file.directoryEntries;
Wouldn't it make more sense to just iterate over this.possibleInterface and check to see if /sys/class/net/NAME exists?
At least, then you can prioritize, and stop when you find the first entry that matches.
Fundamentally, I don't have any issues with this approach either, it just seemed odd to me.
Attachment #743539 -
Flags: review?(dhylands) → review+
Assignee | ||
Comment 4•11 years ago
|
||
(In reply to Dave Hylands [:dhylands] from comment #3)
> Comment on attachment 743539 [details] [diff] [review]
> Possible fix, patch v1.0
>
> Review of attachment 743539 [details] [diff] [review]:
> -----------------------------------------------------------------
>
> ::: dom/system/gonk/NetworkManager.js
> @@ +848,5 @@
> > + getUsbInterface: function getUsbInterface() {
> > + let array = [];
> > + try {
> > + let file = new FileUtils.File(KERNEL_NETWORK_ENTRY);
> > + let entries = file.directoryEntries;
>
> Wouldn't it make more sense to just iterate over this.possibleInterface and
> check to see if /sys/class/net/NAME exists?
>
> At least, then you can prioritize, and stop when you find the first entry
> that matches.
>
> Fundamentally, I don't have any issues with this approach either, it just
> seemed odd to me.
Thanks for your quick feedback, I am going to post a new patch to address your comment.
Please help me to double check it.
Assignee | ||
Comment 5•11 years ago
|
||
Attachment #743539 -
Attachment is obsolete: true
Attachment #744410 -
Flags: review?(dhylands)
Assignee | ||
Comment 6•11 years ago
|
||
This should be mark as LEO+, we need this patch to make usb tethering work on LEO.
blocking-b2g: --- → leo?
Comment 7•11 years ago
|
||
Comment on attachment 744410 [details] [diff] [review]
Patch to address review comment 3, patch v1.1
Review of attachment 744410 [details] [diff] [review]:
-----------------------------------------------------------------
::: dom/system/gonk/NetworkManager.js
@@ +863,5 @@
> + }
> +
> + // Find the rndis interface.
> + for (let i = 0; (array.length > 0 &&
> + i < this.possibleInterface.length); i++) {
I was thinking more along the lines of removing lines 849 thru 863 and replacing lines 868 to 869 with:
let file = new FileUtils.File(KERNEL_NETWORK_ENTRY + "/" + this.possibleInterface[i]);
if (file.IsDirectory()) {
return this.possibleInterface[i];
}
(and adding in an appropriate try/catch block)
Assignee | ||
Comment 8•11 years ago
|
||
Attachment #744410 -
Attachment is obsolete: true
Attachment #744410 -
Flags: review?(dhylands)
Attachment #744579 -
Flags: review?(dhylands)
Updated•11 years ago
|
Attachment #744579 -
Flags: review?(dhylands) → review+
Assignee | ||
Comment 10•11 years ago
|
||
Comment 11•11 years ago
|
||
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Comment 12•11 years ago
|
||
status-b2g18:
--- → fixed
status-b2g18-v1.0.0:
--- → wontfix
status-b2g18-v1.0.1:
--- → wontfix
status-firefox21:
--- → wontfix
status-firefox22:
--- → wontfix
status-firefox23:
--- → fixed
Updated•11 years ago
|
Flags: in-moztrap-
You need to log in
before you can comment on or make changes to this bug.
Description
•