Changeset View
Changeset View
Standalone View
Standalone View
tests/sys/devad2/devad2.h
Property | Old Value | New Value |
---|---|---|
svn:eol-style | null | native \ No newline at end of property |
svn:keywords | null | FreeBSD=%H \ No newline at end of property |
svn:mime-type | null | text/plain \ No newline at end of property |
/*- | |||||
* Copyright (c) 2013, 2014 Spectra Logic Corporation | |||||
* All rights reserved. | |||||
* | |||||
* Redistribution and use in source and binary forms, with or without | |||||
* modification, are permitted provided that the following conditions | |||||
* are met: | |||||
* 1. Redistributions of source code must retain the above copyright | |||||
* notice, this list of conditions, and the following disclaimer, | |||||
* without modification. | |||||
* 2. Redistributions in binary form must reproduce at minimum a disclaimer | |||||
* substantially similar to the "NO WARRANTY" disclaimer below | |||||
* ("Disclaimer") and any redistribution must be conditioned upon | |||||
* including a substantially similar Disclaimer requirement for further | |||||
* binary redistribution. | |||||
* | |||||
* NO WARRANTY | |||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | |||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | |||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR | |||||
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | |||||
* HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | |||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | |||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | |||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, | |||||
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING | |||||
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | |||||
* POSSIBILITY OF SUCH DAMAGES. | |||||
* | |||||
*/ | |||||
#ifndef __DEVAD2_H_ | |||||
#define __DEVAD2_H_ | |||||
struct devad_phy_args { | |||||
char enc_device[32]; | |||||
int phy; | |||||
int cycle_interval; | |||||
int flags; | |||||
#define DEVAD_PHY_FLAG_STOP 0x01 | |||||
pthread_t thread_data; | |||||
STAILQ_ENTRY(devad_phy_args) links; | |||||
}; | |||||
struct devad_openclose_args { | |||||
char cam_device[32]; | |||||
int cycle_interval; | |||||
pthread_t thread_data; | |||||
int flags; | |||||
#define DEVAD_OC_FLAG_STOP 0x01 | |||||
STAILQ_ENTRY(devad_openclose_args) links; | |||||
}; | |||||
#define DEVAD_READ_BUF_SIZE 131072 | |||||
struct devad_disk { | |||||
char periph_name[16]; | |||||
unsigned int unit_number; | |||||
struct cam_device *dev; | |||||
struct devad_softc *softc; | |||||
uint32_t generation; | |||||
int gone; | |||||
uint8_t read_buf[DEVAD_READ_BUF_SIZE]; | |||||
uint64_t cur_offset; | |||||
uint32_t secsize; | |||||
uint64_t max_sector; | |||||
union ccb *active_ccb; | |||||
TAILQ_ENTRY(devad_disk) links; | |||||
}; | |||||
struct devad_softc { | |||||
int num_disks; | |||||
int kq; | |||||
uint32_t xpt_generation; | |||||
uint64_t res_key; | |||||
pthread_mutex_t mutex; | |||||
TAILQ_HEAD(, devad_disk) disk_list; | |||||
STAILQ_HEAD(, devad_phy_args) phy_list; | |||||
STAILQ_HEAD(, devad_openclose_args) openclose_list; | |||||
}; | |||||
__BEGIN_DECLS | |||||
void devad_disk_remove(struct devad_softc *softc, struct devad_disk *disk); | |||||
int devad_disk_remove_device(struct devad_softc *softc, char *name, | |||||
unsigned int unit_number); | |||||
int devad_disk_probe_device(struct devad_softc *softc, char *name, | |||||
unsigned int unit_number); | |||||
int devad_disk_get_generation(uint32_t *generation); | |||||
int devad_disk_scan(struct devad_softc *softc, int print_devs); | |||||
void devad_disk_read_done(struct devad_disk *disk); | |||||
__END_DECLS | |||||
#endif /* __DEVAD2_H_ */ |