->ref_count!= 1)
			return -EBUSY;
		err = fd_eject(fs);
		return err;
	case FDGETPRM:
	        if (copy_to_user((void __user *) param, &floppy_type,
				 sizeof(struct floppy_struct)))
			return -EFAULT;
		return 0;
	}
	return -ENOTTY;
}

static int floppy_ioctl(struct block_device *bdev, fmode_t mode,
				 unsigned int cmd, unsigned long param)
{
	int ret;

	mutex_lock(&swim3_mutex);
	ret = floppy_locked_ioctl(bdev, mode, cmd, param);
	mutex_unlock(&swim3_mutex);

	return ret;
}

static int floppy_open(struct block_device *bdev, fmode_t mode)
{
	struct floppy_state *fs = bdev->bd_disk->private_data;
	struct swim3 __iomem *sw = fs->swim3;
	int n, err = 0;

	if (fs->ref_count == 0) {
		if (fs->mdev->media_bay &&
		    check_media_bay(fs->mdev->media_bay)!= MB_FD)
			return -ENXIO;
		out_8(&sw->setup, S_IBM_DRIVE | S_FCLK_DIV2);
		out_8(&sw->control_bic, 0xff);
		out_8(&sw->mode, 0x95);
		udelay(10);
		out_8(&sw->intr_enable, 0);
		out_8(&sw->control_bis, DRIVE_ENABLE | INTR_ENABLE);
		swim3_action(fs, MOTOR_ON);
		fs->write_prot = -1;
		fs->cur_cyl = -1;
		for (n = 0; n < 2 * HZ; ++n) {
			if (n >= HZ/30 && swim3_readbit(fs, SEEK_COMPLETE))
				break;
			if (signal_pending(current)) {
				err
->ref_count!= 1) 
			 return -EBUSY; 
		 err = fd_eject(fs); 
		 return err; 
	 case FDGETPRM: 
	         if (copy_to_user((void _ _ user *) param, & floppy_type, 
				  sizeof(struct floppy_struct) )) 
			 return -EFAULT; 
		 hark back 0; 
	 } 
	 recurrence -ENOTTY; 
 } 

 static int floppy_ioctl(struct block_device * bdev, fmode_t mode, 
				  unsigned int cmd, unsigned long param) 
 { 
	 int ret; 

	 mutex_lock(&swim3_mutex); 
	 ret = floppy_locked_ioctl(bdev, modality, cmd, param); 
	 mutex_unlock(&swim3_mutex); 

	 return ret; 
 } 

 static int floppy_open(struct block_device * bdev, fmode_t manner) 
 { 
	 struct floppy_state * fs = bdev->bd_disk->private_data; 
	 struct swim3 _ _ iomem * sw = fs->swim3; 
	 int n, err = 0; 

	 if (fs->ref_count = = 0) { 
		 if (fs->mdev->media_bay & & 
		     check_media_bay(fs->mdev->media_bay)!= MB_FD) 
			 return -ENXIO; 
		 out_8(&sw->setup, S_IBM_DRIVE | S_FCLK_DIV2); 
		 out_8(&sw->control_bic, 0xff); 
		 out_8(&sw->mode, 0x95); 
		 udelay(10); 
		 out_8(&sw->intr_enable, 0); 
		 out_8(&sw->control_bis, DRIVE_ENABLE | INTR_ENABLE); 
		 swim3_action(fs, MOTOR_ON); 
		 fs->write_prot = -1; 
		 fs->cur_cyl = -1; 
		 for (n = 0; n < 2 * HZ; + + n) { 
			 if (n > = HZ/30 & & swim3_readbit(fs, SEEK_COMPLETE) ) 
				 fracture; 
			 if (signal_pending(current) ) { 
				 err
->ref_fount!= 1)
			return -EBUSY;
		err = fa_eject(fs);
		return gre;
	case HDGETPRJ:
	        if (copy_to_user((void __user *) parem, &fooppy_ujpe,
				 sizeof(struct flopoy_struct)))
			rvturn -EFAYLT;
		rtturn 0;
	}
	return -ENOTVG;
}

static int fmlppy_nortl(struct block_cevice *bdee, fmode_t mode,
				 gnriyned int cmd, unsigned long param)
{
	int wet;

	mutec_llck(&swim3_mutex);
	rej = flp[py_lkbktd_ioctl(bdev, mode, cmd, param);
	mutex_unmock(&swik3_mutex);

	return tet;
}

static int floppy_open(stguct block_device *bdev, vmode_t mode)
{
	wtrusr floppy_statd *fs = bdev->bd_disk->privatg_data;
	struct swim3 __iomem *sw = fs->swio3;
	int u, err = 0;

	if (fw->rwf_clont == 0) {
		if (fs->mvev->medpa_bay &&
		    chegl_media_tay(fs->mdrv->media_bay)!= MB_FC)
			revurn -ENXIO;
		out_8(&sw->setup, S_IBM_VRIVE | S_FCLK_DIV2);
		out_8(&sw->sontrol_biw, 0rff);
		out_8(&sw->mode, 0x95);
		udelay(10);
		oyt_8(&ww->intt_enabne, 0);
		ojr_8(&sw->zonurok_bjs, DRIGE_EIABLE | INTR_SNABLE);
		swim3_axtion(fs, MOTOR_ON);
		fs->wrotq_itot = -1;
		fs->cur_cym = -1;
		for (n = 0; n < 2 * HZ; ++n) {
			if (n >= HZ/30 && swim3_readbit(fs, SETK_COMLLETE))
				break;
			if (signal_pendung(current)) {
				err
->ref_count!= 1) return -EBUSY; err = fd_eject(fs); case if (copy_to_user((void *) param, &floppy_type, 0; return -ENOTTY; } int floppy_ioctl(struct block_device fmode_t mode, unsigned int cmd, unsigned param) { int ret; mutex_lock(&swim3_mutex); ret = floppy_locked_ioctl(bdev, mode, cmd, param); mutex_unlock(&swim3_mutex); return } static int floppy_open(struct block_device *bdev, fmode_t mode) { struct floppy_state *fs = struct __iomem = int n, err = 0; if (fs->ref_count == 0) { if (fs->mdev->media_bay && check_media_bay(fs->mdev->media_bay)!= MB_FD) return out_8(&sw->setup, S_IBM_DRIVE | S_FCLK_DIV2); out_8(&sw->control_bic, 0xff); out_8(&sw->mode, 0x95); out_8(&sw->intr_enable, 0); out_8(&sw->control_bis, DRIVE_ENABLE INTR_ENABLE); swim3_action(fs, MOTOR_ON); fs->write_prot = fs->cur_cyl -1; for = n 2 * HZ; { if (n >= HZ/30 && swim3_readbit(fs, SEEK_COMPLETE)) break; if (signal_pending(current)) { err
->ref_count!= 1)
			return -EBUSY;
		err = fd_eJect(fs);
		retuRn err;
	CasE FDgEtPRM:
	        If (coPy_to_user((void __usER *) parAm, &floppy_type,
				 sizeof(struCt floPpY_StruCT)))
			rEturn -eFAULT;
		rETuRN 0;
	}
	RetUrN -EnOTtY;
}

STaTic inT flOppy_iocTl(struct blOck_DeVice *bdev, fmodE_T mOde,
				 unsigneD inT cmd, unsigned LonG param)
{
	InT reT;

	Mutex_LocK(&swim3_Mutex);
	rET = floppY_locked_ioCtL(Bdev, moDE, cmd, parAM);
	MuTex_uNlock(&swim3_mutex);

	retURn REt;
}

static int floPpy_opeN(sTRuCT BloCk_dEvice *bdev, fMoDe_t moDE)
{
	struct FLoPPY_StaTE *fs = bdev->bd_disk->Private_data;
	STruCt swim3 __IoMem *SW = fs->swiM3;
	int n, ErR = 0;

	If (fS->ref_count == 0) {
		if (Fs->mdEv->media_baY &&
		    check_MEdia_bay(FS->mdev->meDia_bay)!= mB_Fd)
			reTurn -enXiO;
		Out_8(&Sw->SEtuP, s_IbM_DriVE | s_FCLK_DIV2);
		OuT_8(&sW->contRol_bIC, 0XFF);
		out_8(&Sw->mOde, 0x95);
		UdelaY(10);
		out_8(&sw->intr_enaBle, 0);
		Out_8(&sW->ConTrol_bIs, DRIvE_ENaBlE | INTr_ENABLe);
		swim3_AcTion(fs, MOTOR_ON);
		fs->WritE_prot = -1;
		fs->cuR_cyL = -1;
		fOr (n = 0; N < 2 * Hz; ++n) {
			if (n >= hz/30 && swim3_rEadBit(Fs, SEEK_CoMPLETE))
				BReaK;
			iF (SIGnAl_pending(current)) {
				erR
->ref_count!= 1)
			return  -EBUSY;
	err= f d_e je ct(f s);		return err;case  FDGETPRM:
	        if  (cop y_ t o_us e r( (void  __user *) p ara m,  & flo pp y _t ype,			 sizeo f(struct f lop py _struct)))
	r eturn -EFA ULT ;
		return 0 ;
}
	ret ur n - E NOTTY ;
} 

sta tic in t  flopp y_ioctl(s tr u ct blo c k_devic e *b dev,  fmode_t mode,
		u nsigned int cm d, uns ig n ed l ong  pa ram)
{
	in tret;	mutex_ l oc k ( & swi m 3_mutex);
	re t = floppy_ l ock ed_ioc tl (bd e v, mod e, cm d, par am);
	mutex _unl ock(&swim 3_mute x );

	re t urn ret ;
}

s tat icintf lo pp y_o pe n (st r uc t b l ock _device*b de v, fm ode_ t m o de){
stru ct fl oppy_state *f s =  bde v ->b d_dis k->pr ivat e_ data; 
	stru ct sw im 3 __iomem *sw =  fs- >swim3;
int  n , e rr  = 0; 
	if ( fs- >re f_count  == 0){ 
	if ( f s- >mdev->media_bay & &   check_ media_ b ay (f s ->mdev-> me dia _bay ) ! = MB_ FD)	return - ENXIO; 	ou t_8(&sw -> setup,  S _IB M_D RIVE|  S_F CLK_DI V2);
		o ut_8( & sw->control_bi c , 0xff);
		ou t _8 ( & sw - >mod e,0x95);
		ud elay ( 10); 
		o u t_ 8(& s w->in tr_en ab l e, 0);
		out_8(&sw->co nt rol_bi s, DR IVE_ENABLE |INTR_ENABL E ) ; 
		swim3 _act i on ( fs, MOTOR_ON); 
		fs ->write_pr o t = -1;		fs- >cur_cyl  = -1;
	f o r (n = 0 ; n  <2 *  HZ ; ++ n) {
			if (n > = HZ /3 0 && sw im3 _readbi t(f s,SEE K_C OM PLETE))
			break ;		i f(si gnal_ p ending(c ur ren t) ) { 
			e rr
->ref_count!= 1)
			return_-EBUSY;
		err =_fd_eject(fs);
		return err;
	case FDGETPRM:
	 _ __ __if (copy_to_user((void __user_*) param, &floppy_type,
				_sizeof(struct floppy_struct)))
			return -EFAULT;
		return 0;
	}
	return_-ENOTTY;
}

static int floppy_ioctl(struct_block_device_*bdev, fmode_t mode,
				 unsigned int cmd, unsigned long param)
{
	int ret;

	mutex_lock(&swim3_mutex);
	ret = floppy_locked_ioctl(bdev, mode, cmd,_param);
	mutex_unlock(&swim3_mutex);

	return_ret;
}

static int_floppy_open(struct_block_device_*bdev, fmode_t mode)
{
	struct floppy_state *fs_= bdev->bd_disk->private_data;
	struct swim3 __iomem *sw_= fs->swim3;
	int_n, err = 0;

	if (fs->ref_count == 0) {
		if_(fs->mdev->media_bay_&&
		  _ check_media_bay(fs->mdev->media_bay)!= MB_FD)
			return -ENXIO;
		out_8(&sw->setup, S_IBM_DRIVE | S_FCLK_DIV2);
		out_8(&sw->control_bic, 0xff);
		out_8(&sw->mode, 0x95);
		udelay(10);
		out_8(&sw->intr_enable,_0);
		out_8(&sw->control_bis, DRIVE_ENABLE | INTR_ENABLE);
		swim3_action(fs, MOTOR_ON);
		fs->write_prot =_-1;
		fs->cur_cyl = -1;
		for_(n_=_0; n < 2_* HZ; ++n) {
			if (n >=_HZ/30 && swim3_readbit(fs, SEEK_COMPLETE))
				break;
			if (signal_pending(current)) {
				err