diff options
Diffstat (limited to 'drivers/infiniband/hw/ipath/ipath_verbs.c')
-rw-r--r-- | drivers/infiniband/hw/ipath/ipath_verbs.c | 118 |
1 files changed, 59 insertions, 59 deletions
diff --git a/drivers/infiniband/hw/ipath/ipath_verbs.c b/drivers/infiniband/hw/ipath/ipath_verbs.c index 9f27fd35cdbb..8d2558a01f35 100644 --- a/drivers/infiniband/hw/ipath/ipath_verbs.c +++ b/drivers/infiniband/hw/ipath/ipath_verbs.c | |||
@@ -41,7 +41,7 @@ | |||
41 | /* Not static, because we don't want the compiler removing it */ | 41 | /* Not static, because we don't want the compiler removing it */ |
42 | const char ipath_verbs_version[] = "ipath_verbs " IPATH_IDSTR; | 42 | const char ipath_verbs_version[] = "ipath_verbs " IPATH_IDSTR; |
43 | 43 | ||
44 | unsigned int ib_ipath_qp_table_size = 251; | 44 | static unsigned int ib_ipath_qp_table_size = 251; |
45 | module_param_named(qp_table_size, ib_ipath_qp_table_size, uint, S_IRUGO); | 45 | module_param_named(qp_table_size, ib_ipath_qp_table_size, uint, S_IRUGO); |
46 | MODULE_PARM_DESC(qp_table_size, "QP table size"); | 46 | MODULE_PARM_DESC(qp_table_size, "QP table size"); |
47 | 47 | ||
@@ -87,7 +87,7 @@ const enum ib_wc_opcode ib_ipath_wc_opcode[] = { | |||
87 | /* | 87 | /* |
88 | * System image GUID. | 88 | * System image GUID. |
89 | */ | 89 | */ |
90 | __be64 sys_image_guid; | 90 | static __be64 sys_image_guid; |
91 | 91 | ||
92 | /** | 92 | /** |
93 | * ipath_copy_sge - copy data to SGE memory | 93 | * ipath_copy_sge - copy data to SGE memory |
@@ -1110,7 +1110,7 @@ static void ipath_unregister_ib_device(void *arg) | |||
1110 | ib_dealloc_device(ibdev); | 1110 | ib_dealloc_device(ibdev); |
1111 | } | 1111 | } |
1112 | 1112 | ||
1113 | int __init ipath_verbs_init(void) | 1113 | static int __init ipath_verbs_init(void) |
1114 | { | 1114 | { |
1115 | return ipath_verbs_register(ipath_register_ib_device, | 1115 | return ipath_verbs_register(ipath_register_ib_device, |
1116 | ipath_unregister_ib_device, | 1116 | ipath_unregister_ib_device, |
@@ -1118,33 +1118,33 @@ int __init ipath_verbs_init(void) | |||
1118 | ipath_ib_timer); | 1118 | ipath_ib_timer); |
1119 | } | 1119 | } |
1120 | 1120 | ||
1121 | void __exit ipath_verbs_cleanup(void) | 1121 | static void __exit ipath_verbs_cleanup(void) |
1122 | { | 1122 | { |
1123 | ipath_verbs_unregister(); | 1123 | ipath_verbs_unregister(); |
1124 | } | 1124 | } |
1125 | 1125 | ||
1126 | static ssize_t show_rev(struct class_device *cdev, char *buf) | 1126 | static ssize_t show_rev(struct class_device *cdev, char *buf) |
1127 | { | 1127 | { |
1128 | struct ipath_ibdev *dev = | 1128 | struct ipath_ibdev *dev = |
1129 | container_of(cdev, struct ipath_ibdev, ibdev.class_dev); | 1129 | container_of(cdev, struct ipath_ibdev, ibdev.class_dev); |
1130 | int vendor, boardrev, majrev, minrev; | 1130 | int vendor, boardrev, majrev, minrev; |
1131 | 1131 | ||
1132 | ipath_layer_query_device(dev->dd, &vendor, &boardrev, | 1132 | ipath_layer_query_device(dev->dd, &vendor, &boardrev, |
1133 | &majrev, &minrev); | 1133 | &majrev, &minrev); |
1134 | return sprintf(buf, "%d.%d\n", majrev, minrev); | 1134 | return sprintf(buf, "%d.%d\n", majrev, minrev); |
1135 | } | 1135 | } |
1136 | 1136 | ||
1137 | static ssize_t show_hca(struct class_device *cdev, char *buf) | 1137 | static ssize_t show_hca(struct class_device *cdev, char *buf) |
1138 | { | 1138 | { |
1139 | struct ipath_ibdev *dev = | 1139 | struct ipath_ibdev *dev = |
1140 | container_of(cdev, struct ipath_ibdev, ibdev.class_dev); | 1140 | container_of(cdev, struct ipath_ibdev, ibdev.class_dev); |
1141 | int ret; | 1141 | int ret; |
1142 | 1142 | ||
1143 | ret = ipath_layer_get_boardname(dev->dd, buf, 128); | 1143 | ret = ipath_layer_get_boardname(dev->dd, buf, 128); |
1144 | if (ret < 0) | 1144 | if (ret < 0) |
1145 | goto bail; | 1145 | goto bail; |
1146 | strcat(buf, "\n"); | 1146 | strcat(buf, "\n"); |
1147 | ret = strlen(buf); | 1147 | ret = strlen(buf); |
1148 | 1148 | ||
1149 | bail: | 1149 | bail: |
1150 | return ret; | 1150 | return ret; |
@@ -1152,40 +1152,40 @@ bail: | |||
1152 | 1152 | ||
1153 | static ssize_t show_stats(struct class_device *cdev, char *buf) | 1153 | static ssize_t show_stats(struct class_device *cdev, char *buf) |
1154 | { | 1154 | { |
1155 | struct ipath_ibdev *dev = | 1155 | struct ipath_ibdev *dev = |
1156 | container_of(cdev, struct ipath_ibdev, ibdev.class_dev); | 1156 | container_of(cdev, struct ipath_ibdev, ibdev.class_dev); |
1157 | int i; | 1157 | int i; |
1158 | int len; | 1158 | int len; |
1159 | 1159 | ||
1160 | len = sprintf(buf, | 1160 | len = sprintf(buf, |
1161 | "RC resends %d\n" | 1161 | "RC resends %d\n" |
1162 | "RC QACKs %d\n" | 1162 | "RC QACKs %d\n" |
1163 | "RC ACKs %d\n" | 1163 | "RC ACKs %d\n" |
1164 | "RC SEQ NAKs %d\n" | 1164 | "RC SEQ NAKs %d\n" |
1165 | "RC RDMA seq %d\n" | 1165 | "RC RDMA seq %d\n" |
1166 | "RC RNR NAKs %d\n" | 1166 | "RC RNR NAKs %d\n" |
1167 | "RC OTH NAKs %d\n" | 1167 | "RC OTH NAKs %d\n" |
1168 | "RC timeouts %d\n" | 1168 | "RC timeouts %d\n" |
1169 | "RC RDMA dup %d\n" | 1169 | "RC RDMA dup %d\n" |
1170 | "piobuf wait %d\n" | 1170 | "piobuf wait %d\n" |
1171 | "no piobuf %d\n" | 1171 | "no piobuf %d\n" |
1172 | "PKT drops %d\n" | 1172 | "PKT drops %d\n" |
1173 | "WQE errs %d\n", | 1173 | "WQE errs %d\n", |
1174 | dev->n_rc_resends, dev->n_rc_qacks, dev->n_rc_acks, | 1174 | dev->n_rc_resends, dev->n_rc_qacks, dev->n_rc_acks, |
1175 | dev->n_seq_naks, dev->n_rdma_seq, dev->n_rnr_naks, | 1175 | dev->n_seq_naks, dev->n_rdma_seq, dev->n_rnr_naks, |
1176 | dev->n_other_naks, dev->n_timeouts, | 1176 | dev->n_other_naks, dev->n_timeouts, |
1177 | dev->n_rdma_dup_busy, dev->n_piowait, | 1177 | dev->n_rdma_dup_busy, dev->n_piowait, |
1178 | dev->n_no_piobuf, dev->n_pkt_drops, dev->n_wqe_errs); | 1178 | dev->n_no_piobuf, dev->n_pkt_drops, dev->n_wqe_errs); |
1179 | for (i = 0; i < ARRAY_SIZE(dev->opstats); i++) { | 1179 | for (i = 0; i < ARRAY_SIZE(dev->opstats); i++) { |
1180 | const struct ipath_opcode_stats *si = &dev->opstats[i]; | 1180 | const struct ipath_opcode_stats *si = &dev->opstats[i]; |
1181 | 1181 | ||
1182 | if (!si->n_packets && !si->n_bytes) | 1182 | if (!si->n_packets && !si->n_bytes) |
1183 | continue; | 1183 | continue; |
1184 | len += sprintf(buf + len, "%02x %llu/%llu\n", i, | 1184 | len += sprintf(buf + len, "%02x %llu/%llu\n", i, |
1185 | (unsigned long long) si->n_packets, | 1185 | (unsigned long long) si->n_packets, |
1186 | (unsigned long long) si->n_bytes); | 1186 | (unsigned long long) si->n_bytes); |
1187 | } | 1187 | } |
1188 | return len; | 1188 | return len; |
1189 | } | 1189 | } |
1190 | 1190 | ||
1191 | static CLASS_DEVICE_ATTR(hw_rev, S_IRUGO, show_rev, NULL); | 1191 | static CLASS_DEVICE_ATTR(hw_rev, S_IRUGO, show_rev, NULL); |
@@ -1194,25 +1194,25 @@ static CLASS_DEVICE_ATTR(board_id, S_IRUGO, show_hca, NULL); | |||
1194 | static CLASS_DEVICE_ATTR(stats, S_IRUGO, show_stats, NULL); | 1194 | static CLASS_DEVICE_ATTR(stats, S_IRUGO, show_stats, NULL); |
1195 | 1195 | ||
1196 | static struct class_device_attribute *ipath_class_attributes[] = { | 1196 | static struct class_device_attribute *ipath_class_attributes[] = { |
1197 | &class_device_attr_hw_rev, | 1197 | &class_device_attr_hw_rev, |
1198 | &class_device_attr_hca_type, | 1198 | &class_device_attr_hca_type, |
1199 | &class_device_attr_board_id, | 1199 | &class_device_attr_board_id, |
1200 | &class_device_attr_stats | 1200 | &class_device_attr_stats |
1201 | }; | 1201 | }; |
1202 | 1202 | ||
1203 | static int ipath_verbs_register_sysfs(struct ib_device *dev) | 1203 | static int ipath_verbs_register_sysfs(struct ib_device *dev) |
1204 | { | 1204 | { |
1205 | int i; | 1205 | int i; |
1206 | int ret; | 1206 | int ret; |
1207 | 1207 | ||
1208 | for (i = 0; i < ARRAY_SIZE(ipath_class_attributes); ++i) | 1208 | for (i = 0; i < ARRAY_SIZE(ipath_class_attributes); ++i) |
1209 | if (class_device_create_file(&dev->class_dev, | 1209 | if (class_device_create_file(&dev->class_dev, |
1210 | ipath_class_attributes[i])) { | 1210 | ipath_class_attributes[i])) { |
1211 | ret = 1; | 1211 | ret = 1; |
1212 | goto bail; | 1212 | goto bail; |
1213 | } | 1213 | } |
1214 | 1214 | ||
1215 | ret = 0; | 1215 | ret = 0; |
1216 | 1216 | ||
1217 | bail: | 1217 | bail: |
1218 | return ret; | 1218 | return ret; |