Deleted Added
full compact
ips_disk.c (125975) ips_disk.c (126364)
1/*-
2 * Written by: David Jeffery
3 * Copyright (c) 2002 Adaptec Inc.
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:

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

21 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25 * SUCH DAMAGE.
26 */
27
28#include <sys/cdefs.h>
1/*-
2 * Written by: David Jeffery
3 * Copyright (c) 2002 Adaptec Inc.
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:

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

21 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25 * SUCH DAMAGE.
26 */
27
28#include <sys/cdefs.h>
29__FBSDID("$FreeBSD: head/sys/dev/ips/ips_disk.c 125975 2004-02-18 21:36:53Z phk $");
29__FBSDID("$FreeBSD: head/sys/dev/ips/ips_disk.c 126364 2004-02-28 19:14:41Z scottl $");
30
31#include <dev/ips/ips.h>
32#include <dev/ips/ips_disk.h>
33#include <sys/stat.h>
34
35static int ipsd_probe(device_t dev);
36static int ipsd_attach(device_t dev);
37static int ipsd_detach(device_t dev);

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

74 dsc->state &= ~IPS_DEV_OPEN;
75 DEVICE_PRINTF(2, dsc->dev, "I'm closed for the day\n");
76 return 0;
77}
78
79/* ipsd_finish is called to clean up and return a completed IO request */
80void ipsd_finish(struct bio *iobuf)
81{
30
31#include <dev/ips/ips.h>
32#include <dev/ips/ips_disk.h>
33#include <sys/stat.h>
34
35static int ipsd_probe(device_t dev);
36static int ipsd_attach(device_t dev);
37static int ipsd_detach(device_t dev);

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

74 dsc->state &= ~IPS_DEV_OPEN;
75 DEVICE_PRINTF(2, dsc->dev, "I'm closed for the day\n");
76 return 0;
77}
78
79/* ipsd_finish is called to clean up and return a completed IO request */
80void ipsd_finish(struct bio *iobuf)
81{
82 ipsdisk_softc_t *dsc;
83 dsc = iobuf->bio_disk->d_drv1;
84
82 if (iobuf->bio_flags & BIO_ERROR) {
83 ipsdisk_softc_t *dsc;
84 dsc = iobuf->bio_disk->d_drv1;
85 device_printf(dsc->dev, "iobuf error %d\n", iobuf->bio_error);
86 } else
87 iobuf->bio_resid = 0;
88
89 biodone(iobuf);
85 if (iobuf->bio_flags & BIO_ERROR) {
86 ipsdisk_softc_t *dsc;
87 dsc = iobuf->bio_disk->d_drv1;
88 device_printf(dsc->dev, "iobuf error %d\n", iobuf->bio_error);
89 } else
90 iobuf->bio_resid = 0;
91
92 biodone(iobuf);
93 ips_start_io_request(dsc->sc);
90}
91
92
93static void ipsd_strategy(struct bio *iobuf)
94{
95 ipsdisk_softc_t *dsc;
96
97 dsc = iobuf->bio_disk->d_drv1;
98 DEVICE_PRINTF(8,dsc->dev,"in strategy\n");
99 iobuf->bio_driver1 = (void *)(uintptr_t)dsc->sc->drives[dsc->disk_number].drivenum;
94}
95
96
97static void ipsd_strategy(struct bio *iobuf)
98{
99 ipsdisk_softc_t *dsc;
100
101 dsc = iobuf->bio_disk->d_drv1;
102 DEVICE_PRINTF(8,dsc->dev,"in strategy\n");
103 iobuf->bio_driver1 = (void *)(uintptr_t)dsc->sc->drives[dsc->disk_number].drivenum;
100 ips_start_io_request(dsc->sc, iobuf);
104 mtx_lock(&dsc->sc->queue_mtx);
105 bioq_disksort(&dsc->sc->queue, iobuf);
106 mtx_unlock(&dsc->sc->queue_mtx);
107 ips_start_io_request(dsc->sc);
101}
102
103static int ipsd_probe(device_t dev)
104{
105 DEVICE_PRINTF(2,dev, "in probe\n");
106 device_set_desc(dev, "Logical Drive");
107 return 0;
108}

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

156
157 DEVICE_PRINTF(2, dev,"in detach\n");
158 dsc = (ipsdisk_softc_t *)device_get_softc(dev);
159 if(dsc->state & IPS_DEV_OPEN)
160 return (EBUSY);
161 disk_destroy(dsc->ipsd_disk);
162 return 0;
163}
108}
109
110static int ipsd_probe(device_t dev)
111{
112 DEVICE_PRINTF(2,dev, "in probe\n");
113 device_set_desc(dev, "Logical Drive");
114 return 0;
115}

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

163
164 DEVICE_PRINTF(2, dev,"in detach\n");
165 dsc = (ipsdisk_softc_t *)device_get_softc(dev);
166 if(dsc->state & IPS_DEV_OPEN)
167 return (EBUSY);
168 disk_destroy(dsc->ipsd_disk);
169 return 0;
170}
164