diff options
author | Linas Vepstas <linas@austin.ibm.com> | 2006-12-13 16:12:26 -0500 |
---|---|---|
committer | Jeff Garzik <jeff@garzik.org> | 2007-02-05 16:58:44 -0500 |
commit | 1cd173f66c392ede57fa10f614fca22d79501424 (patch) | |
tree | 2daaca1e8b6e8ef56f231801114bbffb19406bc7 /drivers | |
parent | 75856175c26f89198ec64eb2480ed00c4a39a5d6 (diff) |
Spidernet cleanup un-needed API
There is no need to pass a flag into spider_net_decode_one_descr()
so remove this, and perform some othre minor cleanup.
Signed-off-by: Linas Vepstas <linas@austin.ibm.com>
Cc: James K Lewis <jklewis@us.ibm.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/spider_net.c | 35 |
1 files changed, 12 insertions, 23 deletions
diff --git a/drivers/net/spider_net.c b/drivers/net/spider_net.c index 572c7546e158..f97251a9c850 100644 --- a/drivers/net/spider_net.c +++ b/drivers/net/spider_net.c | |||
@@ -910,7 +910,6 @@ spider_net_do_ioctl(struct net_device *netdev, struct ifreq *ifr, int cmd) | |||
910 | * spider_net_pass_skb_up - takes an skb from a descriptor and passes it on | 910 | * spider_net_pass_skb_up - takes an skb from a descriptor and passes it on |
911 | * @descr: descriptor to process | 911 | * @descr: descriptor to process |
912 | * @card: card structure | 912 | * @card: card structure |
913 | * @napi: whether caller is in NAPI context | ||
914 | * | 913 | * |
915 | * returns 1 on success, 0 if no packet was passed to the stack | 914 | * returns 1 on success, 0 if no packet was passed to the stack |
916 | * | 915 | * |
@@ -919,7 +918,7 @@ spider_net_do_ioctl(struct net_device *netdev, struct ifreq *ifr, int cmd) | |||
919 | */ | 918 | */ |
920 | static int | 919 | static int |
921 | spider_net_pass_skb_up(struct spider_net_descr *descr, | 920 | spider_net_pass_skb_up(struct spider_net_descr *descr, |
922 | struct spider_net_card *card, int napi) | 921 | struct spider_net_card *card) |
923 | { | 922 | { |
924 | struct sk_buff *skb; | 923 | struct sk_buff *skb; |
925 | struct net_device *netdev; | 924 | struct net_device *netdev; |
@@ -972,10 +971,7 @@ spider_net_pass_skb_up(struct spider_net_descr *descr, | |||
972 | } | 971 | } |
973 | 972 | ||
974 | /* pass skb up to stack */ | 973 | /* pass skb up to stack */ |
975 | if (napi) | 974 | netif_receive_skb(skb); |
976 | netif_receive_skb(skb); | ||
977 | else | ||
978 | netif_rx_ni(skb); | ||
979 | 975 | ||
980 | /* update netdevice statistics */ | 976 | /* update netdevice statistics */ |
981 | card->netdev_stats.rx_packets++; | 977 | card->netdev_stats.rx_packets++; |
@@ -987,16 +983,15 @@ spider_net_pass_skb_up(struct spider_net_descr *descr, | |||
987 | /** | 983 | /** |
988 | * spider_net_decode_one_descr - processes an rx descriptor | 984 | * spider_net_decode_one_descr - processes an rx descriptor |
989 | * @card: card structure | 985 | * @card: card structure |
990 | * @napi: whether caller is in NAPI context | ||
991 | * | 986 | * |
992 | * returns 1 if a packet has been sent to the stack, otherwise 0 | 987 | * Returns 1 if a packet has been sent to the stack, otherwise 0 |
993 | * | 988 | * |
994 | * processes an rx descriptor by iommu-unmapping the data buffer and passing | 989 | * Processes an rx descriptor by iommu-unmapping the data buffer and passing |
995 | * the packet up to the stack. This function is called in softirq | 990 | * the packet up to the stack. This function is called in softirq |
996 | * context, e.g. either bottom half from interrupt or NAPI polling context | 991 | * context, e.g. either bottom half from interrupt or NAPI polling context |
997 | */ | 992 | */ |
998 | static int | 993 | static int |
999 | spider_net_decode_one_descr(struct spider_net_card *card, int napi) | 994 | spider_net_decode_one_descr(struct spider_net_card *card) |
1000 | { | 995 | { |
1001 | struct spider_net_descr_chain *chain = &card->rx_chain; | 996 | struct spider_net_descr_chain *chain = &card->rx_chain; |
1002 | struct spider_net_descr *descr = chain->tail; | 997 | struct spider_net_descr *descr = chain->tail; |
@@ -1005,18 +1000,15 @@ spider_net_decode_one_descr(struct spider_net_card *card, int napi) | |||
1005 | 1000 | ||
1006 | status = spider_net_get_descr_status(descr); | 1001 | status = spider_net_get_descr_status(descr); |
1007 | 1002 | ||
1008 | if (status == SPIDER_NET_DESCR_CARDOWNED) { | 1003 | /* nothing in the descriptor yet */ |
1009 | /* nothing in the descriptor yet */ | 1004 | if (status == SPIDER_NET_DESCR_CARDOWNED) |
1010 | result=0; | 1005 | return 0; |
1011 | goto out; | ||
1012 | } | ||
1013 | 1006 | ||
1014 | if (status == SPIDER_NET_DESCR_NOT_IN_USE) { | 1007 | if (status == SPIDER_NET_DESCR_NOT_IN_USE) { |
1015 | /* not initialized yet, the ring must be empty */ | 1008 | /* not initialized yet, the ring must be empty */ |
1016 | spider_net_refill_rx_chain(card); | 1009 | spider_net_refill_rx_chain(card); |
1017 | spider_net_enable_rxdmac(card); | 1010 | spider_net_enable_rxdmac(card); |
1018 | result=0; | 1011 | return 0; |
1019 | goto out; | ||
1020 | } | 1012 | } |
1021 | 1013 | ||
1022 | /* descriptor definitively used -- move on tail */ | 1014 | /* descriptor definitively used -- move on tail */ |
@@ -1046,13 +1038,10 @@ spider_net_decode_one_descr(struct spider_net_card *card, int napi) | |||
1046 | } | 1038 | } |
1047 | 1039 | ||
1048 | /* ok, we've got a packet in descr */ | 1040 | /* ok, we've got a packet in descr */ |
1049 | result = spider_net_pass_skb_up(descr, card, napi); | 1041 | result = spider_net_pass_skb_up(descr, card); |
1050 | refill: | 1042 | refill: |
1051 | descr->dmac_cmd_status = SPIDER_NET_DESCR_NOT_IN_USE; | ||
1052 | /* change the descriptor state: */ | 1043 | /* change the descriptor state: */ |
1053 | if (!napi) | 1044 | descr->dmac_cmd_status = SPIDER_NET_DESCR_NOT_IN_USE; |
1054 | spider_net_refill_rx_chain(card); | ||
1055 | out: | ||
1056 | return result; | 1045 | return result; |
1057 | } | 1046 | } |
1058 | 1047 | ||
@@ -1079,7 +1068,7 @@ spider_net_poll(struct net_device *netdev, int *budget) | |||
1079 | packets_to_do = min(*budget, netdev->quota); | 1068 | packets_to_do = min(*budget, netdev->quota); |
1080 | 1069 | ||
1081 | while (packets_to_do) { | 1070 | while (packets_to_do) { |
1082 | if (spider_net_decode_one_descr(card, 1)) { | 1071 | if (spider_net_decode_one_descr(card)) { |
1083 | packets_done++; | 1072 | packets_done++; |
1084 | packets_to_do--; | 1073 | packets_to_do--; |
1085 | } else { | 1074 | } else { |