aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorErwan Velu <erwan.velu@free.fr>2009-03-25 22:06:18 +0100
committerErwan Velu <erwan.velu@free.fr>2009-03-25 22:06:18 +0100
commit027c8f7418ce6ec9705d4c08b6564b64179e5da8 (patch)
treea4ff18c749690c0c64e1d0bb9da238393f0b3171
parentcdf626e4b90beadfbb6fa617b0cf7bed488b334d (diff)
parentfdadbcfeaa8015461e557fae2beb6a484986d097 (diff)
downloadsyslinux.git-027c8f7418ce6ec9705d4c08b6564b64179e5da8.tar.gz
syslinux.git-027c8f7418ce6ec9705d4c08b6564b64179e5da8.tar.xz
syslinux.git-027c8f7418ce6ec9705d4c08b6564b64179e5da8.zip
Merge branch 'erwan'
-rw-r--r--com32/cmenu/libmenu/menu.h2
-rw-r--r--com32/hdt/hdt-ata.c4
-rw-r--r--com32/hdt/hdt-cli-pxe.c2
-rw-r--r--com32/hdt/hdt-cli-vesa.c2
-rw-r--r--com32/hdt/hdt-common.c34
-rw-r--r--com32/hdt/hdt-menu-pxe.c2
-rw-r--r--com32/hdt/hdt-menu-vesa.c4
-rw-r--r--com32/lib/pci/scan.c9
-rw-r--r--com32/modules/pcitest.c6
9 files changed, 55 insertions, 10 deletions
diff --git a/com32/cmenu/libmenu/menu.h b/com32/cmenu/libmenu/menu.h
index d8db6c25..9b009db1 100644
--- a/com32/cmenu/libmenu/menu.h
+++ b/com32/cmenu/libmenu/menu.h
@@ -77,7 +77,7 @@
#define SCROLLBOX 176 // Filled char to display
// Attributes of the menu system
-#define MAXMENUS 100 // Maximum number of menu's allowed
+#define MAXMENUS 150 // Maximum number of menu's allowed
#define MAXMENUSIZE 60 // 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/hdt-ata.c b/com32/hdt/hdt-ata.c
index 4e3ea438..eb507d21 100644
--- a/com32/hdt/hdt-ata.c
+++ b/com32/hdt/hdt-ata.c
@@ -196,6 +196,10 @@ int get_disk_params(int disk, struct diskinfo *disk_info)
disk_info[disk].cbios = 1; /* Valid geometry */
}
+ /* If geometry isn't valid, no need to try to get more info about the drive*/
+ /* Looks like in can confuse some optical drives */
+ if (disk_info[disk].cbios != 1) return 0;
+
/* FIXME: memset to 0 make it fails
* memset(__com32.cs_bounce, 0, sizeof(struct device_pairameter)); */
memset(&dp, 0, sizeof(struct device_parameter));
diff --git a/com32/hdt/hdt-cli-pxe.c b/com32/hdt/hdt-cli-pxe.c
index 772c0dfd..5c556645 100644
--- a/com32/hdt/hdt-cli-pxe.c
+++ b/com32/hdt/hdt-cli-pxe.c
@@ -55,7 +55,7 @@ void main_show_pxe(struct s_hardware *hardware)
struct s_pxe *p = &hardware->pxe;
more_printf(" PCI device no: %d \n", p->pci_device_pos);
- if (hardware->pci_ids_return_code == -ENOPCIIDS) {
+ if ((hardware->pci_ids_return_code == -ENOPCIIDS) || (p->pci_device==NULL)) {
snprintf(buffer, sizeof(buffer),
" PCI ID : %04x:%04x[%04x:%04X] rev(%02x)\n",
p->vendor_id, p->product_id, p->subvendor_id,
diff --git a/com32/hdt/hdt-cli-vesa.c b/com32/hdt/hdt-cli-vesa.c
index e6843eea..db7642d2 100644
--- a/com32/hdt/hdt-cli-vesa.c
+++ b/com32/hdt/hdt-cli-vesa.c
@@ -44,7 +44,7 @@ void main_show_vesa(struct s_hardware *hardware) {
more_printf(" Vendor : %s\n",hardware->vesa.vendor);
more_printf(" Product : %s\n",hardware->vesa.product);
more_printf(" Product rev. : %s\n",hardware->vesa.product_revision);
- more_printf(" Software rev.: %s\n",hardware->vesa.software_rev);
+ more_printf(" Software rev.: %d\n",hardware->vesa.software_rev);
more_printf(" Memory (KB) : %d\n",hardware->vesa.total_memory*64);
more_printf(" Modes : %d\n",hardware->vesa.vmi_count);
}
diff --git a/com32/hdt/hdt-common.c b/com32/hdt/hdt-common.c
index 554ed3cb..d067d114 100644
--- a/com32/hdt/hdt-common.c
+++ b/com32/hdt/hdt-common.c
@@ -297,6 +297,8 @@ int detect_pxe(struct s_hardware *hardware)
}
/* Let's try to find the associated pci device */
detect_pci(hardware);
+
+ /* The firt pass try to find the exact pci device */
hardware->pxe.pci_device = NULL;
hardware->pxe.pci_device_pos = 0;
struct pci_device *pci_device;
@@ -313,8 +315,34 @@ int detect_pxe(struct s_hardware *hardware)
hardware->pxe.pci_device = pci_device;
hardware->pxe.pci_device_pos =
pci_number;
+ return 0;
+ }
+ }
+
+ /* If we reach that part, it means the pci device pointed by
+ * the pxe rom wasn't found in our list.
+ * Let's try to find the device only by its pci ids.
+ * The pci device we'll match is maybe not exactly the good one
+ * as we can have the same pci id several times.
+ * At least, the pci id, the vendor/product will be right.
+ * That's clearly a workaround for some weird cases.
+ * This should happend very unlikely */
+ hardware->pxe.pci_device = NULL;
+ hardware->pxe.pci_device_pos = 0;
+ pci_number = 0;
+ for_each_pci_func(pci_device, hardware->pci_domain) {
+ pci_number++;
+ if ((pci_device->vendor ==
+ hardware->pxe.vendor_id)
+ && (pci_device->product ==
+ hardware->pxe.product_id)) {
+ hardware->pxe.pci_device = pci_device;
+ hardware->pxe.pci_device_pos =
+ pci_number;
+ return 0;
}
}
+
}
}
return 0;
@@ -326,13 +354,17 @@ void detect_pci(struct s_hardware *hardware)
return;
hardware->pci_detection = true;
+ hardware->nb_pci_devices = 0;
+
/* Scanning to detect pci buses and devices */
hardware->pci_domain = pci_scan();
+ if (!hardware->pci_domain)
+ return;
+
/* Gathering addtional information*/
gather_additional_pci_config(hardware->pci_domain);
- hardware->nb_pci_devices = 0;
struct pci_device *pci_device;
for_each_pci_func(pci_device, hardware->pci_domain) {
hardware->nb_pci_devices++;
diff --git a/com32/hdt/hdt-menu-pxe.c b/com32/hdt/hdt-menu-pxe.c
index 686117ab..497fa776 100644
--- a/com32/hdt/hdt-menu-pxe.c
+++ b/com32/hdt/hdt-menu-pxe.c
@@ -43,7 +43,7 @@ void compute_PXE(struct s_my_menu *menu, struct s_hardware *hardware)
struct s_pxe *p = &hardware->pxe;
- if (hardware->pci_ids_return_code == -ENOPCIIDS) {
+ if ((hardware->pci_ids_return_code == -ENOPCIIDS) || (p->pci_device==NULL)) {
snprintf(buffer, sizeof buffer, "PCI Vendor : %d",
p->vendor_id);
snprintf(infobar, sizeof infobar, "PCI Vendor : %d",
diff --git a/com32/hdt/hdt-menu-vesa.c b/com32/hdt/hdt-menu-vesa.c
index 345d74bb..2d807aaa 100644
--- a/com32/hdt/hdt-menu-vesa.c
+++ b/com32/hdt/hdt-menu-vesa.c
@@ -58,8 +58,8 @@ static void compute_vesa_card(struct s_my_menu *menu, struct s_hardware *hardwar
add_item(buffer,statbuffer,OPT_INACTIVE,NULL,0);
menu->items_count++;
- snprintf(buffer,sizeof buffer,"Software Rev: %s",hardware->vesa.software_rev);
- snprintf(statbuffer,sizeof statbuffer,"Software Revision: %s",hardware->vesa.software_rev);
+ snprintf(buffer,sizeof buffer,"Software Rev: %d",hardware->vesa.software_rev);
+ snprintf(statbuffer,sizeof statbuffer,"Software Revision: %d",hardware->vesa.software_rev);
add_item(buffer,statbuffer,OPT_INACTIVE,NULL,0);
menu->items_count++;
diff --git a/com32/lib/pci/scan.c b/com32/lib/pci/scan.c
index dd5d6402..adfec596 100644
--- a/com32/lib/pci/scan.c
+++ b/com32/lib/pci/scan.c
@@ -441,9 +441,12 @@ struct pci_domain *pci_scan(void)
int cfgtype;
cfgtype = pci_set_config_type(PCI_CFG_AUTO);
- (void)cfgtype;
dprintf("PCI configuration type %d\n", cfgtype);
+
+ if (cfgtype == PCI_CFG_NONE)
+ return NULL;
+
dprintf("Scanning PCI Buses\n");
for (nbus = 0; nbus < MAX_PCI_BUSES; nbus++) {
@@ -520,8 +523,10 @@ void gather_additional_pci_config(struct pci_domain *domain)
unsigned int nbus, ndev, nfunc, maxfunc;
pciaddr_t a;
int cfgtype;
+
cfgtype = pci_set_config_type(PCI_CFG_AUTO);
- (void)cfgtype;
+ if (cfgtype == PCI_CFG_NONE)
+ return;
for (nbus = 0; nbus < MAX_PCI_BUSES; nbus++) {
bus = NULL;
diff --git a/com32/modules/pcitest.c b/com32/modules/pcitest.c
index 00647535..d13c3a6f 100644
--- a/com32/modules/pcitest.c
+++ b/com32/modules/pcitest.c
@@ -102,6 +102,10 @@ int main(int argc, char *argv[])
/* Scanning to detect pci buses and devices */
printf("PCI: Scanning PCI BUS\n");
pci_domain = pci_scan();
+ if (!pci_domain) {
+ printf("PCI: no devices found!\n");
+ return 1;
+ }
struct pci_device *pci_device;
for_each_pci_func(pci_device, pci_domain) {
@@ -140,5 +144,5 @@ int main(int argc, char *argv[])
/* display the pci devices we found */
display_pci_devices(pci_domain);
- return 1;
+ return 0;
}