diff options
-rw-r--r-- | com32/cmenu/libmenu/menu.h | 4 | ||||
-rw-r--r-- | com32/hdt/floppy/hdt.cfg | 2 | ||||
-rw-r--r-- | com32/hdt/hdt-cli.c | 3 | ||||
-rw-r--r-- | com32/hdt/hdt.h | 2 | ||||
-rw-r--r-- | com32/lib/pci/scan.c | 39 |
5 files changed, 38 insertions, 12 deletions
diff --git a/com32/cmenu/libmenu/menu.h b/com32/cmenu/libmenu/menu.h index 44acb122..a1356020 100644 --- a/com32/cmenu/libmenu/menu.h +++ b/com32/cmenu/libmenu/menu.h @@ -76,8 +76,8 @@ #define MOREBELOW 'v' // more items available below // Attributes of the menu system -#define MAXMENUS 150 // Maximum number of menu's allowed -#define MAXMENUSIZE 60 // Default value for max num of entries in each menu +#define MAXMENUS 250 // Maximum number of menu's allowed +#define MAXMENUSIZE 100 // Default value for max num of entries in each menu #define MAXMENUHEIGHT 20 // Maximum number of entries displayed #define MENUBOXTYPE BOX_SINSIN // Default box type Look at tui.h for other values diff --git a/com32/hdt/floppy/hdt.cfg b/com32/hdt/floppy/hdt.cfg index 8f707d0f..226bf75f 100644 --- a/com32/hdt/floppy/hdt.cfg +++ b/com32/hdt/floppy/hdt.cfg @@ -4,4 +4,4 @@ SERIAL 0 LABEL hdt COM32 hdt.c32 -APPEND modules_pcimap=modules.pcimap modules_alias=modules.alias pciids=pci.ids +APPEND modules_pcimap=modules.pcimap modules_alias=modules.alias pciids=pci.ids quiet diff --git a/com32/hdt/hdt-cli.c b/com32/hdt/hdt-cli.c index 060f953b..892e5fbd 100644 --- a/com32/hdt/hdt-cli.c +++ b/com32/hdt/hdt-cli.c @@ -764,7 +764,8 @@ void start_auto_mode(struct s_hardware *hardware) /* Searching & saving all commands */ mypch = strtok (temp,AUTO_SEPARATOR); while (mypch != NULL) { - if ((strlen(remove_spaces(mypch))>0) && (remove_spaces(mypch)[0] != AUTO_SEPARATOR)) { + if ((strlen(remove_spaces(mypch))>0) && + (remove_spaces(mypch)[0] != AUTO_SEPARATOR[0])) { nb_commands++; if ((commands[nb_commands]=malloc(AUTO_COMMAND_SIZE)) != NULL) { sprintf(commands[nb_commands],"%s",remove_spaces(mypch)); diff --git a/com32/hdt/hdt.h b/com32/hdt/hdt.h index 2c2c8796..0bdad970 100644 --- a/com32/hdt/hdt.h +++ b/com32/hdt/hdt.h @@ -33,7 +33,7 @@ #define AUTHOR "Erwan Velu" #define CORE_DEVELOPER "Pierre-Alexandre Meyer" #define CONTACT "hdt@zytor.com" -#define VERSION "0.3.5-pre3" +#define VERSION "0.3.5" #define CODENAME "mojito" #define NB_CONTRIBUTORS 2 #define CONTRIBUTORS {"Sebastien Gonzalve", "Gert Hulselmans"} diff --git a/com32/lib/pci/scan.c b/com32/lib/pci/scan.c index 82a7c844..1719899e 100644 --- a/com32/lib/pci/scan.c +++ b/com32/lib/pci/scan.c @@ -112,7 +112,6 @@ int get_module_name_from_pcimap(struct pci_domain *domain, strcpy(product_id,"0000"); strcpy(sub_product_id,"0000"); strcpy(sub_vendor_id,"0000"); - dev->dev_info->linux_kernel_module_count=0; /* for each line we found in the modules.pcimap */ while ( fgets(line, sizeof line, f) ) { @@ -154,8 +153,22 @@ int get_module_name_from_pcimap(struct pci_domain *domain, == dev->sub_product && (int_sub_vendor_id & dev->sub_vendor) == dev->sub_vendor) { - strcpy(dev->dev_info->linux_kernel_module[dev->dev_info->linux_kernel_module_count], module_name); - dev->dev_info->linux_kernel_module_count++; + bool found=false; + + /* Scan all known kernel modules for this pci device */ + for (int i=0; i<dev->dev_info->linux_kernel_module_count; i++) { + + /* Try to detect if we already knew the same kernel module*/ + if (strstr(dev->dev_info->linux_kernel_module[i], module_name)) { + found=true; + break; + } + } + /* If we don't have this kernel module, let's add it */ + if (!found) { + strcpy(dev->dev_info->linux_kernel_module[dev->dev_info->linux_kernel_module_count], module_name); + dev->dev_info->linux_kernel_module_count++; + } } } } @@ -619,8 +632,6 @@ int get_module_name_from_alias(struct pci_domain *domain, char *modules_alias_pa if (!f) return -ENOMODULESALIAS; - dev->dev_info->linux_kernel_module_count=0; - /* for each line we found in the modules.pcimap */ while ( fgets(line, sizeof line, f) ) { /* skipping unecessary lines */ @@ -702,8 +713,22 @@ int get_module_name_from_alias(struct pci_domain *domain, char *modules_alias_pa == dev->sub_product && (int_sub_vendor_id & dev->sub_vendor) == dev->sub_vendor) { - strcpy(dev->dev_info->linux_kernel_module[dev->dev_info->linux_kernel_module_count], module_name); - dev->dev_info->linux_kernel_module_count++; + bool found=false; + + /* Scan all known kernel modules for this pci device */ + for (int i=0; i<dev->dev_info->linux_kernel_module_count; i++) { + + /* Try to detect if we already knew the same kernel module*/ + if (strstr(dev->dev_info->linux_kernel_module[i], module_name)) { + found=true; + break; + } + } + /* If we don't have this kernel module, let's add it */ + if (!found) { + strcpy(dev->dev_info->linux_kernel_module[dev->dev_info->linux_kernel_module_count], module_name); + dev->dev_info->linux_kernel_module_count++; + } } } } |