aboutsummaryrefslogtreecommitdiff
path: root/drivers/ieee1394/ieee1394_transactions.c
diff options
context:
space:
mode:
authorBen Collins <bcollins@ubuntu.com>2006-06-12 18:12:49 -0400
committerBen Collins <bcollins@ubuntu.com>2006-06-12 18:12:49 -0400
commiteaf88450d21fc839c3e77fa6942b8d4192bdfe53 (patch)
tree5684c02796ac92f1283c06bd9179f5730a32632d /drivers/ieee1394/ieee1394_transactions.c
parent647dcb5fae0ebb5da1272ed2773df0d3f152c303 (diff)
ieee1394: save RAM by using a single tlabel for broadcast transactions
Since broadcast transactions are already complete when the request has been sent, the same transaction label can be reused all over again, see IEEE 1394 7.3.2.5 and 6.2.4.3. Therefore we can reduce the footprint of struct hpsb_host by the size of one struct hpsb_tlabel_pool. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de> Signed-off-by: Ben Collins <bcollins@ubuntu.com>
Diffstat (limited to 'drivers/ieee1394/ieee1394_transactions.c')
-rw-r--r--drivers/ieee1394/ieee1394_transactions.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/ieee1394/ieee1394_transactions.c b/drivers/ieee1394/ieee1394_transactions.c
index 3fe2f6c4a25..a114b91d606 100644
--- a/drivers/ieee1394/ieee1394_transactions.c
+++ b/drivers/ieee1394/ieee1394_transactions.c
@@ -136,8 +136,11 @@ int hpsb_get_tlabel(struct hpsb_packet *packet)
{
unsigned long flags;
struct hpsb_tlabel_pool *tp;
+ int n = NODEID_TO_NODE(packet->node_id);
- tp = &packet->host->tpool[packet->node_id & NODE_MASK];
+ if (unlikely(n == ALL_NODES))
+ return 0;
+ tp = &packet->host->tpool[n];
if (irqs_disabled() || in_atomic()) {
if (down_trylock(&tp->count))
@@ -175,8 +178,11 @@ void hpsb_free_tlabel(struct hpsb_packet *packet)
{
unsigned long flags;
struct hpsb_tlabel_pool *tp;
+ int n = NODEID_TO_NODE(packet->node_id);
- tp = &packet->host->tpool[packet->node_id & NODE_MASK];
+ if (unlikely(n == ALL_NODES))
+ return;
+ tp = &packet->host->tpool[n];
BUG_ON(packet->tlabel > 63 || packet->tlabel < 0);