1/* 2* Queue.h 3* 4*Copyright (C) 2010 Beceem Communications, Inc. 5* 6*This program is free software: you can redistribute it and/or modify 7*it under the terms of the GNU General Public License version 2 as 8*published by the Free Software Foundation. 9* 10*This program is distributed in the hope that it will be useful,but 11*WITHOUT ANY WARRANTY; without even the implied warranty of 12*MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 13*See the GNU General Public License for more details. 14* 15*You should have received a copy of the GNU General Public License 16*along with this program. If not, write to the Free Software Foundation, Inc., 17*51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 18* 19*/ 20 21 22#ifndef __QUEUE_H__ 23#define __QUEUE_H__ 24 25 26 27#define ENQUEUEPACKET(_Head, _Tail,_Packet) \ 28do \ 29{ \ 30 if (!_Head) { \ 31 _Head = _Packet; \ 32 } \ 33 else { \ 34 (_Tail)->next = _Packet; \ 35 } \ 36 (_Packet)->next = NULL; \ 37 _Tail = _Packet; \ 38}while(0) 39#define DEQUEUEPACKET(Head, Tail ) \ 40do \ 41{ if(Head) \ 42 { \ 43 if (!Head->next) { \ 44 Tail = NULL; \ 45 } \ 46 Head = Head->next; \ 47 } \ 48}while(0) 49#endif //__QUEUE_H__ 50