Changeset 87037cc9 in mainline
- Timestamp:
- 2011-10-14T12:05:40Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 3002434
- Parents:
- a92ce4ef
- Location:
- uspace/drv/bus/usb/usbmast
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/bus/usb/usbmast/main.c
ra92ce4ef r87037cc9 112 112 113 113 usb_log_debug("Get LUN count...\n"); 114 mdev->luns = usb_masstor_get_lun_count(mdev); 115 116 for (i = 0; i < mdev->luns; i++) { 114 mdev->lun_count = usb_masstor_get_lun_count(mdev); 115 mdev->luns = calloc(mdev->lun_count, sizeof(ddf_fun_t*)); 116 if (mdev->luns == NULL) { 117 rc = ENOMEM; 118 usb_log_error("Failed allocating luns table.\n"); 119 goto error; 120 } 121 122 for (i = 0; i < mdev->lun_count; i++) { 117 123 rc = usbmast_fun_create(mdev, i); 118 124 if (rc != EOK) … … 162 168 } 163 169 170 mfun->ddf_fun = fun; 164 171 mfun->mdev = mdev; 165 172 mfun->lun = lun; … … 212 219 213 220 free(fun_name); 221 mdev->luns[lun] = fun; 214 222 215 223 return EOK; -
uspace/drv/bus/usb/usbmast/usbmast.h
ra92ce4ef r87037cc9 41 41 42 42 /** Mass storage device. */ 43 typedef struct {43 typedef struct usbmast_dev { 44 44 /** DDF device */ 45 45 ddf_dev_t *ddf_dev; … … 47 47 usb_device_t *usb_dev; 48 48 /** Number of LUNs */ 49 unsigned luns; 49 unsigned lun_count; 50 /** LUN functions */ 51 ddf_fun_t **luns; 50 52 } usbmast_dev_t; 53 51 54 52 55 /** Mass storage function.
Note:
See TracChangeset
for help on using the changeset viewer.