diff options
author | Bryan O'Sullivan <bos@pathscale.com> | 2006-07-01 07:36:11 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-07-01 12:56:01 -0400 |
commit | 1eb68b990aab4c007e520acae39c74d8116693bc (patch) | |
tree | 9e11f750a252879c22636048f68503b622cf2fbc | |
parent | 12eef41f8b72b6e11e36b48c78849c17e49781c8 (diff) |
[PATCH] IB/ipath: purge sps_lid and sps_mlid arrays
The two arrays only had space for 4 units.
Also changed from ipath_set_sps_lid() to ipath_set_lid(); the sps was
leftover.
Signed-off-by: Dave Olson <dave.olson@qlogic.com>
Signed-off-by: Bryan O'Sullivan <bryan.osullivan@qlogic.com>
Cc: "Michael S. Tsirkin" <mst@mellanox.co.il>
Cc: Roland Dreier <rolandd@cisco.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-rw-r--r-- | drivers/infiniband/hw/ipath/ipath_common.h | 7 | ||||
-rw-r--r-- | drivers/infiniband/hw/ipath/ipath_init_chip.c | 2 | ||||
-rw-r--r-- | drivers/infiniband/hw/ipath/ipath_layer.c | 9 | ||||
-rw-r--r-- | drivers/infiniband/hw/ipath/ipath_layer.h | 2 | ||||
-rw-r--r-- | drivers/infiniband/hw/ipath/ipath_mad.c | 2 | ||||
-rw-r--r-- | drivers/infiniband/hw/ipath/ipath_sysfs.c | 25 |
6 files changed, 11 insertions, 36 deletions
diff --git a/drivers/infiniband/hw/ipath/ipath_common.h b/drivers/infiniband/hw/ipath/ipath_common.h index 7a8a086a579a..106f8f49cbb1 100644 --- a/drivers/infiniband/hw/ipath/ipath_common.h +++ b/drivers/infiniband/hw/ipath/ipath_common.h | |||
@@ -122,8 +122,7 @@ struct infinipath_stats { | |||
122 | __u64 sps_ports; | 122 | __u64 sps_ports; |
123 | /* list of pkeys (other than default) accepted (0 means not set) */ | 123 | /* list of pkeys (other than default) accepted (0 means not set) */ |
124 | __u16 sps_pkeys[4]; | 124 | __u16 sps_pkeys[4]; |
125 | /* lids for up to 4 infinipaths, indexed by infinipath # */ | 125 | __u16 sps_unused16[4]; /* available; maintaining compatible layout */ |
126 | __u16 sps_lid[4]; | ||
127 | /* number of user ports per chip (not IB ports) */ | 126 | /* number of user ports per chip (not IB ports) */ |
128 | __u32 sps_nports; | 127 | __u32 sps_nports; |
129 | /* not our interrupt, or already handled */ | 128 | /* not our interrupt, or already handled */ |
@@ -141,10 +140,8 @@ struct infinipath_stats { | |||
141 | * packets if ipath not configured, sma/mad, etc.) | 140 | * packets if ipath not configured, sma/mad, etc.) |
142 | */ | 141 | */ |
143 | __u64 sps_krdrops; | 142 | __u64 sps_krdrops; |
144 | /* mlids for up to 4 infinipaths, indexed by infinipath # */ | ||
145 | __u16 sps_mlid[4]; | ||
146 | /* pad for future growth */ | 143 | /* pad for future growth */ |
147 | __u64 __sps_pad[45]; | 144 | __u64 __sps_pad[46]; |
148 | }; | 145 | }; |
149 | 146 | ||
150 | /* | 147 | /* |
diff --git a/drivers/infiniband/hw/ipath/ipath_init_chip.c b/drivers/infiniband/hw/ipath/ipath_init_chip.c index 385605f63f0f..9faa201abe8e 100644 --- a/drivers/infiniband/hw/ipath/ipath_init_chip.c +++ b/drivers/infiniband/hw/ipath/ipath_init_chip.c | |||
@@ -811,8 +811,6 @@ int ipath_init_chip(struct ipath_devdata *dd, int reinit) | |||
811 | /* clear any interrups up to this point (ints still not enabled) */ | 811 | /* clear any interrups up to this point (ints still not enabled) */ |
812 | ipath_write_kreg(dd, dd->ipath_kregs->kr_intclear, -1LL); | 812 | ipath_write_kreg(dd, dd->ipath_kregs->kr_intclear, -1LL); |
813 | 813 | ||
814 | ipath_stats.sps_lid[dd->ipath_unit] = dd->ipath_lid; | ||
815 | |||
816 | /* | 814 | /* |
817 | * Set up the port 0 (kernel) rcvhdr q and egr TIDs. If doing | 815 | * Set up the port 0 (kernel) rcvhdr q and egr TIDs. If doing |
818 | * re-init, the simplest way to handle this is to free | 816 | * re-init, the simplest way to handle this is to free |
diff --git a/drivers/infiniband/hw/ipath/ipath_layer.c b/drivers/infiniband/hw/ipath/ipath_layer.c index 6e3d9bf3354f..963942d7ef09 100644 --- a/drivers/infiniband/hw/ipath/ipath_layer.c +++ b/drivers/infiniband/hw/ipath/ipath_layer.c | |||
@@ -300,9 +300,8 @@ bail: | |||
300 | 300 | ||
301 | EXPORT_SYMBOL_GPL(ipath_layer_set_mtu); | 301 | EXPORT_SYMBOL_GPL(ipath_layer_set_mtu); |
302 | 302 | ||
303 | int ipath_set_sps_lid(struct ipath_devdata *dd, u32 arg, u8 lmc) | 303 | int ipath_set_lid(struct ipath_devdata *dd, u32 arg, u8 lmc) |
304 | { | 304 | { |
305 | ipath_stats.sps_lid[dd->ipath_unit] = arg; | ||
306 | dd->ipath_lid = arg; | 305 | dd->ipath_lid = arg; |
307 | dd->ipath_lmc = lmc; | 306 | dd->ipath_lmc = lmc; |
308 | 307 | ||
@@ -316,7 +315,7 @@ int ipath_set_sps_lid(struct ipath_devdata *dd, u32 arg, u8 lmc) | |||
316 | return 0; | 315 | return 0; |
317 | } | 316 | } |
318 | 317 | ||
319 | EXPORT_SYMBOL_GPL(ipath_set_sps_lid); | 318 | EXPORT_SYMBOL_GPL(ipath_set_lid); |
320 | 319 | ||
321 | int ipath_layer_set_guid(struct ipath_devdata *dd, __be64 guid) | 320 | int ipath_layer_set_guid(struct ipath_devdata *dd, __be64 guid) |
322 | { | 321 | { |
@@ -632,9 +631,9 @@ int ipath_layer_open(struct ipath_devdata *dd, u32 * pktmax) | |||
632 | 631 | ||
633 | if (*dd->ipath_statusp & IPATH_STATUS_IB_READY) | 632 | if (*dd->ipath_statusp & IPATH_STATUS_IB_READY) |
634 | intval |= IPATH_LAYER_INT_IF_UP; | 633 | intval |= IPATH_LAYER_INT_IF_UP; |
635 | if (ipath_stats.sps_lid[dd->ipath_unit]) | 634 | if (dd->ipath_lid) |
636 | intval |= IPATH_LAYER_INT_LID; | 635 | intval |= IPATH_LAYER_INT_LID; |
637 | if (ipath_stats.sps_mlid[dd->ipath_unit]) | 636 | if (dd->ipath_mlid) |
638 | intval |= IPATH_LAYER_INT_BCAST; | 637 | intval |= IPATH_LAYER_INT_BCAST; |
639 | /* | 638 | /* |
640 | * do this on open, in case low level is already up and | 639 | * do this on open, in case low level is already up and |
diff --git a/drivers/infiniband/hw/ipath/ipath_layer.h b/drivers/infiniband/hw/ipath/ipath_layer.h index ee617e851a4d..71485096fcac 100644 --- a/drivers/infiniband/hw/ipath/ipath_layer.h +++ b/drivers/infiniband/hw/ipath/ipath_layer.h | |||
@@ -129,7 +129,7 @@ u16 ipath_layer_get_bcast(struct ipath_devdata *dd); | |||
129 | u32 ipath_layer_get_cr_errpkey(struct ipath_devdata *dd); | 129 | u32 ipath_layer_get_cr_errpkey(struct ipath_devdata *dd); |
130 | int ipath_layer_set_linkstate(struct ipath_devdata *dd, u8 state); | 130 | int ipath_layer_set_linkstate(struct ipath_devdata *dd, u8 state); |
131 | int ipath_layer_set_mtu(struct ipath_devdata *, u16); | 131 | int ipath_layer_set_mtu(struct ipath_devdata *, u16); |
132 | int ipath_set_sps_lid(struct ipath_devdata *, u32, u8); | 132 | int ipath_set_lid(struct ipath_devdata *, u32, u8); |
133 | int ipath_layer_send_hdr(struct ipath_devdata *dd, | 133 | int ipath_layer_send_hdr(struct ipath_devdata *dd, |
134 | struct ether_header *hdr); | 134 | struct ether_header *hdr); |
135 | int ipath_verbs_send(struct ipath_devdata *dd, u32 hdrwords, | 135 | int ipath_verbs_send(struct ipath_devdata *dd, u32 hdrwords, |
diff --git a/drivers/infiniband/hw/ipath/ipath_mad.c b/drivers/infiniband/hw/ipath/ipath_mad.c index 95756924ecd2..195f82e136e4 100644 --- a/drivers/infiniband/hw/ipath/ipath_mad.c +++ b/drivers/infiniband/hw/ipath/ipath_mad.c | |||
@@ -308,7 +308,7 @@ static int recv_subn_set_portinfo(struct ib_smp *smp, | |||
308 | /* Must be a valid unicast LID address. */ | 308 | /* Must be a valid unicast LID address. */ |
309 | if (lid == 0 || lid >= IPS_MULTICAST_LID_BASE) | 309 | if (lid == 0 || lid >= IPS_MULTICAST_LID_BASE) |
310 | goto err; | 310 | goto err; |
311 | ipath_set_sps_lid(dev->dd, lid, pip->mkeyprot_resv_lmc & 7); | 311 | ipath_set_lid(dev->dd, lid, pip->mkeyprot_resv_lmc & 7); |
312 | event.event = IB_EVENT_LID_CHANGE; | 312 | event.event = IB_EVENT_LID_CHANGE; |
313 | ib_dispatch_event(&event); | 313 | ib_dispatch_event(&event); |
314 | } | 314 | } |
diff --git a/drivers/infiniband/hw/ipath/ipath_sysfs.c b/drivers/infiniband/hw/ipath/ipath_sysfs.c index ccff629278a4..59694f1ef3ad 100644 --- a/drivers/infiniband/hw/ipath/ipath_sysfs.c +++ b/drivers/infiniband/hw/ipath/ipath_sysfs.c | |||
@@ -115,11 +115,6 @@ DRIVER_STAT(pkey0, pkeys[0]); | |||
115 | DRIVER_STAT(pkey1, pkeys[1]); | 115 | DRIVER_STAT(pkey1, pkeys[1]); |
116 | DRIVER_STAT(pkey2, pkeys[2]); | 116 | DRIVER_STAT(pkey2, pkeys[2]); |
117 | DRIVER_STAT(pkey3, pkeys[3]); | 117 | DRIVER_STAT(pkey3, pkeys[3]); |
118 | /* XXX fix the following when dynamic table of devices used */ | ||
119 | DRIVER_STAT(lid0, lid[0]); | ||
120 | DRIVER_STAT(lid1, lid[1]); | ||
121 | DRIVER_STAT(lid2, lid[2]); | ||
122 | DRIVER_STAT(lid3, lid[3]); | ||
123 | 118 | ||
124 | DRIVER_STAT(nports, nports); | 119 | DRIVER_STAT(nports, nports); |
125 | DRIVER_STAT(null_intr, nullintr); | 120 | DRIVER_STAT(null_intr, nullintr); |
@@ -128,11 +123,6 @@ DRIVER_STAT(avg_pkts_call, avgpkts_call); | |||
128 | DRIVER_STAT(page_locks, pagelocks); | 123 | DRIVER_STAT(page_locks, pagelocks); |
129 | DRIVER_STAT(page_unlocks, pageunlocks); | 124 | DRIVER_STAT(page_unlocks, pageunlocks); |
130 | DRIVER_STAT(krdrops, krdrops); | 125 | DRIVER_STAT(krdrops, krdrops); |
131 | /* XXX fix the following when dynamic table of devices used */ | ||
132 | DRIVER_STAT(mlid0, mlid[0]); | ||
133 | DRIVER_STAT(mlid1, mlid[1]); | ||
134 | DRIVER_STAT(mlid2, mlid[2]); | ||
135 | DRIVER_STAT(mlid3, mlid[3]); | ||
136 | 126 | ||
137 | static struct attribute *driver_stat_attributes[] = { | 127 | static struct attribute *driver_stat_attributes[] = { |
138 | &driver_attr_intrs.attr, | 128 | &driver_attr_intrs.attr, |
@@ -155,10 +145,6 @@ static struct attribute *driver_stat_attributes[] = { | |||
155 | &driver_attr_pkey1.attr, | 145 | &driver_attr_pkey1.attr, |
156 | &driver_attr_pkey2.attr, | 146 | &driver_attr_pkey2.attr, |
157 | &driver_attr_pkey3.attr, | 147 | &driver_attr_pkey3.attr, |
158 | &driver_attr_lid0.attr, | ||
159 | &driver_attr_lid1.attr, | ||
160 | &driver_attr_lid2.attr, | ||
161 | &driver_attr_lid3.attr, | ||
162 | &driver_attr_nports.attr, | 148 | &driver_attr_nports.attr, |
163 | &driver_attr_null_intr.attr, | 149 | &driver_attr_null_intr.attr, |
164 | &driver_attr_max_pkts_call.attr, | 150 | &driver_attr_max_pkts_call.attr, |
@@ -166,10 +152,6 @@ static struct attribute *driver_stat_attributes[] = { | |||
166 | &driver_attr_page_locks.attr, | 152 | &driver_attr_page_locks.attr, |
167 | &driver_attr_page_unlocks.attr, | 153 | &driver_attr_page_unlocks.attr, |
168 | &driver_attr_krdrops.attr, | 154 | &driver_attr_krdrops.attr, |
169 | &driver_attr_mlid0.attr, | ||
170 | &driver_attr_mlid1.attr, | ||
171 | &driver_attr_mlid2.attr, | ||
172 | &driver_attr_mlid3.attr, | ||
173 | NULL | 155 | NULL |
174 | }; | 156 | }; |
175 | 157 | ||
@@ -273,7 +255,7 @@ static ssize_t store_lid(struct device *dev, | |||
273 | size_t count) | 255 | size_t count) |
274 | { | 256 | { |
275 | struct ipath_devdata *dd = dev_get_drvdata(dev); | 257 | struct ipath_devdata *dd = dev_get_drvdata(dev); |
276 | u16 lid; | 258 | u16 lid = 0; |
277 | int ret; | 259 | int ret; |
278 | 260 | ||
279 | ret = ipath_parse_ushort(buf, &lid); | 261 | ret = ipath_parse_ushort(buf, &lid); |
@@ -285,11 +267,11 @@ static ssize_t store_lid(struct device *dev, | |||
285 | goto invalid; | 267 | goto invalid; |
286 | } | 268 | } |
287 | 269 | ||
288 | ipath_set_sps_lid(dd, lid, 0); | 270 | ipath_set_lid(dd, lid, 0); |
289 | 271 | ||
290 | goto bail; | 272 | goto bail; |
291 | invalid: | 273 | invalid: |
292 | ipath_dev_err(dd, "attempt to set invalid LID\n"); | 274 | ipath_dev_err(dd, "attempt to set invalid LID 0x%x\n", lid); |
293 | bail: | 275 | bail: |
294 | return ret; | 276 | return ret; |
295 | } | 277 | } |
@@ -320,7 +302,6 @@ static ssize_t store_mlid(struct device *dev, | |||
320 | unit = dd->ipath_unit; | 302 | unit = dd->ipath_unit; |
321 | 303 | ||
322 | dd->ipath_mlid = mlid; | 304 | dd->ipath_mlid = mlid; |
323 | ipath_stats.sps_mlid[unit] = mlid; | ||
324 | ipath_layer_intr(dd, IPATH_LAYER_INT_BCAST); | 305 | ipath_layer_intr(dd, IPATH_LAYER_INT_BCAST); |
325 | 306 | ||
326 | goto bail; | 307 | goto bail; |