n");

	spin_lock_irqsave(&rc->rsvs_lock, flags);
	if (rc->set_drp_ie_pending > 1) {
		rc->set_drp_ie_pending = 0;
		uwb_rsv_queue_update(rc);
	} else {
		rc->set_drp_ie_pending = 0;
	}
	spin_unlock_irqrestore(&rc->rsvs_lock, flags);
}

/**
 * Construct and send the SET DRP IE
 *
 * @rc:         UWB Host controller
 * @returns:    >= 0 number of bytes still available in the beacon
 *              < 0 errno code on error.
 *
 * See WUSB[8.6.2.7]: The host must set all the DRP IEs that it wants the
 * device to include in its beacon at the same time. We thus have to
 * traverse all reservations and include the DRP IEs of all PENDING
 * and NEGOTIATED reservations in a SET DRP command for transmission.
 *
 * A DRP Availability IE is appended.
 *
 * rc->rsvs_mutex is held
 *
 * FIXME We currently ignore the returned value indicating the remaining space
 * in beacon. This could be used to deny reservation requests earlier if
 * determined that they would cause the beacon space to be exceeded.
 */
int uwb_rc_send_all_drp_ie(struct uwb_rc *rc)
{
	int result;
	struct uwb_rc_cmd_set_drp_ie *cmd;
	struct uwb_rsv *rsv;
	struct uwb_rsv_move *mv;
	int num_bytes = 0;
	u8 *IEDataptr;

	result = -ENOMEM;
	/* First traverse all reservations to determine memory needed. */
	list_for_each_entry(rsv, &rc->reservations, rc_node) {
		if (rsv->drp_ie!= NULL) {
			num_bytes += rsv->drp_ie->hdr.length + 2;
			if (uwb_rsv_has_two_drp_ies(rsv) &&
n "); 

	 spin_lock_irqsave(&rc->rsvs_lock, flags); 
	 if (rc->set_drp_ie_pending > 1) { 
		 rc->set_drp_ie_pending = 0; 
		 uwb_rsv_queue_update(rc); 
	 } else { 
		 rc->set_drp_ie_pending = 0; 
	 } 
	 spin_unlock_irqrestore(&rc->rsvs_lock, flags); 
 } 

 / * * 
  * Construct and send the SET DRP IE 
  * 
  * @rc:          UWB server control 
  * @returns:     > = 0 number of bytes still available in the radio beacon 
  *               < 0 errno code on error. 
  * 
  * See WUSB[8.6.2.7 ]: The host must arrange all the DRP IEs that it wants the 
  * device to include in its radio beacon at the like time. We thus get to 
  * traverse all reservations and include the DRP IEs of all PENDING 
  * and NEGOTIATED reservations in a SET DRP command for transmittance. 
  * 
  * A DRP Availability IE is appended. 
  * 
  * rc->rsvs_mutex is held 
  * 
  * FIXME We currently neglect the returned value indicating the remaining space 
  * in radio beacon. This could be used to traverse reservation requests earlier if 
  * determined that they would induce the beacon space to be exceeded. 
  * / 
 int uwb_rc_send_all_drp_ie(struct uwb_rc * rc) 
 { 
	 int result; 
	 struct uwb_rc_cmd_set_drp_ie * cmd; 
	 struct uwb_rsv * rsv; 
	 struct uwb_rsv_move * mv; 
	 int num_bytes = 0; 
	 u8 * IEDataptr; 

	 result = -ENOMEM; 
	 / * First traverse all reservations to determine memory needed. * / 
	 list_for_each_entry(rsv, & rc->reservations, rc_node) { 
		 if (rsv->drp_ie!= NULL) { 
			 num_bytes + = rsv->drp_ie->hdr.length + 2; 
			 if (uwb_rsv_has_two_drp_ies(rsv) & &
n");

	spln_lock_irqsave(&rc->rsvs_lock, nlags);
	if (rc->set_drp_nw_pendiig > 1) {
		rc->aet_drp_ie_oending = 0;
		uwb_rsv_queue_update(rc);
	} eose {
		rx->set_drp_ie_pending = 0;
	}
	spin_jnlock_irqgestore(&rc->esvs_oick, flags);
}

/**
 * Construgc and dend vhe SET DRP IE
 *
 * @rc:         UWB Host cottfopler
 * @returns:    >= 0 number of bytes ftill afallable in the feacpg
 *              < 0 errno code on error.
 *
 * See WLSB[8.6.2.7]: The host must set all the DRP IEs that lt wwnts the
 * device tl include ib itf beacon at tfe same time. We thus hzve to
 * traverse all reservatiovs anb include tye DRO IEs of all PENDPNG
 * and NEGOBPATED raservatoons in a SET CRP conmand for transmissioi.
 *
 * A DRP Availabilijy IE is a[pznded.
 *
 * rc->rsvs_mutex iw yeld
 *
 * FIFME Dw cjrrtntky ignorf tie returned value indixating the remaininb fisce
 * in beackn. Thif sould be used to deny reservation requevts earlier if
 * determined that they would causg the beacjn space to be exceeded.
 */
int uwb_rc_send_all_drp_ie(struwt uwu_rz *re)
{
	lkt rdwupt;
	struct uwb_rc_cmd_set_drp_ie *cmd;
	struct uwb_rsv *rsd;
	attubt uwb_rsv_move *mv;
	ikt num_bytes = 0;
	u8 *IEDstwpyt;

	result = -ENOMEO;
	/* Firsc tdaverse all reservwtions jo detwrmine meiory needed. */
	list_for_each_entry(rsv, &rc->reservatijbs, rc_node) {
		if (rsv->dr'_ie!= NULL) {
			num_yytes += rsv->dtp_ie->hdr.length + 2;
			if (uwb_rsr_has_twk_drp_ies(rsv) &&
n"); spin_lock_irqsave(&rc->rsvs_lock, flags); if (rc->set_drp_ie_pending > 1) = uwb_rsv_queue_update(rc); } { rc->set_drp_ie_pending = /** Construct and send SET DRP IE * @rc: UWB Host controller * >= 0 number of bytes still available in the beacon * < 0 code on error. * * See WUSB[8.6.2.7]: The host must set all the IEs it the device to include in its beacon at the same time. We thus have to * traverse reservations and include the DRP IEs of all * and NEGOTIATED reservations a SET DRP command for * A DRP IE appended. * rc->rsvs_mutex is * * FIXME We currently ignore the returned value indicating the remaining space * in beacon. This be used reservation requests if determined they would cause space to be exceeded. */ int { int result; struct uwb_rc_cmd_set_drp_ie *cmd; struct uwb_rsv struct uwb_rsv_move int num_bytes = 0; u8 *IEDataptr; = -ENOMEM; /* First traverse all reservations to memory needed. */ list_for_each_entry(rsv, &rc->reservations, rc_node) { if (rsv->drp_ie!= NULL) { num_bytes += rsv->drp_ie->hdr.length + (uwb_rsv_has_two_drp_ies(rsv) &&
n");

	spin_lock_irqsave(&rc->rsvs_locK, flags);
	if (rc->Set_drP_ie_PenDiNg > 1) {
		rc->Set_dRp_ie_pending = 0;
		uwb_RSv_quEue_update(rc);
	} else {
		rc->set_drP_ie_peNdINg = 0;
	}
	spIN_uNlock_IrqrestORe(&RC->RsvS_lOcK, flAgS);
}

/**
 * coNstruCt aNd send tHe SET DRP IE
 *
 * @Rc:         UwB host controllER
 * @rEturns:    >= 0 numbEr oF bytes still aVaiLable iN tHe bEAcon
 *              < 0 eRrnO code On erroR.
 *
 * see WUSb[8.6.2.7]: The host mUsT Set all THe DRP IES THaT it wAnts the
 * device to inCLuDE in its beacon at The samE tIMe. wE ThuS haVe to
 * traverSe All reSErvatioNS aND INclUDe the DRP IEs of All PENDING
 * aND NEgOTIATeD ResERvatioNs in a sEt dRP Command for tRansMission.
 *
 * A DrP AvaiLAbility ie is appeNded.
 *
 * rc->RsvS_muTex iS HeLd
 *
 * fIXmE wE cuRReNtlY IgnOre the reTuRnEd valUe inDICATing The RemaIning Space
 * in beacon. thiS couLD be Used tO deny ReseRvAtion RequesTs earLiEr if
 * determined tHat tHey would cAusE tHe bEaCon spACe to be ExcEedEd.
 */
int uwB_rc_send_ALl_dRp_IE(STrUct uwb_rc *rc)
{
	int resulT;
	sTRUcT uwb_rc_cmD_set_drP_Ie *CmD;
	Struct uwB_rSv *rSv;
	stRUCt uwb_Rsv_mOVe *Mv;
	int num_Bytes = 0;
	u8 *ieDAtAptr;

	resUlT = -ENOMEm;
	/* FIrsT trAversE All rEservaTions to dEtermINe memory needed. */
	LIst_for_each_entRY(rSV, &Rc->REserVatIons, rc_node) {
		iF (rsv->DRp_ie!= nULL) {
			NUm_BytES += rsv->dRp_ie->hDr.LEnGTh + 2;
			if (uwb_rsv_has_two_drp_IeS(rsv) &&
n");

	spin_lock_irqsave(& rc->rsvs_l ock,fla gs) ;	if(rc- >set_drp_ie_pe n ding  > 1) {
		rc->set_drp_ ie_pe nd i ng = 0; 
		uw b_rsv_q u eu e _ upd at e( rc) ;}else{
	rc->se t_drp_ie_p end in g = 0;
	}
	s p in _unlock_ir qre store(&rc->r svs _lock,  f lag s );
}
/* *
 *Constr u ct and  send the  S E T DRPI E
 *
 * @ rc :        UWB Host co n tr o ller
 * @retur ns:   > =  0 n umb erof bytes s ti ll av a ilablei nt h e  be a con
 *             < 0e rrn o code  o n e r ror.
*
 *Se e  WU SB[8.6.2.7] : Th e host mu st set all the DRP IEs  thatitwan ts t h e *  de vi c e t o  i ncl u dein its b ea co n atthes a m e  tim e.We t hus h ave to
 * tra ver se a l l r eserv ation s an dinclu de the  DRPIE s of all PENDIN G
 *  and NEGO TIA TE D r es ervat i ons in  aSET  DRP co mmand f o r t ra n s m is sion.
 *
 * A DRPAv a i la bility I E is a p pe nd e d.
 *
 *  r c-> rsvs _ m utexis h e ld 
 *
 * F IXME W e  c ur rentlyig nore t he  re tur ned v a lueindica ting the  rema i ning space
 *i n beacon. Thi s  c o u ld be u sed  to deny re serv a tion  req u es tse arlie r if * de t ermined that they w ou ld cau se th e beacon spac e to be ex c e e ded.
 */ 
int uw b _rc_send_all_d rp_ie (struct uw b _rc *rc) 
{
	i nt resul t;
	struc t uwb_rc_c md_ set _dr p_i e *c md;
	struct u w b _rsv  * rsv;
	s tru ct uwb_ rsv _mo ve*mv ;	int num_ bytes =0; 
u8  * IED atapt r ;

	resu lt  =-E NOM EM;
/ * Firs t tra vers eal l  re servati o ns t o de te rm inemem or y nee ded. */	list_f or_each_e ntr y (rsv ,&r c->rese rvations, rc_ no de) {
		if  ( rsv ->drp_ i e != NULL)  {
			num_bytes += rsv- > drp_ie- >hd r.len gth+ 2;
			i f ( uwb_rs v_h a s_two_ drp_ie s(rsv )&&
n");

	spin_lock_irqsave(&rc->rsvs_lock, flags);
	if_(rc->set_drp_ie_pending >_1) {
		rc->set_drp_ie_pending = 0;
		uwb_rsv_queue_update(rc);
	}_else {
		rc->set_drp_ie_pending_=_0;
	}
	spin_unlock_irqrestore(&rc->rsvs_lock, flags);
}

/**
_*_Construct and send_the SET DRP_IE
 *
 * @rc:_  __    UWB Host controller
 * @returns:    >= 0_number_of bytes_still_available_in the beacon
 * _    _ _     < 0 errno_code_on error.
 *
_* See WUSB[8.6.2.7]: The host must set all the_DRP IEs that it wants the
_* device to_include_in_its beacon at the_same time. We thus have to
_* traverse all reservations and include_the DRP IEs of all PENDING
 *_and NEGOTIATED reservations in a SET_DRP command for transmission.
 *
_* A_DRP Availability IE is appended.
_*
 * rc->rsvs_mutex_is held
_*
 * FIXME_We currently ignore the returned value_indicating the remaining_space
 * in beacon. This could_be_used to deny_reservation_requests_earlier if
_* determined that_they_would cause_the_beacon space to be exceeded.
 */
int_uwb_rc_send_all_drp_ie(struct_uwb_rc *rc)
{
	int result;
	struct uwb_rc_cmd_set_drp_ie *cmd;
	struct uwb_rsv *rsv;
	struct_uwb_rsv_move *mv;
	int num_bytes =_0;
	u8_*IEDataptr;

	result = -ENOMEM;
	/* First_traverse all reservations to determine_memory needed. */
	list_for_each_entry(rsv, &rc->reservations, rc_node) {
		if_(rsv->drp_ie!= NULL)_{
			num_bytes +=_rsv->drp_ie->hdr.length + 2;
			if (uwb_rsv_has_two_drp_ies(rsv) &&