mcd.c (10069) | mcd.c (10624) |
---|---|
1/* 2 * Copyright 1993 by Holger Veit (data part) 3 * Copyright 1993 by Brian Moore (audio part) 4 * Changes Copyright 1993 by Gary Clark II 5 * Changes Copyright (C) 1994-1995 by Andrey A. Chernov, Moscow, Russia 6 * 7 * Rewrote probe routine to work on newer Mitsumi drives. 8 * Additional changes (C) 1994 by Jordan K. Hubbard --- 26 unchanged lines hidden (view full) --- 35 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, 36 * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 37 * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 38 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 39 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 40 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 41 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 42 * | 1/* 2 * Copyright 1993 by Holger Veit (data part) 3 * Copyright 1993 by Brian Moore (audio part) 4 * Changes Copyright 1993 by Gary Clark II 5 * Changes Copyright (C) 1994-1995 by Andrey A. Chernov, Moscow, Russia 6 * 7 * Rewrote probe routine to work on newer Mitsumi drives. 8 * Additional changes (C) 1994 by Jordan K. Hubbard --- 26 unchanged lines hidden (view full) --- 35 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, 36 * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 37 * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 38 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 39 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 40 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 41 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 42 * |
43 * $Id: mcd.c,v 1.44 1995/05/30 08:02:44 rgrimes Exp $ | 43 * $Id: mcd.c,v 1.45 1995/08/15 19:56:59 joerg Exp $ |
44 */ 45static char COPYRIGHT[] = "mcd-driver (C)1993 by H.Veit & B.Moore"; 46 47#include "mcd.h" 48#if NMCD > 0 49#include <sys/types.h> 50#include <sys/param.h> 51#include <sys/systm.h> --- 107 unchanged lines hidden (view full) --- 159/* reader state machine */ 160#define MCD_S_BEGIN 0 161#define MCD_S_BEGIN1 1 162#define MCD_S_WAITSTAT 2 163#define MCD_S_WAITMODE 3 164#define MCD_S_WAITREAD 4 165 166/* prototypes */ | 44 */ 45static char COPYRIGHT[] = "mcd-driver (C)1993 by H.Veit & B.Moore"; 46 47#include "mcd.h" 48#if NMCD > 0 49#include <sys/types.h> 50#include <sys/param.h> 51#include <sys/systm.h> --- 107 unchanged lines hidden (view full) --- 159/* reader state machine */ 160#define MCD_S_BEGIN 0 161#define MCD_S_BEGIN1 1 162#define MCD_S_WAITSTAT 2 163#define MCD_S_WAITMODE 3 164#define MCD_S_WAITREAD 4 165 166/* prototypes */ |
167int mcdopen(dev_t dev); 168int mcdclose(dev_t dev); | 167int mcdopen(dev_t dev, int flags, int fmt, struct proc *p); 168int mcdclose(dev_t dev, int flags, int fmt, struct proc *p); |
169void mcdstrategy(struct buf *bp); | 169void mcdstrategy(struct buf *bp); |
170int mcdioctl(dev_t dev, int cmd, caddr_t addr, int flags); | 170int mcdioctl(dev_t dev, int cmd, caddr_t addr, int flags, struct proc *p); |
171int mcdsize(dev_t dev); 172static void mcd_done(struct mcd_mbx *mbx); 173static void mcd_start(int unit); 174static int mcd_getdisklabel(int unit); 175static void mcd_configure(struct mcd_data *cd); 176static int mcd_get(int unit, char *buf, int nmax); 177static int mcd_setflags(int unit,struct mcd_data *cd); 178static int mcd_getstat(int unit,int sflg); --- 81 unchanged lines hidden (view full) --- 260#endif 261 kdc_mcd[dev->id_unit].kdc_state = DC_IDLE; 262 /* name filled in probe */ 263 kdc_mcd[dev->id_unit].kdc_description = mcd_data[dev->id_unit].name; 264 265 return 1; 266} 267 | 171int mcdsize(dev_t dev); 172static void mcd_done(struct mcd_mbx *mbx); 173static void mcd_start(int unit); 174static int mcd_getdisklabel(int unit); 175static void mcd_configure(struct mcd_data *cd); 176static int mcd_get(int unit, char *buf, int nmax); 177static int mcd_setflags(int unit,struct mcd_data *cd); 178static int mcd_getstat(int unit,int sflg); --- 81 unchanged lines hidden (view full) --- 260#endif 261 kdc_mcd[dev->id_unit].kdc_state = DC_IDLE; 262 /* name filled in probe */ 263 kdc_mcd[dev->id_unit].kdc_description = mcd_data[dev->id_unit].name; 264 265 return 1; 266} 267 |
268int mcdopen(dev_t dev) | 268int mcdopen(dev_t dev, int flags, int fmt, struct proc *p) |
269{ 270 int unit,part,phys,r,retry; 271 struct mcd_data *cd; 272 273 unit = mcd_unit(dev); 274 if (unit >= NMCD) 275 return ENXIO; 276 --- 59 unchanged lines hidden (view full) --- 336 if (!(cd->flags & MCDVALID)) 337 return ENXIO; 338 return 0; 339 } 340 341 return ENXIO; 342} 343 | 269{ 270 int unit,part,phys,r,retry; 271 struct mcd_data *cd; 272 273 unit = mcd_unit(dev); 274 if (unit >= NMCD) 275 return ENXIO; 276 --- 59 unchanged lines hidden (view full) --- 336 if (!(cd->flags & MCDVALID)) 337 return ENXIO; 338 return 0; 339 } 340 341 return ENXIO; 342} 343 |
344int mcdclose(dev_t dev) | 344int mcdclose(dev_t dev, int flags, int fmt, struct proc *p) |
345{ 346 int unit,part,phys; 347 struct mcd_data *cd; 348 349 unit = mcd_unit(dev); 350 if (unit >= NMCD) 351 return ENXIO; 352 --- 133 unchanged lines hidden (view full) --- 486 cd->mbx.p_offset = p->p_offset; 487 488 /* calling the read routine */ 489 mcd_doread(MCD_S_BEGIN,&(cd->mbx)); 490 /* triggers mcd_start, when successful finished */ 491 return; 492} 493 | 345{ 346 int unit,part,phys; 347 struct mcd_data *cd; 348 349 unit = mcd_unit(dev); 350 if (unit >= NMCD) 351 return ENXIO; 352 --- 133 unchanged lines hidden (view full) --- 486 cd->mbx.p_offset = p->p_offset; 487 488 /* calling the read routine */ 489 mcd_doread(MCD_S_BEGIN,&(cd->mbx)); 490 /* triggers mcd_start, when successful finished */ 491 return; 492} 493 |
494int mcdioctl(dev_t dev, int cmd, caddr_t addr, int flags) | 494int mcdioctl(dev_t dev, int cmd, caddr_t addr, int flags, struct proc *p) |
495{ 496 struct mcd_data *cd; 497 int unit,part; 498 499 unit = mcd_unit(dev); 500 part = mcd_part(dev); 501 cd = mcd_data + unit; 502 --- 1168 unchanged lines hidden --- | 495{ 496 struct mcd_data *cd; 497 int unit,part; 498 499 unit = mcd_unit(dev); 500 part = mcd_part(dev); 501 cd = mcd_data + unit; 502 --- 1168 unchanged lines hidden --- |