2010-12-20 13:48:05 +01:00
|
|
|
---
|
|
|
|
glue_netfs.c | 19 +++++++++++++++++++
|
|
|
|
1 file changed, 19 insertions(+)
|
|
|
|
|
|
|
|
--- a/glue_netfs.c
|
|
|
|
+++ b/glue_netfs.c
|
|
|
|
@@ -65,6 +65,19 @@ static CHAR16 netfs_default_path[FILENAM
|
2007-01-16 00:11:20 +01:00
|
|
|
static CHAR16 *hexa=L"0123456789ABCDEF";
|
|
|
|
|
|
|
|
static VOID
|
|
|
|
+convert_mac2hex(UINT8 *hw_addr,INTN l, CHAR16 *str)
|
|
|
|
+{
|
|
|
|
+ UINTN i;
|
2009-02-09 17:50:41 +01:00
|
|
|
+
|
2007-01-16 00:11:20 +01:00
|
|
|
+ for (i=0 ; i < l; i++) {
|
|
|
|
+ str[3*i] = hexa[(hw_addr[i] & 0xf0)>>4];
|
|
|
|
+ str[3*i+1] = hexa[hw_addr[i] & 0x0f];
|
|
|
|
+ str[3*i+2] = ':';
|
|
|
|
+ }
|
|
|
|
+ str[3*l-1]='\0';
|
|
|
|
+}
|
2010-12-20 13:48:05 +01:00
|
|
|
+
|
2007-01-16 00:11:20 +01:00
|
|
|
+static VOID
|
|
|
|
convert_ip2hex(UINT8 *ip, INTN l, CHAR16 *str)
|
|
|
|
{
|
|
|
|
UINTN i;
|
2010-12-20 13:48:05 +01:00
|
|
|
@@ -210,6 +223,12 @@ netfs_setdefaults(VOID *intf, config_fil
|
2007-01-16 00:11:20 +01:00
|
|
|
|
|
|
|
StrnCpy(config[6].fname, str, maxlen-1);
|
|
|
|
StrnCpy(config[6].fname+2, CONFIG_EXTENSION, 6);
|
|
|
|
+
|
|
|
|
+ /* use the MAC address as a possible file name as well */
|
|
|
|
+ convert_mac2hex(info.hw_addr,6,str);
|
|
|
|
+ StrnCpy(config[7].fname, str, maxlen-1);
|
|
|
|
+ StrnCpy(config[7].fname+17, CONFIG_EXTENSION, 6);
|
2010-12-20 13:48:05 +01:00
|
|
|
+
|
2007-01-16 00:11:20 +01:00
|
|
|
#else
|
|
|
|
StrnCpy(config[0].fname, NETFS_DEFAULT_CONFIG, maxlen-1);
|
|
|
|
config[0].fname[maxlen-1] = CHAR_NULL;
|