Changeset View
Changeset View
Standalone View
Standalone View
stand/usb/storage/umass_loader.c
Show All 38 Lines | |||||
#define HAVE_STANDARD_DEFS | #define HAVE_STANDARD_DEFS | ||||
#include USB_GLOBAL_INCLUDE_FILE | #include USB_GLOBAL_INCLUDE_FILE | ||||
#include "umass_common.h" | #include "umass_common.h" | ||||
static int umass_disk_init(void); | static int umass_disk_init(void); | ||||
static int umass_disk_open(struct open_file *,...); | static int umass_disk_open(struct open_file *); | ||||
imp: drop second arg here, no? | |||||
static int umass_disk_close(struct open_file *); | static int umass_disk_close(struct open_file *); | ||||
static void umass_disk_cleanup(void); | static void umass_disk_cleanup(void); | ||||
static int umass_disk_ioctl(struct open_file *, u_long, void *); | static int umass_disk_ioctl(struct open_file *, u_long, void *); | ||||
static int umass_disk_strategy(void *, int, daddr_t, size_t, char *, size_t *); | static int umass_disk_strategy(void *, int, daddr_t, size_t, char *, size_t *); | ||||
static int umass_disk_print(int); | static int umass_disk_print(int); | ||||
struct devsw umass_disk = { | struct devsw umass_disk = { | ||||
.dv_name = "umass", | .dv_name = "umass", | ||||
▲ Show 20 Lines • Show All 61 Lines • ▼ Show 20 Lines | umass_disk_open_sub(struct disk_devdesc *dev) | ||||
if (usb_msc_read_capacity(umass_uaa.device, 0, &nblock, &blocksize) != 0) | if (usb_msc_read_capacity(umass_uaa.device, 0, &nblock, &blocksize) != 0) | ||||
return (EINVAL); | return (EINVAL); | ||||
return (disk_open(dev, ((uint64_t)nblock + 1) * (uint64_t)blocksize, blocksize)); | return (disk_open(dev, ((uint64_t)nblock + 1) * (uint64_t)blocksize, blocksize)); | ||||
} | } | ||||
static int | static int | ||||
umass_disk_open(struct open_file *f,...) | umass_disk_open(struct open_file *f) | ||||
Done Inline Actionsf is now __unused? tsoome: f is now __unused? | |||||
Done Inline Actionssecond arg 86? imp: second arg 86? | |||||
{ | { | ||||
va_list ap; | struct devdesc *dev; | ||||
struct disk_devdesc *dev; | |||||
va_start(ap, f); | dev = f->f_devdata; | ||||
dev = va_arg(ap, struct disk_devdesc *); | |||||
va_end(ap); | |||||
if (umass_uaa.device == NULL) | if (umass_uaa.device == NULL) | ||||
return (ENXIO); | return (ENXIO); | ||||
if (dev->d_unit != 0) | if (dev->d_unit != 0) | ||||
return (EIO); | return (EIO); | ||||
return (umass_disk_open_sub(dev)); | return (umass_disk_open_sub((struct disk_devdesc *)dev)); | ||||
} | } | ||||
static int | static int | ||||
umass_disk_ioctl(struct open_file *f, u_long cmd, void *buf) | umass_disk_ioctl(struct open_file *f, u_long cmd, void *buf) | ||||
{ | { | ||||
struct disk_devdesc *dev; | struct disk_devdesc *dev; | ||||
uint32_t nblock; | uint32_t nblock; | ||||
uint32_t blocksize; | uint32_t blocksize; | ||||
▲ Show 20 Lines • Show All 94 Lines • Show Last 20 Lines |
drop second arg here, no?