User Tools

Site Tools


inbox:bcmprocfs

Proprietary module bcmprocfs

The module does not seem to have a real functional purpose other than providing some ip configuration space for dhcpc, and some command line modifications in the process table.

In order to get the Broadcom variant of dhcpc working you'll need to create a sybolic link in the procfs. The code below to creates a symlink via the bcmprocfs module:

for example:

bcmprocfs_ioctl .ppp0 nas_8_35

creates a symbolic link from /proc/var/fyi/wan/.ppp0 → /proc/var/fyi/wan/nas_8_35.

Also see adsl_support

/*
 bcmprocfs_ioctl.c
 
 This is free software: you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
 the Free Software Foundation, either version 3 of the License, or
 (at your option) any later version.
 
 This program is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 GNU General Public License for more details.
 
 You should have received a copy of the GNU General Public License
 along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 (c) 2013 LinuxInside
*/
#include <stdio.h>
#include <string.h>
 
#if 0
 
#include "bcmprocfs.h"
 
#else
 
#define CREATE_SYMLINK  0x200
#define CREATE_FILE     0x201
#define RENAME_TELNETD  0x202
#define RENAME_HTTPD    0x203
#define RENAME_SSHD     0x204
#define RENAME_SNMP     0x205
#define RENAME_TR69C    0x206
 
/* ln -s src dst */
struct symlink {
        char src[32];
        char dst[32];
};
 
#endif
 
char fname[] = "/dev/bcm";
 
int main(int argc, char *argv[])
{
        int     fh, ret;
        struct symlink link;
 
        if (argc < 3) {
                printf("usage: <src> <dst>\n");
                return -1;
        }
        fh = open(fname, 0);
        if (fh <0) {
                printf("Failed to open input file %s\n", fname);
                return -1;
        }
        strncpy(link.src, argv[1], sizeof(link.src));
        strncpy(link.dst, argv[2], sizeof(link.dst));
 
        ret = ioctl(fh, CREATE_SYMLINK, &link);
 
        close (fh);
        return ret;
}

inbox/bcmprocfs.txt · Last modified: 2013/07/26 09:39 (external edit)