aboutsummaryrefslogtreecommitdiffstats
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
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>
-rw-r--r--drivers/ieee1394/hosts.h16
-rw-r--r--drivers/ieee1394/ieee1394_transactions.c10
2 files changed, 16 insertions, 10 deletions
diff --git a/drivers/ieee1394/hosts.h b/drivers/ieee1394/hosts.h
index d1a47607cb89..9ddc6628e710 100644
--- a/drivers/ieee1394/hosts.h
+++ b/drivers/ieee1394/hosts.h
@@ -30,14 +30,14 @@ struct hpsb_host {
30 30
31 unsigned char iso_listen_count[64]; 31 unsigned char iso_listen_count[64];
32 32
33 int node_count; /* number of identified nodes on this bus */ 33 int node_count; /* number of identified nodes on this bus */
34 int selfid_count; /* total number of SelfIDs received */ 34 int selfid_count; /* total number of SelfIDs received */
35 int nodes_active; /* number of nodes with active link layer */ 35 int nodes_active; /* number of nodes with active link layer */
36 u8 speed[63]; /* speed between each node and local node */ 36 u8 speed[ALL_NODES]; /* speed between each node and local node */
37 37
38 nodeid_t node_id; /* node ID of this host */ 38 nodeid_t node_id; /* node ID of this host */
39 nodeid_t irm_id; /* ID of this bus' isochronous resource manager */ 39 nodeid_t irm_id; /* ID of this bus' isochronous resource manager */
40 nodeid_t busmgr_id; /* ID of this bus' bus manager */ 40 nodeid_t busmgr_id; /* ID of this bus' bus manager */
41 41
42 /* this nodes state */ 42 /* this nodes state */
43 unsigned in_bus_reset:1; 43 unsigned in_bus_reset:1;
@@ -56,7 +56,7 @@ struct hpsb_host {
56 struct csr_control csr; 56 struct csr_control csr;
57 57
58 /* Per node tlabel pool allocation */ 58 /* Per node tlabel pool allocation */
59 struct hpsb_tlabel_pool tpool[64]; 59 struct hpsb_tlabel_pool tpool[ALL_NODES];
60 60
61 struct hpsb_host_driver *driver; 61 struct hpsb_host_driver *driver;
62 62
diff --git a/drivers/ieee1394/ieee1394_transactions.c b/drivers/ieee1394/ieee1394_transactions.c
index 3fe2f6c4a253..a114b91d606d 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)
136{ 136{
137 unsigned long flags; 137 unsigned long flags;
138 struct hpsb_tlabel_pool *tp; 138 struct hpsb_tlabel_pool *tp;
139 int n = NODEID_TO_NODE(packet->node_id);
139 140
140 tp = &packet->host->tpool[packet->node_id & NODE_MASK]; 141 if (unlikely(n == ALL_NODES))
142 return 0;
143 tp = &packet->host->tpool[n];
141 144
142 if (irqs_disabled() || in_atomic()) { 145 if (irqs_disabled() || in_atomic()) {
143 if (down_trylock(&tp->count)) 146 if (down_trylock(&tp->count))
@@ -175,8 +178,11 @@ void hpsb_free_tlabel(struct hpsb_packet *packet)
175{ 178{
176 unsigned long flags; 179 unsigned long flags;
177 struct hpsb_tlabel_pool *tp; 180 struct hpsb_tlabel_pool *tp;
181 int n = NODEID_TO_NODE(packet->node_id);
178 182
179 tp = &packet->host->tpool[packet->node_id & NODE_MASK]; 183 if (unlikely(n == ALL_NODES))
184 return;
185 tp = &packet->host->tpool[n];
180 186
181 BUG_ON(packet->tlabel > 63 || packet->tlabel < 0); 187 BUG_ON(packet->tlabel > 63 || packet->tlabel < 0);
182 188