|
@@ -37,14 +37,14 @@
|
|
|
|
|
|
static DECLARE_MUTEX(lasat_info_sem);
|
|
static DECLARE_MUTEX(lasat_info_sem);
|
|
|
|
|
|
-/* Strategy function to write EEPROM after changing string entry */
|
|
|
|
|
|
+/* Strategy function to write EEPROM after changing string entry */
|
|
int sysctl_lasatstring(ctl_table *table, int *name, int nlen,
|
|
int sysctl_lasatstring(ctl_table *table, int *name, int nlen,
|
|
void *oldval, size_t *oldlenp,
|
|
void *oldval, size_t *oldlenp,
|
|
void *newval, size_t newlen, void **context)
|
|
void *newval, size_t newlen, void **context)
|
|
{
|
|
{
|
|
int r;
|
|
int r;
|
|
down(&lasat_info_sem);
|
|
down(&lasat_info_sem);
|
|
- r = sysctl_string(table, name,
|
|
|
|
|
|
+ r = sysctl_string(table, name,
|
|
nlen, oldval, oldlenp, newval, newlen, context);
|
|
nlen, oldval, oldlenp, newval, newlen, context);
|
|
if (r < 0) {
|
|
if (r < 0) {
|
|
up(&lasat_info_sem);
|
|
up(&lasat_info_sem);
|
|
@@ -74,7 +74,7 @@ int proc_dolasatstring(ctl_table *table, int write, struct file *filp,
|
|
return 0;
|
|
return 0;
|
|
}
|
|
}
|
|
|
|
|
|
-/* proc function to write EEPROM after changing int entry */
|
|
|
|
|
|
+/* proc function to write EEPROM after changing int entry */
|
|
int proc_dolasatint(ctl_table *table, int write, struct file *filp,
|
|
int proc_dolasatint(ctl_table *table, int write, struct file *filp,
|
|
void *buffer, size_t *lenp, loff_t *ppos)
|
|
void *buffer, size_t *lenp, loff_t *ppos)
|
|
{
|
|
{
|
|
@@ -93,7 +93,7 @@ int proc_dolasatint(ctl_table *table, int write, struct file *filp,
|
|
static int rtctmp;
|
|
static int rtctmp;
|
|
|
|
|
|
#ifdef CONFIG_DS1603
|
|
#ifdef CONFIG_DS1603
|
|
-/* proc function to read/write RealTime Clock */
|
|
|
|
|
|
+/* proc function to read/write RealTime Clock */
|
|
int proc_dolasatrtc(ctl_table *table, int write, struct file *filp,
|
|
int proc_dolasatrtc(ctl_table *table, int write, struct file *filp,
|
|
void *buffer, size_t *lenp, loff_t *ppos)
|
|
void *buffer, size_t *lenp, loff_t *ppos)
|
|
{
|
|
{
|
|
@@ -165,9 +165,9 @@ static char lasat_bcastaddr[16];
|
|
void update_bcastaddr(void)
|
|
void update_bcastaddr(void)
|
|
{
|
|
{
|
|
unsigned int ip;
|
|
unsigned int ip;
|
|
-
|
|
|
|
- ip = (lasat_board_info.li_eeprom_info.ipaddr &
|
|
|
|
- lasat_board_info.li_eeprom_info.netmask) |
|
|
|
|
|
|
+
|
|
|
|
+ ip = (lasat_board_info.li_eeprom_info.ipaddr &
|
|
|
|
+ lasat_board_info.li_eeprom_info.netmask) |
|
|
~lasat_board_info.li_eeprom_info.netmask;
|
|
~lasat_board_info.li_eeprom_info.netmask;
|
|
|
|
|
|
sprintf(lasat_bcastaddr, "%d.%d.%d.%d",
|
|
sprintf(lasat_bcastaddr, "%d.%d.%d.%d",
|
|
@@ -205,7 +205,7 @@ int proc_lasat_ip(ctl_table *table, int write, struct file *filp,
|
|
break;
|
|
break;
|
|
len++;
|
|
len++;
|
|
}
|
|
}
|
|
- if (len >= sizeof(proc_lasat_ipbuf)-1)
|
|
|
|
|
|
+ if (len >= sizeof(proc_lasat_ipbuf)-1)
|
|
len = sizeof(proc_lasat_ipbuf) - 1;
|
|
len = sizeof(proc_lasat_ipbuf) - 1;
|
|
if (copy_from_user(proc_lasat_ipbuf, buffer, len))
|
|
if (copy_from_user(proc_lasat_ipbuf, buffer, len))
|
|
{
|
|
{
|
|
@@ -249,8 +249,8 @@ int proc_lasat_ip(ctl_table *table, int write, struct file *filp,
|
|
}
|
|
}
|
|
#endif /* defined(CONFIG_INET) */
|
|
#endif /* defined(CONFIG_INET) */
|
|
|
|
|
|
-static int sysctl_lasat_eeprom_value(ctl_table *table, int *name, int nlen,
|
|
|
|
- void *oldval, size_t *oldlenp,
|
|
|
|
|
|
+static int sysctl_lasat_eeprom_value(ctl_table *table, int *name, int nlen,
|
|
|
|
+ void *oldval, size_t *oldlenp,
|
|
void *newval, size_t newlen,
|
|
void *newval, size_t newlen,
|
|
void **context)
|
|
void **context)
|
|
{
|
|
{
|
|
@@ -293,7 +293,7 @@ int proc_lasat_eeprom_value(ctl_table *table, int write, struct file *filp,
|
|
if (!strcmp(filp->f_dentry->d_name.name, "debugaccess"))
|
|
if (!strcmp(filp->f_dentry->d_name.name, "debugaccess"))
|
|
lasat_board_info.li_eeprom_info.debugaccess = lasat_board_info.li_debugaccess;
|
|
lasat_board_info.li_eeprom_info.debugaccess = lasat_board_info.li_debugaccess;
|
|
}
|
|
}
|
|
- lasat_write_eeprom_info();
|
|
|
|
|
|
+ lasat_write_eeprom_info();
|
|
up(&lasat_info_sem);
|
|
up(&lasat_info_sem);
|
|
return 0;
|
|
return 0;
|
|
}
|
|
}
|
|
@@ -316,8 +316,8 @@ static ctl_table lasat_table[] = {
|
|
0644, NULL, &proc_lasat_ip, &sysctl_lasat_intvec},
|
|
0644, NULL, &proc_lasat_ip, &sysctl_lasat_intvec},
|
|
{LASAT_NETMASK, "netmask", &lasat_board_info.li_eeprom_info.netmask, sizeof(int),
|
|
{LASAT_NETMASK, "netmask", &lasat_board_info.li_eeprom_info.netmask, sizeof(int),
|
|
0644, NULL, &proc_lasat_ip, &sysctl_lasat_intvec},
|
|
0644, NULL, &proc_lasat_ip, &sysctl_lasat_intvec},
|
|
- {LASAT_BCAST, "bcastaddr", &lasat_bcastaddr,
|
|
|
|
- sizeof(lasat_bcastaddr), 0600, NULL,
|
|
|
|
|
|
+ {LASAT_BCAST, "bcastaddr", &lasat_bcastaddr,
|
|
|
|
+ sizeof(lasat_bcastaddr), 0600, NULL,
|
|
&proc_dostring, &sysctl_string},
|
|
&proc_dostring, &sysctl_string},
|
|
#endif
|
|
#endif
|
|
{LASAT_PASSWORD, "passwd_hash", &lasat_board_info.li_eeprom_info.passwd_hash, sizeof(lasat_board_info.li_eeprom_info.passwd_hash),
|
|
{LASAT_PASSWORD, "passwd_hash", &lasat_board_info.li_eeprom_info.passwd_hash, sizeof(lasat_board_info.li_eeprom_info.passwd_hash),
|