diff options
author | Krzysztof Hałasa <khc@pm.waw.pl> | 2009-05-25 07:25:34 -0400 |
---|---|---|
committer | Krzysztof Hałasa <khc@pm.waw.pl> | 2009-05-25 07:25:34 -0400 |
commit | 9733bb8e9ce0078f55405ce470a62ec0a551fe99 (patch) | |
tree | a8db59b6a76c678db1d1282ba7458d72f4f8a093 | |
parent | 11c79740d3c03cb81f84e98cf2e2dbd8d9bb53cd (diff) |
IXP4xx: Change QMgr function names to qmgr_stat_*_watermark and clean the comments.
Signed-off-by: Krzysztof Hałasa <khc@pm.waw.pl>
-rw-r--r-- | arch/arm/mach-ixp4xx/include/mach/qmgr.h | 22 | ||||
-rw-r--r-- | drivers/net/arm/ixp4xx_eth.c | 13 | ||||
-rw-r--r-- | drivers/net/wan/ixp4xx_hss.c | 9 |
3 files changed, 21 insertions, 23 deletions
diff --git a/arch/arm/mach-ixp4xx/include/mach/qmgr.h b/arch/arm/mach-ixp4xx/include/mach/qmgr.h index 32077e11f17a..9e7cad2d54cb 100644 --- a/arch/arm/mach-ixp4xx/include/mach/qmgr.h +++ b/arch/arm/mach-ixp4xx/include/mach/qmgr.h | |||
@@ -138,12 +138,12 @@ static inline int qmgr_stat_empty(unsigned int queue) | |||
138 | } | 138 | } |
139 | 139 | ||
140 | /** | 140 | /** |
141 | * qmgr_stat_empty() - checks if a hardware queue is nearly empty | 141 | * qmgr_stat_below_low_watermark() - checks if a queue is below low watermark |
142 | * @queue: queue number | 142 | * @queue: queue number |
143 | * | 143 | * |
144 | * Returns non-zero value if the queue is nearly or completely empty. | 144 | * Returns non-zero value if the queue is below low watermark. |
145 | */ | 145 | */ |
146 | static inline int qmgr_stat_nearly_empty(unsigned int queue) | 146 | static inline int qmgr_stat_below_low_watermark(unsigned int queue) |
147 | { | 147 | { |
148 | extern struct qmgr_regs __iomem *qmgr_regs; | 148 | extern struct qmgr_regs __iomem *qmgr_regs; |
149 | if (queue >= HALF_QUEUES) | 149 | if (queue >= HALF_QUEUES) |
@@ -153,19 +153,19 @@ static inline int qmgr_stat_nearly_empty(unsigned int queue) | |||
153 | } | 153 | } |
154 | 154 | ||
155 | /** | 155 | /** |
156 | * qmgr_stat_empty() - checks if a hardware queue is nearly full | 156 | * qmgr_stat_above_high_watermark() - checks if a queue is above high watermark |
157 | * @queue: queue number | 157 | * @queue: queue number |
158 | * | 158 | * |
159 | * Returns non-zero value if the queue is nearly or completely full. | 159 | * Returns non-zero value if the queue is above high watermark |
160 | */ | 160 | */ |
161 | static inline int qmgr_stat_nearly_full(unsigned int queue) | 161 | static inline int qmgr_stat_above_high_watermark(unsigned int queue) |
162 | { | 162 | { |
163 | BUG_ON(queue >= HALF_QUEUES); | 163 | BUG_ON(queue >= HALF_QUEUES); |
164 | return __qmgr_get_stat1(queue) & QUEUE_STAT1_NEARLY_FULL; | 164 | return __qmgr_get_stat1(queue) & QUEUE_STAT1_NEARLY_FULL; |
165 | } | 165 | } |
166 | 166 | ||
167 | /** | 167 | /** |
168 | * qmgr_stat_empty() - checks if a hardware queue is full | 168 | * qmgr_stat_full() - checks if a hardware queue is full |
169 | * @queue: queue number | 169 | * @queue: queue number |
170 | * | 170 | * |
171 | * Returns non-zero value if the queue is full. | 171 | * Returns non-zero value if the queue is full. |
@@ -180,10 +180,10 @@ static inline int qmgr_stat_full(unsigned int queue) | |||
180 | } | 180 | } |
181 | 181 | ||
182 | /** | 182 | /** |
183 | * qmgr_stat_empty() - checks if a hardware queue experienced underflow | 183 | * qmgr_stat_underflow() - checks if a hardware queue experienced underflow |
184 | * @queue: queue number | 184 | * @queue: queue number |
185 | * | 185 | * |
186 | * Returns non-zero value if empty. | 186 | * Returns non-zero value if the queue experienced underflow. |
187 | */ | 187 | */ |
188 | static inline int qmgr_stat_underflow(unsigned int queue) | 188 | static inline int qmgr_stat_underflow(unsigned int queue) |
189 | { | 189 | { |
@@ -191,10 +191,10 @@ static inline int qmgr_stat_underflow(unsigned int queue) | |||
191 | } | 191 | } |
192 | 192 | ||
193 | /** | 193 | /** |
194 | * qmgr_stat_empty() - checks if a hardware queue experienced overflow | 194 | * qmgr_stat_overflow() - checks if a hardware queue experienced overflow |
195 | * @queue: queue number | 195 | * @queue: queue number |
196 | * | 196 | * |
197 | * Returns non-zero value if empty. | 197 | * Returns non-zero value if the queue experienced overflow. |
198 | */ | 198 | */ |
199 | static inline int qmgr_stat_overflow(unsigned int queue) | 199 | static inline int qmgr_stat_overflow(unsigned int queue) |
200 | { | 200 | { |
diff --git a/drivers/net/arm/ixp4xx_eth.c b/drivers/net/arm/ixp4xx_eth.c index 672c9626b9ca..b6d188115caf 100644 --- a/drivers/net/arm/ixp4xx_eth.c +++ b/drivers/net/arm/ixp4xx_eth.c | |||
@@ -513,8 +513,8 @@ static int eth_poll(struct napi_struct *napi, int budget) | |||
513 | #endif | 513 | #endif |
514 | napi_complete(napi); | 514 | napi_complete(napi); |
515 | qmgr_enable_irq(rxq); | 515 | qmgr_enable_irq(rxq); |
516 | if (!qmgr_stat_nearly_empty(rxq) && | 516 | if (!qmgr_stat_below_low_watermark(rxq) && |
517 | napi_reschedule(napi)) { /* really empty in fact */ | 517 | napi_reschedule(napi)) { /* not empty again */ |
518 | #if DEBUG_RX | 518 | #if DEBUG_RX |
519 | printk(KERN_DEBUG "%s: eth_poll" | 519 | printk(KERN_DEBUG "%s: eth_poll" |
520 | " napi_reschedule successed\n", | 520 | " napi_reschedule successed\n", |
@@ -631,10 +631,9 @@ static void eth_txdone_irq(void *unused) | |||
631 | port->tx_buff_tab[n_desc] = NULL; | 631 | port->tx_buff_tab[n_desc] = NULL; |
632 | } | 632 | } |
633 | 633 | ||
634 | /* really empty in fact */ | 634 | start = qmgr_stat_below_low_watermark(port->plat->txreadyq); |
635 | start = qmgr_stat_nearly_empty(port->plat->txreadyq); | ||
636 | queue_put_desc(port->plat->txreadyq, phys, desc); | 635 | queue_put_desc(port->plat->txreadyq, phys, desc); |
637 | if (start) { | 636 | if (start) { /* TX-ready queue was empty */ |
638 | #if DEBUG_TX | 637 | #if DEBUG_TX |
639 | printk(KERN_DEBUG "%s: eth_txdone_irq xmit ready\n", | 638 | printk(KERN_DEBUG "%s: eth_txdone_irq xmit ready\n", |
640 | port->netdev->name); | 639 | port->netdev->name); |
@@ -710,14 +709,14 @@ static int eth_xmit(struct sk_buff *skb, struct net_device *dev) | |||
710 | queue_put_desc(TX_QUEUE(port->id), tx_desc_phys(port, n), desc); | 709 | queue_put_desc(TX_QUEUE(port->id), tx_desc_phys(port, n), desc); |
711 | dev->trans_start = jiffies; | 710 | dev->trans_start = jiffies; |
712 | 711 | ||
713 | if (qmgr_stat_nearly_empty(txreadyq)) { /* really empty in fact */ | 712 | if (qmgr_stat_below_low_watermark(txreadyq)) { /* empty */ |
714 | #if DEBUG_TX | 713 | #if DEBUG_TX |
715 | printk(KERN_DEBUG "%s: eth_xmit queue full\n", dev->name); | 714 | printk(KERN_DEBUG "%s: eth_xmit queue full\n", dev->name); |
716 | #endif | 715 | #endif |
717 | netif_stop_queue(dev); | 716 | netif_stop_queue(dev); |
718 | /* we could miss TX ready interrupt */ | 717 | /* we could miss TX ready interrupt */ |
719 | /* really empty in fact */ | 718 | /* really empty in fact */ |
720 | if (!qmgr_stat_nearly_empty(txreadyq)) { | 719 | if (!qmgr_stat_below_low_watermark(txreadyq)) { |
721 | #if DEBUG_TX | 720 | #if DEBUG_TX |
722 | printk(KERN_DEBUG "%s: eth_xmit ready again\n", | 721 | printk(KERN_DEBUG "%s: eth_xmit ready again\n", |
723 | dev->name); | 722 | dev->name); |
diff --git a/drivers/net/wan/ixp4xx_hss.c b/drivers/net/wan/ixp4xx_hss.c index 1e56e58c6605..a6dc317083d3 100644 --- a/drivers/net/wan/ixp4xx_hss.c +++ b/drivers/net/wan/ixp4xx_hss.c | |||
@@ -790,11 +790,10 @@ static void hss_hdlc_txdone_irq(void *pdev) | |||
790 | free_buffer_irq(port->tx_buff_tab[n_desc]); | 790 | free_buffer_irq(port->tx_buff_tab[n_desc]); |
791 | port->tx_buff_tab[n_desc] = NULL; | 791 | port->tx_buff_tab[n_desc] = NULL; |
792 | 792 | ||
793 | /* really empty in fact */ | 793 | start = qmgr_stat_below_low_watermark(port->plat->txreadyq); |
794 | start = qmgr_stat_nearly_empty(port->plat->txreadyq); | ||
795 | queue_put_desc(port->plat->txreadyq, | 794 | queue_put_desc(port->plat->txreadyq, |
796 | tx_desc_phys(port, n_desc), desc); | 795 | tx_desc_phys(port, n_desc), desc); |
797 | if (start) { | 796 | if (start) { /* TX-ready queue was empty */ |
798 | #if DEBUG_TX | 797 | #if DEBUG_TX |
799 | printk(KERN_DEBUG "%s: hss_hdlc_txdone_irq xmit" | 798 | printk(KERN_DEBUG "%s: hss_hdlc_txdone_irq xmit" |
800 | " ready\n", dev->name); | 799 | " ready\n", dev->name); |
@@ -869,13 +868,13 @@ static int hss_hdlc_xmit(struct sk_buff *skb, struct net_device *dev) | |||
869 | queue_put_desc(queue_ids[port->id].tx, tx_desc_phys(port, n), desc); | 868 | queue_put_desc(queue_ids[port->id].tx, tx_desc_phys(port, n), desc); |
870 | dev->trans_start = jiffies; | 869 | dev->trans_start = jiffies; |
871 | 870 | ||
872 | if (qmgr_stat_nearly_empty(txreadyq)) { /* really empty in fact */ | 871 | if (qmgr_stat_below_low_watermark(txreadyq)) { /* empty */ |
873 | #if DEBUG_TX | 872 | #if DEBUG_TX |
874 | printk(KERN_DEBUG "%s: hss_hdlc_xmit queue full\n", dev->name); | 873 | printk(KERN_DEBUG "%s: hss_hdlc_xmit queue full\n", dev->name); |
875 | #endif | 874 | #endif |
876 | netif_stop_queue(dev); | 875 | netif_stop_queue(dev); |
877 | /* we could miss TX ready interrupt */ | 876 | /* we could miss TX ready interrupt */ |
878 | if (!qmgr_stat_nearly_empty(txreadyq)) { | 877 | if (!qmgr_stat_below_low_watermark(txreadyq)) { |
879 | #if DEBUG_TX | 878 | #if DEBUG_TX |
880 | printk(KERN_DEBUG "%s: hss_hdlc_xmit ready again\n", | 879 | printk(KERN_DEBUG "%s: hss_hdlc_xmit ready again\n", |
881 | dev->name); | 880 | dev->name); |