Deleted Added
full compact
umass_loader.c (291402) umass_loader.c (298230)
1/* $FreeBSD: head/sys/boot/usb/storage/umass_loader.c 291402 2015-11-27 18:17:53Z zbb $ */
1/* $FreeBSD: head/sys/boot/usb/storage/umass_loader.c 298230 2016-04-18 23:09:22Z allanjude $ */
2/*-
3 * Copyright (c) 2014 Hans Petter Selasky <hselasky@FreeBSD.org>
4 * All rights reserved.
5 *
6 * This software was developed by SRI International and the University of
7 * Cambridge Computer Laboratory under DARPA/AFRL contract (FA8750-10-C-0237)
8 * ("CTSRD"), as part of the DARPA CRASH research programme.
9 *

--- 33 unchanged lines hidden (view full) ---

43
44#include "umass_common.h"
45
46static int umass_disk_init(void);
47static int umass_disk_open(struct open_file *,...);
48static int umass_disk_close(struct open_file *);
49static void umass_disk_cleanup(void);
50static int umass_disk_ioctl(struct open_file *, u_long, void *);
2/*-
3 * Copyright (c) 2014 Hans Petter Selasky <hselasky@FreeBSD.org>
4 * All rights reserved.
5 *
6 * This software was developed by SRI International and the University of
7 * Cambridge Computer Laboratory under DARPA/AFRL contract (FA8750-10-C-0237)
8 * ("CTSRD"), as part of the DARPA CRASH research programme.
9 *

--- 33 unchanged lines hidden (view full) ---

43
44#include "umass_common.h"
45
46static int umass_disk_init(void);
47static int umass_disk_open(struct open_file *,...);
48static int umass_disk_close(struct open_file *);
49static void umass_disk_cleanup(void);
50static int umass_disk_ioctl(struct open_file *, u_long, void *);
51static int umass_disk_strategy(void *, int, daddr_t, size_t, char *, size_t *);
51static int umass_disk_strategy(void *, int, daddr_t, size_t, size_t, char *,
52 size_t *);
52static void umass_disk_print(int);
53
54struct devsw umass_disk = {
55 .dv_name = "umass",
56 .dv_type = DEVT_DISK,
57 .dv_init = umass_disk_init,
58 .dv_strategy = umass_disk_strategy,
59 .dv_open = umass_disk_open,

--- 19 unchanged lines hidden (view full) ---

79 callout_process(1);
80 if (umass_uaa.device != NULL)
81 return (0);
82 }
83 return (0);
84}
85
86static int
53static void umass_disk_print(int);
54
55struct devsw umass_disk = {
56 .dv_name = "umass",
57 .dv_type = DEVT_DISK,
58 .dv_init = umass_disk_init,
59 .dv_strategy = umass_disk_strategy,
60 .dv_open = umass_disk_open,

--- 19 unchanged lines hidden (view full) ---

80 callout_process(1);
81 if (umass_uaa.device != NULL)
82 return (0);
83 }
84 return (0);
85}
86
87static int
87umass_disk_strategy(void *devdata, int flag, daddr_t dblk, size_t size,
88 char *buf, size_t *rsizep)
88umass_disk_strategy(void *devdata, int flag, daddr_t dblk, size_t offset,
89 size_t size, char *buf, size_t *rsizep)
89{
90 if (umass_uaa.device == NULL)
91 return (ENXIO);
92 if (rsizep != NULL)
93 *rsizep = 0;
94
95 if (flag == F_WRITE) {
96 if (usb_msc_write_10(umass_uaa.device, 0, dblk, size >> 9, buf) != 0)

--- 126 unchanged lines hidden ---
90{
91 if (umass_uaa.device == NULL)
92 return (ENXIO);
93 if (rsizep != NULL)
94 *rsizep = 0;
95
96 if (flag == F_WRITE) {
97 if (usb_msc_write_10(umass_uaa.device, 0, dblk, size >> 9, buf) != 0)

--- 126 unchanged lines hidden ---