Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
O
openwrt-core
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Feed
openwrt-core
Merge requests
!332
ppp: Add target-specific patch for Broadcom's accelerator.
Code
Review changes
Check out branch
Download
Patches
Plain diff
Open
ppp: Add target-specific patch for Broadcom's accelerator.
markus.gothe/openwrt-core:bcmnet-accelation
into
devel
Overview
0
Commits
1
Pipelines
10
Changes
1
Open
Markus Gothe
requested to merge
markus.gothe/openwrt-core:bcmnet-accelation
into
devel
2 years ago
Overview
0
Commits
1
Pipelines
10
Changes
1
Expand
Add patch to allow the blog accelerator to work correctly when using PPPoE/PPPoA.
0
0
Merge request reports
Compare
devel
version 10
167034f1
6 months ago
version 9
28954674
1 year ago
version 8
cec85a4a
1 year ago
version 7
67e95d2e
1 year ago
version 6
4353a239
1 year ago
version 5
4353a239
1 year ago
version 4
1caefff5
1 year ago
version 3
e9c4a639
1 year ago
version 2
4b015475
1 year ago
version 1
73aac7c1
2 years ago
devel (HEAD)
and
version 5
latest version
63d5ae10
1 commit,
5 months ago
version 10
167034f1
1 commit,
6 months ago
version 9
28954674
1 commit,
1 year ago
version 8
cec85a4a
1 commit,
1 year ago
version 7
67e95d2e
1 commit,
1 year ago
version 6
4353a239
1 commit,
1 year ago
version 5
4353a239
1 commit,
1 year ago
version 4
1caefff5
1 commit,
1 year ago
version 3
e9c4a639
1 commit,
1 year ago
version 2
4b015475
1 commit,
1 year ago
version 1
73aac7c1
1 commit,
2 years ago
1 file
+
159
−
0
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
package/network/services/ppp/patches/brcmbca/900-bcmnet_path_update.patch
0 → 100644
+
159
−
0
Options
--- a/pppd/sys-linux.c 2021-12-15 14:42:59.958193562 +0100
+++ b/pppd/sys-linux.c 2022-02-15 13:12:20.963825923 +0100
@@ -630,6 +630,91 @@
}
}
+typedef struct mac_limit_arg{
+ uint32_t cmd;
+ uint32_t val;
+ union {
+ void *mac_limit;
+ char rsvd[8];
+ };
+}mac_limit_arg_t;
+
+enum mac_limit_cmd{
+ MAC_LIMIT_IOCTL_GET = 0,
+ MAC_LIMIT_IOCTL_SET,
+ MAC_LIMIT_IOCTL_CLR,
+ MAC_LIMIT_IOCTL_EN
+};
+
+enum mac_limit_set_op{
+ MAC_LIMIT_SET_MAX = 0,
+ MAC_LIMIT_SET_MIN,
+};
+
+/*------------------------------------------------------------------------*/
+/* BCM net character device for ioctl to get/set netdev BRCM private info */
+/*------------------------------------------------------------------------*/
+#define BCMNET_DRV_MAJOR 377
+#define BCMNET_DRV_NAME "bcmnet"
+#define BCMNET_DRV_DEVICE_NAME "/dev/" BCMNET_DRV_NAME
+
+typedef enum bcmnet_ioctl_cmd
+{
+ BCMNET_IOCTL_GET_EXT_FLAGS,
+ BCMNET_IOCTL_GET_LAST_CHANGE,
+ BCMNET_IOCTL_CLR_STATS,
+ BCMNET_IOCTL_ADD_NETDEV_PATH,
+ BCMNET_IOCTL_MAC_LIMIT,
+ BCMNET_IOCTL_MAX
+} bcmnet_ioctl_cmd_t;
+
+typedef struct {
+ unsigned int unused : 25;
+ unsigned int is_bcm_dev : 1;
+ unsigned int is_wlan : 1;
+ unsigned int is_hw_switch : 1;
+ unsigned int is_hw_fdb : 1;
+ unsigned int is_ppp : 1;
+ unsigned int is_vlan : 1;
+ unsigned int is_wan : 1;
+} bcmnet_extflags;
+
+typedef struct {
+ char if_name[IFNAMSIZ];
+ union {
+ struct {
+ bcmnet_extflags ret_val;
+ }st_get_ext_flags;
+ struct {
+ unsigned long last_change;
+ }st_get_last_change;
+ struct {
+ char next_if_name[IFNAMSIZ];
+ }st_add_netdev_path;
+ mac_limit_arg_t st_mac_limit;
+ };
+}bcmnet_info_t;
+
+#define FIELD0 4 /* ppp device number ppp0, ppp1, the third digit (max 16) */
+#define FIELD1 8 /* if 0, default mode, 1 vlan mux, 2 msc */
+#define FIELD2 19 /* if FILED1 is 0, add no extension, 1 add vlan id, 2 add conId for msc */
+
+static inline int bcmnet_ioctl_add_netdev_path(char const* dev_name, char const* next_dev_name)
+{
+ bcmnet_info_t info;
+ int fd, err;
+
+ fd = open(BCMNET_DRV_DEVICE_NAME, O_RDWR);
+ if (fd < 0)
+ return -1;
+
+ strncpy(info.if_name, dev_name, IFNAMSIZ);
+ strncpy(info.st_add_netdev_path.next_if_name, next_dev_name, IFNAMSIZ);
+ err = ioctl(fd, BCMNET_IOCTL_ADD_NETDEV_PATH, &info);
+ close(fd);
+ return err;
+}
+
/*
* make_ppp_unit - make a new ppp unit for ppp_dev_fd.
* Assumes new_style_driver.
@@ -637,6 +722,12 @@
static int make_ppp_unit()
{
int x, flags;
+#if 0
+ /* brcm */
+ unsigned num[3] = {0, 0, 0};
+ char *p;
+ /*end brcm */
+#endif
if (ppp_dev_fd >= 0) {
dbglog("in make_ppp_unit, already had /dev/ppp open?");
@@ -650,6 +741,40 @@
|| fcntl(ppp_dev_fd, F_SETFL, flags | O_NONBLOCK) == -1)
warn("Couldn't set /dev/ppp to nonblock: %m");
+#if 0
+ /* brcm */
+ /* req_name will beused as ifname and for
+ * num[1] == 0: default connection mdoe: ppp0, ppp1...
+ * num[1] == 1: vlanMux mode: ppp0.100, ppp1.200...
+ * num[1] == 2: msc (multiple service mode) ppp0_1, ppp1_3...
+ * num[1] == 3: pppoa0, pppoa1...
+ *
+ */
+ if ((p = strchr(req_ifname, '.')) != NULL)
+ {
+ /* vlan mux mode */
+ sscanf(&(req_ifname[3]), "%d.%d", num, num+2);
+ num[1] = 1;
+ }
+ else if ((p = strchr(req_ifname, '_')) != NULL)
+ {
+ /* msc mode */
+ sscanf(&(req_ifname[3]), "%d_%d", num, num+2);
+ num[1] = 2;
+ }
+ else if ((p = strstr(req_ifname, "pppoa")) != NULL)
+ {
+ /* pppoa */
+ num[0] = atoi(&req_ifname[5]);
+ num[1] = 3;
+ }
+ else /* must be default mode */
+ {
+ num[0] = atoi(&req_ifname[3]);
+ }
+ req_unit = num[0]<<(FIELD1+FIELD2) | num[1]<<FIELD2 | num[2];
+#endif
+
ifunit = req_unit;
x = ioctl(ppp_dev_fd, PPPIOCNEWUNIT, &ifunit);
if (x < 0 && req_unit >= 0 && errno == EEXIST) {
@@ -674,6 +799,10 @@
info("Renamed interface %s to %s", t, req_ifname);
}
+ if (bcmnet_ioctl_add_netdev_path(req_ifname, devnam) < 0) {
+ error("Couldn't set ppp real device (%s): %m", devnam);
+ }
+
return x;
}
Loading