Commit graph

238 commits

Author SHA1 Message Date
Colin Watson
a870a783be * disk/raid.c (insert_array): Select unique numbers for named arrays
as well, for use as keys in the disk cache.
2010-08-02 09:51:23 -05:00
Colin Watson
a9600892c1 * disk/raid.c (insert_array): Don't count named arrays when looking
for unused array numbers.
Reported and tested by: maru.
2010-07-22 09:38:06 +01:00
Colin Watson
efc9d7f175 * disk/loopback.c (grub_cmd_loopback): Don't leak a grub_file_t
handle on failure.
(grub_loopback_close): Remove empty function.
(grub_loopback_dev): Remove close method.
2010-07-20 22:14:26 +01:00
Vladimir 'phcoder' Serbinenko
afaec079d1 * disk/loopback.c (grub_loopback): Replace filename with file.
(delete_loopback): Handle new semantics.
	(grub_cmd_loopback): Likewise.
	(grub_loopback_iterate): Likewise.
	(grub_loopback_close): Likewise.
2010-07-20 21:56:00 +02:00
Colin Watson
31cfe714f2 * disk/mdraid_linux.c: Update copyright years.
* disk/raid.c: Likewise.
* include/grub/raid.h: Likewise.
* kern/emu/getroot.c: Likewise.
2010-07-20 11:10:49 +01:00
Colin Watson
68ac8c8d15 * disk/mdraid_linux.c (struct grub_raid_super_1x): Remove
__attribute__ ((packed)), leaving a comment.
(grub_mdraid_detect): Split out 0.9 and 1.x detection to ...
(grub_mdraid_detect_09): ... here and ...
(grub_mdraid_detect_1x): ... here.
* disk/raid.c (insert_array): Check for grub_xasprintf returning
NULL.
2010-07-19 11:35:16 +01:00
Colin Watson
1c785436da * disk/dmraid_nvidia.c (grub_dmraid_nv_detect): Add start_sector
parameter.  Set its pointer target to 0.
* disk/mdraid_linux.c (grub_mdraid_detect): Add start_sector
parameter.  Set its pointer target to 0 for 0.9 metadata, or to the
`data_offset' value from the superblock for 1.x metadata.
* disk/raid.c (grub_raid_read): Offset reads by the start sector of
data on the device.
(insert_array): Record the start sector of data on the device.
(grub_raid_register): Pass start_sector parameters to
grub_raid_list->detect and insert_array.
* include/grub/raid.h (struct grub_raid_array): Add start_sector
member.
(struct grub_raid): Add start_sector parameter to `detect'.
2010-07-18 18:31:10 +01:00
Colin Watson
139ab97dc3 * disk/raid.c (insert_array): Use md/%s to name mdadm 1.x devices,
removing the homehost if present.
* kern/emu/getroot.c (get_mdadm_name) [__linux__]: New function.
(grub_util_get_grub_dev): Use md/%s to name mdadm 1.x devices,
removing the homehost if present.
(grub_util_get_grub_dev) [__linux__]: Get the array name from mdadm
if possible.
* util/i386/pc/grub-setup.c (main): Handle md/* devices.
2010-07-18 15:53:14 +01:00
Colin Watson
41f435b1b4 merge mainline 2010-07-17 11:17:49 +01:00
Vladimir 'phcoder' Serbinenko
b92c6ff67f Merge mainline into usb 2010-07-17 02:44:33 +02:00
Vladimir 'phcoder' Serbinenko
986aad56c1 * disk/scsi.c (grub_scsi_open): Fix incorrect pointer dereference. 2010-07-17 01:52:41 +02:00
Vladimir 'phcoder' Serbinenko
af0bedf8af merge mainline into usb 2010-07-17 01:14:13 +02:00
Vladimir 'phcoder' Serbinenko
9c17c6411a Fix mismerge 2010-07-17 00:56:38 +02:00
Vladimir 'phcoder' Serbinenko
4274c30fbc Restructure SCSI .id handling.
Reported and tested by: Aleš Nesrsta.

	* disk/ata.c (grub_atapi_close): Removed. All users updated.
	(grub_atapi_dev): Changed .name to "ata". New field .id.
	* disk/usbms.c (grub_usbms_close): Removed. All users updated.
	(grub_usbms_dev): New field .id.
	* disk/scsi.c (grub_scsi_iterate): Generate name.
	(grub_scsi_open): Parse name.
	* include/grub/scsi.h (grub_make_scsi_id): New function.
	(grub_scsi_dev): Change iterate and open to number instead of naming
	busses. All users updated.
	(grub_scsi): Remove name. Add .bus.
2010-07-10 02:59:33 +02:00
Colin Watson
50f0bcdab5 * include/grub/types.h: Define the C99-style PRIxGRUB_SIZE macro,
suitable for using within the format argument of printf when
converting grub_size_t.
* disk/usbms.c (grub_usbms_transfer): Use PRIxGRUB_SIZE rather than
"x" to convert grub_size_t arguments.
2010-07-02 18:04:54 +01:00
Sean Finney
5944958c61 * disk/lvm.c (grub_lvm_scan_device): Skip snapshots.
2010-07-01  Vladimir Serbinenko  <phcoder@gmail.com>

	* disk/lvm.c (grub_lvm_checkvalue): New function.
	(grub_lvm_check_flag): Likewise.

	Also-By: Vladimir Serbinenko <phcoder@gmail.com>
2010-07-01 23:19:11 +02:00
Vladimir 'phcoder' Serbinenko
b7e79e8a6a Merge mainline into yeeloongfw 2010-06-30 02:30:05 +02:00
starous
12cd7239d9 Faster OHCI, USB hub support, UHCI portstatus corr. 2010-06-21 21:12:20 +02:00
Vladimir 'phcoder' Serbinenko
f5db3949e7 Some hotplug support (buggy) 2010-06-02 21:54:51 +02:00
Vladimir 'phcoder' Serbinenko
440ab68551 Restructure usbms as a preparation for hotplug 2010-06-02 19:52:17 +02:00
Aleš Nesrsta
1515ec8684 2010-06-02 Aleš Nesrsta <starous@volny.cz>
Finally make USB usable.

	* bus/usb/ohci.c (grub_ohci_reg_t): Add missing values.
	(GRUB_OHCI_RHUB_PORT_POWER_MASK): New macro.
	(GRUB_OHCI_RHUB_PORT_ALL_POWERED): Likewise.
	(GRUB_OHCI_REG_FRAME_INTERVAL_FSMPS_MASK): Likewise.
	(GRUB_OHCI_REG_FRAME_INTERVAL_FSMPS_SHIFT): Likewise.
	(GRUB_OHCI_REG_FRAME_INTERVAL_FI_SHIFT): Likewise.
	(GRUB_OHCI_FSMPS): Likewise.
	(GRUB_OHCI_PERIODIC_START): Likewise.
	(GRUB_OHCI_FRAME_INTERVAL): Likewise.
	(GRUB_OHCI_SET_PORT_ENABLE): Likewise.
	(GRUB_OHCI_CLEAR_PORT_ENABLE): Likewise.
	(GRUB_OHCI_SET_PORT_RESET): Likewise.
	(GRUB_OHCI_SET_PORT_RESET_STATUS_CHANGE): Likewise.
	* bus/usb/ohci.c (grub_ohci_pci_iter): Various important fixups.
	(grub_ohci_transaction): Likewise.
	(grub_ohci_transfer): Improve condition detection algorithms.
	Handle toggle property. Program the transactions correctly.
	Improve error handling. Various important fixups.
	(grub_ohci_portstatus): Put register writes in right order.
	* bus/usb/uhci.c (grub_free_queue): Compute last_trans.
	(grub_uhci_transfer): Don't show "failed" message on success.
	* bus/usb/usb.c (grub_usb_set_configuration): Zero-fill whole "toggle"
	array.
	(grub_usb_device_initialize): Read first 8 bytes of descriptor to
	determine its size.
	* bus/usb/usbtrans.c (grub_usb_control_msg): Use descdev.maxsize0 even
	before initialization is completed. Use IN direction for empty
	transfers. Use last_trans and compute toggle.
	* include/grub/usbtrans.h (grub_usb_transfer): New field last_trans.
	(GRUB_USB_FEATURE_ENDP_HALT): Correct the value.
	(GRUB_USB_FEATURE_DEV_REMOTE_WU): Likewise.
	(GRUB_USB_FEATURE_TEST_MODE): Likewise.
	* include/grub/usb.h (grub_usb_err_t): New value GRUB_USB_ERR_UNRECOVERABLE.
	(grub_usb_device): Increase toggle to 256.
	(grub_usbms_subclass_t): New values GRUB_USBMS_SUBCLASS_RBC,
	GRUB_USBMS_SUBCLASS_MMC2, GRUB_USBMS_SUBCLASS_UFI and
	GRUB_USBMS_SUBCLASS_SFF8070.
	* include/grub/scsicmd.h (grub_scsi_test_unit_ready): New structure.
	(grub_scsi_inquiry): New member page and alloc_length.
	(grub_scsi_request_sense): New structure.
	(grub_scsi_request_sense_data): Likewise.
	(grub_scsi_read_capacity): New fields logical_block_addr, PMI and
	control.
	* disk/scsi.c (grub_scsi_request_sense): New function.
	(grub_scsi_test_unit_ready): Likewise.
	(grub_scsi_inquiry): Fill new fields.
	(grub_scsi_read_capacity): Likewise.
	(grub_scsi_read10): Add request sense at the end.
	(grub_scsi_read12): Likewise.
	(grub_scsi_write10): Likewise.
	(grub_scsi_write12): Likewise.
	(grub_scsi_open): Add Test Unit Ready.
	* disk/usbms.c (grub_usbms_finddevs): Check configcnt.
	Support additional subclasses. Con't clear halt yet. Activate the
	proper config. Calculate LUNs correctly.
	(grub_usbms_transfer): Various important fixups.

2010-06-02  Vladimir Serbinenko  <phcoder@gmail.com>

	* bus/pci.c (grub_pci_iterate) [GRUB_MACHINE_MIPS_YEELOONG]: Skip ghosts.
	* bus/usb/ohci.c (grub_ohci_portstatus): Handle R/WC correctly.
	(grub_ohci_fini_hw): New function.
	(grub_ohci_restore_hw): Likewise.
	(GRUB_MOD_INIT(ohci)): Register preboot hook.
	(GRUB_MOD_FINI(ohci)): Shutdown OHCI.
	* term/usb_keyboard.c: Remove include of grub/machine/console.h.

2010-06-02  Vladimir Serbinenko  <phcoder@gmail.com>

	Dedicated DMA allocations.

	* bus/pci.c (grub_memalign_dma32): New function
	(grub_dma_free): Likewise.
	(grub_dma_get_virt): Likewise.
	(grub_dma_get_phys): Likewise.
	* bus/usb/ohci.c (grub_ohci): New members hcca_addr and hcca_chunk.
	(grub_ohci_pci_iter): Use dma32_alloc.
	(grub_ohci_transfer): Likewise.
	* bus/usb/usbtrans.c (grub_usb_control_msg): Likewise.
	(grub_usb_bulk_readwrite): Likewise.
	* include/grub/pci.h: Add declarations.

2010-06-02  Vladimir Serbinenko  <phcoder@gmail.com>

	CS5536 support.

	* bus/cs5536.c: New file.
	* bus/usb/ohci.c (grub_ohci_pci_iter): Check for CS5536.
	* conf/i386.rmk (pkglib_MODULES): Add cs5536.mod.
	(cs5536_mod_SOURCES): New variable.
	(cs5536_mod_CFLAGS): Likewise.
	(cs5536_mod_LDFLAGS): Likewise.
	* conf/mips-yeeloong.rmk (kernel_img_HEADERS): Add cs5536.h and
	machine/pci.h.
	(kernel_img_SOURCES): Add bus/cs5536.c.
	(pkglib_MODULES): Add usb.mod, usbtest.mod, ohci.mod, usbms.mod and
	usb_keyboard.mod.
	(usb_mod_SOURCES): New variable.
	(usb_mod_CFLAGS): New variable.
	(usb_mod_LDFLAGS): New variable.
	(usbtest_mod_SOURCES): New variable.
	(usbtest_mod_CFLAGS): New variable.
	(usbtest_mod_LDFLAGS): New variable.
	(ohci_mod_SOURCES): New variable.
	(ohci_mod_CFLAGS): New variable.
	(ohci_mod_LDFLAGS): New variable.
	(usbms_mod_SOURCES): New variable.
	(usbms_mod_CFLAGS): New variable.
	(usbms_mod_LDFLAGS): New variable.
	(usb_keyboard_mod_SOURCES): New variable.
	(usb_keyboard_mod_CFLAGS): New variable.
	(usb_keyboard_mod_LDFLAGS): New variable.
	* include/grub/smbus.h: New file.
	* include/grub/cs5536.h: New file.

	Also-By: Vladimir Serbinenko <phcoder@gmail.com>
2010-06-02 17:16:20 +02:00
Vladimir 'phcoder' Serbinenko
8bd3a1fb30 Add necessarry cast 2010-06-02 16:46:55 +02:00
Colin Watson
e726afa89d fix indentation 2010-06-01 18:40:45 +01:00
Peter Henn
3b97788878 * disk/mdraid_linux.c (grub_mdraid_detect): Fix calculation of 1.x
chunk size and disk size, which are already given as sector counts
as distinct from the 0.90 units.  Fetch the correct device number
from the role table instead of using the table index.
2010-06-01 18:40:03 +01:00
Aleš Nesrsta
7d4873c26a Merge Aleš' latest patch 2010-06-01 02:10:19 +02:00
Vladimir 'phcoder' Serbinenko
b1d17e10e0 * disk/i386/pc/biosdisk.c (grub_biosdisk_open): Use
GRUB_DISK_SIZE_UNKNOWN.
	* disk/ieee1275/ofdisk.c (grub_ofdisk_open): Likewise.
2010-05-31 21:01:01 +02:00
Vladimir 'phcoder' Serbinenko
89d90892d0 Merge usb into yeeloongfw 2010-05-31 14:21:34 +02:00
Aleš Nesrsta
778ff32476 Fix a bunch of problems with USB. 2010-05-31 14:11:41 +02:00
Vladimir 'phcoder' Serbinenko
e34b610d49 merge mainline into yeeloongfw 2010-05-22 16:58:45 +02:00
BVK Chaitanya
f07ccea799 removed some duplicate code 2010-04-27 20:55:12 +05:30
Vladimir 'phcoder' Serbinenko
0973daeb38 * disk/lvm.c (grub_lvm_memberlist): Issue an error if pv->disk = 0. 2010-04-17 18:58:56 +02:00
Vladimir 'phcoder' Serbinenko
781d7798bb Fix interrupt and windows problems 2010-04-06 22:12:04 +02:00
Vladimir 'phcoder' Serbinenko
a6132b9f3f Merge mainline into yeeloongfw 2010-04-05 17:35:03 +02:00
Vladimir 'phcoder' Serbinenko
9b6e10bbbf Handle defered device registration 2010-03-14 23:18:13 +01:00
Vladimir 'phcoder' Serbinenko
016a671b51 Merge mainline into cleanbuild 2010-03-14 16:01:31 +01:00
Vladimir 'phcoder' Serbinenko
c28e2d120b merge mainline into yeeloongfw 2010-03-07 23:21:09 +01:00
Vladimir 'phcoder' Serbinenko
3ab4bd77dd 2010-03-04 Vladimir Serbinenko <phcoder@gmail.com>
* disk/scsi.c (grub_scsi_iterate): Fix a memory leak.
2010-03-05 15:29:28 +01:00
Vladimir 'phcoder' Serbinenko
232f7e29c9 SMBus on CS5536 support 2010-02-16 22:39:59 +01:00
Georgy Buranov
2793c71ea9 2010-02-16 Georgy Buranov <gburanov@gmail.com>
* disk/efi/efidisk.c (grub_efidisk_get_device_name): Fix a typo.
2010-02-16 13:13:02 +01:00
Vladimir 'phcoder' Serbinenko
5b59a4e367 2010-02-13 Vladimir Serbinenko <phcoder@gmail.com>
* disk/ieee1275/ofdisk.c (grub_ofdisk_open): Check device type before
	opening and not after.
2010-02-13 16:44:34 +01:00
Vladimir 'phcoder' Serbinenko
e0128bbdc4 2010-02-13 Vladimir Serbinenko <phcoder@gmail.com>
* disk/ieee1275/ofdisk.c (grub_ofdisk_read): Remove excessively
	verbose dprintf.
2010-02-13 16:16:40 +01:00
Vladimir 'phcoder' Serbinenko
ca62070b69 2010-02-13 Vladimir Serbinenko <phcoder@gmail.com>
Fix over-4GiB seek on sparc64.

	* include/grub/ieee1275/ieee1275.h (grub_ieee1275_seek):
	Replace pos_i and pos_lo with pos. All users updated.
	* include/grub/powerpc/ieee1275/ieee1275.h (GRUB_IEEE1275_CELL_SIZEOF):
	New constant.
	* include/grub/sparc64/ieee1275/ieee1275.h (GRUB_IEEE1275_CELL_SIZEOF):
	Likewise.
	* kern/ieee1275/ieee1275.c (grub_ieee1275_seek): Split pos into pos_hi
	and pos_lo.
2010-02-13 16:13:28 +01:00
Vladimir 'phcoder' Serbinenko
ec0be08d40 Clean building system 2010-02-07 23:49:49 +01:00
Vladimir 'phcoder' Serbinenko
19a9fb834b merge mainline into emu-mod 2010-02-07 03:06:33 +01:00
Vladimir 'phcoder' Serbinenko
909301af11 First try at generating grub-emu from modules 2010-02-07 02:07:35 +01:00
Vladimir 'phcoder' Serbinenko
89494cb55c 2010-02-06 Vladimir Serbinenko <phcoder@gmail.com>
* disk/ieee1275/ofdisk.c (grub_ofdisk_read): Correct error handling.
2010-02-06 15:51:22 +01:00
Vladimir 'phcoder' Serbinenko
996649b073 2010-02-03 Vladimir Serbinenko <phcoder@gmail.com>
* disk/i386/pc/biosdisk.c (grub_biosdisk_read): Handle non-2048 aligned
	CDROM reads.
	(grub_biosdisk_write): Refuse to write to CDROM.
2010-02-03 00:43:55 +01:00
Vladimir 'phcoder' Serbinenko
3b205d4ddf 2010-01-31 Vladimir Serbinenko <phcoder@gmail.com>
* disk/ieee1275/ofdisk.c (grub_ofdisk_iterate): Fix off-by-one error.
2010-01-31 11:11:03 +01:00
Vladimir 'phcoder' Serbinenko
f7fcb23c76 merge mainline into pciclean 2010-01-20 20:40:30 +01:00
Vladimir 'phcoder' Serbinenko
61eb45eee7 Rename asprint into xasprintf and avsprintf into xvasprintf 2010-01-20 09:12:47 +01:00