[ofa-general] [PATCH] ibsim: Remove some unused routines

Hal Rosenstock hrosenstock at xsigo.com
Tue Jun 10 14:39:34 PDT 2008


ibsim: Remove some unused routines

Signed-off-by: Hal Rosenstock <hal at xsigo.com>

diff --git a/umad2sim/sim_client.c b/umad2sim/sim_client.c
index 32c45b0..644766e
--- a/umad2sim/sim_client.c
+++ b/umad2sim/sim_client.c
@@ -61,41 +61,6 @@
 
 static unsigned int remote_mode = 0;
 
-int sim_client_recv_packet(struct sim_client *sc, void *buf, int size)
-{
-	int len, ret, cnt;
-
-	if (size < sizeof(struct sim_request)) {
-		LOG("buffer too small %d < %zu", size,
-		    sizeof(struct sim_request));
-		return -1;
-	}
-
-	ret = 0;
-	len = sizeof(struct sim_request);
-	while (len > 0) {
-		cnt = read(sc->fd_pktin, buf + ret, len);
-		if (cnt < 0) {
-			LOG("sim_client_recv_packet: read(%d) failed (%m)",
-			    size);
-			return -1;
-		} else if (cnt == 0)
-			return ret;
-		len -= cnt;
-		ret += cnt;
-	}
-
-	return size;
-}
-
-int sim_client_send_packet(struct sim_client *sc, char *p, int size)
-{
-	if (write(sc->fd_pktout, p, size) == size)
-		return 0;
-	IBWARN("write failed: %m");
-	return -1;
-}
-
 static int sim_ctl(struct sim_client *sc, int type, void *data, int len)
 {
 	struct sim_ctl ctl;
diff --git a/umad2sim/sim_client.h b/umad2sim/sim_client.h
index ffabcf2..605b305
--- a/umad2sim/sim_client.h
+++ b/umad2sim/sim_client.h
@@ -46,8 +46,6 @@ struct sim_client {
 	uint16_t pkeys[SIM_CTL_MAX_DATA/sizeof(uint16_t)];
 };
 
-extern int sim_client_send_packet(struct sim_client *sc, char *p, int size);
-extern int sim_client_recv_packet(struct sim_client *sc, void *buf, int size);
 extern int sim_client_set_sm(struct sim_client *sc, unsigned issm);
 extern int sim_client_init(struct sim_client *sc, char *nodeid);
 extern void sim_client_exit(struct sim_client *sc);





More information about the general mailing list