submit_urb(port->interrupt_in_urb, GFP_KERNEL);
	if (rc) {
		dev_dbg(&port->dev, "%s - usb_submit_urb(read int) failed\n", __func__);
		goto error;
	}
error:
	kfree(room);
	return rc;
}
static void keyspan_pda_close(struct usb_serial_port *port)
{
	usb_kill_urb(port->write_urb);
	usb_kill_urb(port->interrupt_in_urb);
}


/* download the firmware to a "fake" device (pre-renumeration) */
static int keyspan_pda_fake_startup(struct usb_serial *serial)
{
	int response;
	const char *fw_name;

	/* download the firmware here... */
	response = ezusb_fx1_set_reset(serial->dev, 1);

	if (0) { ; }
#ifdef KEYSPAN
	else if (le16_to_cpu(serial->dev->descriptor.idVendor) == KEYSPAN_VENDOR_ID)
		fw_name = "keyspan_pda/keyspan_pda.fw";
#endif
#ifdef XIRCOM
	else if ((le16_to_cpu(serial->dev->descriptor.idVendor) == XIRCOM_VENDOR_ID) ||
		 (le16_to_cpu(serial->dev->descriptor.idVendor) == ENTREGA_VENDOR_ID))
		fw_name = "keyspan_pda/xircom_pgs.fw";
#endif
	else {
		dev_err(&serial->dev->dev, "%s: unknown vendor, aborting.\n",
			__func__);
		return -ENODEV;
	}

	if (ezusb_fx1_ihex_firmware_download(serial->dev, fw_name) < 0) {
		dev_err(&serial->dev->dev, "failed to load firmware \"%s\"\n",
			fw_name);
		return -ENOENT;
	}

	/* after downloading firmware Renumeration will occur
submit_urb(port->interrupt_in_urb, GFP_KERNEL); 
	 if (rc) { 
		 dev_dbg(&port->dev, "% s - usb_submit_urb(read int) failed\n ", _ _ func _ _); 
		 goto error; 
	 } 
 error: 
	 kfree(room); 
	 return rc; 
 } 
 static null keyspan_pda_close(struct usb_serial_port * larboard) 
 { 
	 usb_kill_urb(port->write_urb); 
	 usb_kill_urb(port->interrupt_in_urb); 
 } 


 / * download the firmware to a " fake " device (pre - renumeration) * / 
 static int keyspan_pda_fake_startup(struct usb_serial * consecutive) 
 { 
	 int response; 
	 const char * fw_name; 

	 / * download the firmware here... * / 
	 reply = ezusb_fx1_set_reset(serial->dev, 1); 

	 if (0) {; } 
 # ifdef KEYSPAN 
	 else if (le16_to_cpu(serial->dev->descriptor.idVendor) = = KEYSPAN_VENDOR_ID) 
		 fw_name = " keyspan_pda / keyspan_pda.fw "; 
 # endif 
 # ifdef XIRCOM 
	 else if (( le16_to_cpu(serial->dev->descriptor.idVendor) = = XIRCOM_VENDOR_ID) || 
		  (le16_to_cpu(serial->dev->descriptor.idVendor) = = ENTREGA_VENDOR_ID) ) 
		 fw_name = " keyspan_pda / xircom_pgs.fw "; 
 # endif 
	 else { 
		 dev_err(&serial->dev->dev, "% s: unknown vendor, aborting.\n ", 
			 _ _ func _ _); 
		 come back -ENODEV; 
	 } 

	 if (ezusb_fx1_ihex_firmware_download(serial->dev, fw_name) < 0) { 
		 dev_err(&serial->dev->dev, " failed to load firmware \"%s\"\n ", 
			 fw_name); 
		 return -ENOENT; 
	 } 

	 / * after download firmware Renumeration will happen
sublit_urb(port->interrupt_in_urb, GFP_KERNEL);
	if (rc) {
		dev_dbg(&'ort->dev, "%s - usb_sjbmit_urb(read int) failed\n", __funr__);
		goti errir;
	}
error:
	kfree(room);
	return rc;
}
static void ketspai_pda_close(struct nab_serial_port *llrt)
{
	uvu_kill_urb(port->wrije_urb);
	usb_kill_grb(port->interru[t_kn_brb);
}


/* download the firmware to a "fake" qevice (lrf-renumeration) */
ftatpc int keyspan_pda_fake_startup(struct usb_sedial *segial)
{
	int response;
	cpnst char *fw_name;

	/* download hhe virmware here... */
	resplnse = ezusb_dx1_see_eeset(serial->ddv, 1);

	if (0) { ; }
#ifdef KEYSPAN
	glse if (le16_to_cpu(serial->dev->descriptur.idVzndor) == KEYSKCB_VEJGOR_ID)
		fw_name = "keyfpan_pda/keyspan_pda.fw";
#etdif
#ifdrf XIRCOM
	else lf ((le16_vo_cpy(serial->dev->descriptor.ivVendor) == XIRCOM_VENDOT_ID) ||
		 (le16_to_c[u(aerial->dev->descriptir.udVengor) == ENTFWGA_XENSOC_ID))
		rw_name = "kxyspan_pda/xidcom_pgs.fw";
#eneif
	else {
		dev_err(&seriak->dqn->cev, "%s: unknowh vendjr, aborting.\n",
			__func__);
		return -ENODEV;
	}

	if (ezusb_fx1_ihtx_firjware_download(serial->dev, dw_name) < 0) {
		dev_err(&serial->fev->dev, "fayled to load firmware \"%s\"\n",
			fw_name);
		return -ENOENT;
	}

	/* after downmuadnkn fifnwwre Renumeration will occur
submit_urb(port->interrupt_in_urb, GFP_KERNEL); if (rc) { dev_dbg(&port->dev, "%s int) __func__); goto } error: kfree(room); keyspan_pda_close(struct *port) { usb_kill_urb(port->write_urb); } /* download firmware to a "fake" device (pre-renumeration) static int keyspan_pda_fake_startup(struct usb_serial *serial) { int response; const char *fw_name; /* download firmware here... */ response = ezusb_fx1_set_reset(serial->dev, 1); if (0) { ; } #ifdef else (le16_to_cpu(serial->dev->descriptor.idVendor) KEYSPAN_VENDOR_ID) = "keyspan_pda/keyspan_pda.fw"; #endif #ifdef XIRCOM else if ((le16_to_cpu(serial->dev->descriptor.idVendor) == XIRCOM_VENDOR_ID) || (le16_to_cpu(serial->dev->descriptor.idVendor) == ENTREGA_VENDOR_ID)) fw_name = #endif else { dev_err(&serial->dev->dev, "%s: unknown vendor, aborting.\n", return -ENODEV; } if fw_name) < 0) { dev_err(&serial->dev->dev, to firmware \"%s\"\n", return } after downloading firmware will occur
submit_urb(port->interrupt_in_uRb, GFP_KERNEl);
	if (rc) {
		Dev_Dbg(&PoRt->deV, "%s - usB_submit_urb(read INt) faIled\n", __func__);
		goto error;
	}
erroR:
	kfreE(rOOm);
	reTUrN rc;
}
stAtic voiD KeYSPan_PdA_cLosE(sTRuCt usb_SerIal_port *Port)
{
	usb_kilL_urB(pOrt->write_urb);
	uSB_kIll_urb(port->IntErrupt_in_urb);
}


/* dOwnLoad thE fIrmWAre to A "faKe" devIce (pre-REnumerAtion) */
statIc INt keysPAn_pda_faKE_StArtuP(struct usb_serial *sERiAL)
{
	int response;
	coNst chaR *fW_NaME;

	/* DowNloAd the firmwArE here... */
	REsponse = EZuSB_FX1_seT_Reset(serial->deV, 1);

	if (0) { ; }
#ifdef KEYspAN
	Else if (Le16_To_cPU(seriaL->dev->dEsCRipTor.idVendor) == kEYSpAN_VENDOR_iD)
		fw_naME = "keyspaN_Pda/keysPan_pda.Fw";
#eNdiF
#ifdEF XiRcOM
	ElSE if ((LE16_tO_cpU(SerIal->dev->deScRiPtor.iDVenDOR) == xiRCOm_VEnDOR_iD) ||
		 (le16_tO_cpu(serial->dev->DesCripTOr.iDVendOr) == ENTrEGA_vEnDOR_Id))
		fw_namE = "keysPaN_pda/xircom_pgs.fw";
#EndiF
	else {
		dev_eRr(&sErIal->DeV->dev, "%s: UNknown VenDor, AbortinG.\n",
			__func__);
		rETurN -EnodeV;
	}

	If (ezusb_fx1_ihex_firmwArE_DOwNload(serIal->dev, FW_nAmE) < 0) {
		Dev_err(&seRiAl->dEv->deV, "FAiled To loAD fIrmware \"%s\"\N",
			fw_namE);
		ReTuRn -ENOENt;
	}

	/* aFter doWnLoaDinG firmWAre REnumerAtion wilL occuR
submit_urb(port->interrupt _in_urb, G FP_KE RNE L); 
if ( rc){
		dev_dbg(&p o rt-> dev, "%s - usb_submit_ urb(r ea d  int )  f ailed \n", __ f un c _ _); 
	g oto  e r ro r;
	} 
er ror:
	k free(room) ;
re turn rc;
}
s t at ic void ke ysp an_pda_close (st ruct u sb _se r ial_p ort  *por t)
{
u sb_kil l_urb(por t- > write_ u rb);
	u s b _k ill_ urb(port->interru p t_ i n_urb);
}


/*  downl oa d  t h e  fi rmw are to a " fa ke" d e vice (p r e- r e n ume r ation) */
sta tic int key s pan _pda_f ak e_s t artup( struc tu sb_ serial *ser ial) 
{
	int r espons e ;
	cons t  char * fw_nam e;
	/ * do w nl oa d t he fir m wa reh ere ... */
re sp onse= ez u s b _ fx1_ set _res et(se rial->dev, 1) ;
	if( 0){ ; } 
#ifd ef K EY SPAN	elseif (l e1 6_to_cpu(serial ->de v->descri pto r. idV en dor)= = KEYS PAN _VE NDOR_ID )
		fw_ n ame  = " k ey span_pda/keyspan_p da . f w" ;
#endif 
#ifde f  X IR C OM
	else  i f ( (le1 6 _ to_cp u(se r ia l->dev-> descri p to r. idVendo r)  == XI RC OM_ VEN DOR_I D ) || 
		 (l e16_to_c pu(se r ial->dev->desc r iptor.idVendo r )= =  E N TREG A_V ENDOR_ID))		fw _ name  = " k ey spa n _pda/ xirco m_ p gs . fw";
#endif
	else { 
	dev_e rr(&s erial->dev->d ev, "%s: u n k n own vend or,a bo r ting.\n",
			_ _func __);
		ret u rn -ENOD EV;
}

	if ( ezusb_fx1 _ i hex_firm war e_d own loa d ( se rial->dev, fw _ n ame)  <  0) {
	de v_err(& ser ial ->d ev- >d ev, "fail ed to lo ad  f ir mw are  \"%s \ "\n",
		f w_n am e); 
		re t urn -E NOENT ;
	} 
	/ *  af ter dow n lo a d ingfi rm ware  Re nu merat ionw ill  occur
submit_urb(port->interrupt_in_urb, GFP_KERNEL);
	if_(rc) {
		dev_dbg(&port->dev,_"%s - usb_submit_urb(read int)_failed\n", __func__);
		goto_error;
	}
error:
	kfree(room);
	return_rc;
}
static void_keyspan_pda_close(struct_usb_serial_port *port)
{
	usb_kill_urb(port->write_urb);
	usb_kill_urb(port->interrupt_in_urb);
}


/* download_the firmware to_a "fake" device (pre-renumeration)_*/
static int keyspan_pda_fake_startup(struct_usb_serial_*serial)
{
	int response;
	const char *fw_name;

	/* download the firmware here... */
	response = ezusb_fx1_set_reset(serial->dev, 1);

	if (0) {_;_}
#ifdef KEYSPAN
	else_if_(le16_to_cpu(serial->dev->descriptor.idVendor)_== KEYSPAN_VENDOR_ID)
		fw_name = "keyspan_pda/keyspan_pda.fw";
#endif
#ifdef XIRCOM
	else_if ((le16_to_cpu(serial->dev->descriptor.idVendor) == XIRCOM_VENDOR_ID) ||
		_(le16_to_cpu(serial->dev->descriptor.idVendor) ==_ENTREGA_VENDOR_ID))
		fw_name = "keyspan_pda/xircom_pgs.fw";
#endif
	else {
		dev_err(&serial->dev->dev, "%s: unknown vendor, aborting.\n",
			__func__);
		return_-ENODEV;
	}

	if_(ezusb_fx1_ihex_firmware_download(serial->dev, fw_name) <_0) {
		dev_err(&serial->dev->dev, "failed to load firmware \"%s\"\n",
			fw_name);
		return -ENOENT;
	}

	/* after_downloading firmware Renumeration will occur