Exemple #1
0
void netpoll_wrapper_send_reply(struct netpoll_wrapper *pWrapper, const void *pData, int dataSize)
{
	BUG_ON(!pWrapper);
	BUG_ON(!pData);

	netpoll_send_udp(&pWrapper->netpoll_obj, pData, dataSize);
}
static void eth_flush_buf(void)
{
	if (out_count && np.dev) {
		netpoll_send_udp(&np, out_buf, out_count);
		memset(out_buf, 0, sizeof(out_buf));
		out_count = 0;
	}
}
/* 
 * Function to send the UDP packet 
 * Called from the read.c
 */
void send_udp(const char* buf)
{
        struct task_struct *task = current;
        
	char send_buf[50]; //size of the send buf
	sprintf(send_buf, "%d", task->pid);
        
	int len1 = strlen(send_buf);
        sprintf(send_buf+len1," = "); //Format the output
        
	int len2 = strlen(send_buf);        
	strcpy(send_buf+len2, buf);
        
	int send_len = strlen(send_buf);
        
	netpoll_send_udp(np,send_buf,send_len);
}
Exemple #4
0
static void write_msg(struct console *con, const char *msg, unsigned int len)
{
	int frag, left;
	unsigned long flags;

	if (!np.dev)
		return;

	local_irq_save(flags);

	for(left = len; left; ) {
		frag = min(left, MAX_PRINT_CHUNK);
		netpoll_send_udp(&np, msg, frag);
		msg += frag;
		left -= frag;
	}

	local_irq_restore(flags);
}
Exemple #5
0
static void send_netdump_msg(struct netpoll *np, const char *msg, unsigned int msg_len, reply_t *reply)
{
	/* max len should be 1024 + HEADER_LEN */
	static unsigned char netpoll_msg[MAX_MSG_LEN + 1];

	if (msg_len + HEADER_LEN > MAX_MSG_LEN + 1) {
		printk("CODER ERROR!!! msg_len %ud too big for send msg\n",
		       msg_len);
		for (;;) local_irq_disable();
		/* NOTREACHED */
	}

	netpoll_msg[0] = effective_version;
	put_unaligned(htonl(reply->nr), (u32 *) (&netpoll_msg[1]));
	put_unaligned(htonl(reply->code), (u32 *) (&netpoll_msg[5]));
	put_unaligned(htonl(reply->info), (u32 *) (&netpoll_msg[9]));
	memcpy(&netpoll_msg[HEADER_LEN], msg, msg_len);

	netpoll_send_udp(np, netpoll_msg, HEADER_LEN + msg_len);
}
Exemple #6
0
static void eth_flushDebugChar(void)
{
#ifdef CONFIG_PREEMPT_RT
	/*
	 * A bit hairy. Netpoll API users uses mutexes (indirectly) and
	 * thus must have interrupts enabled:
	 */
	local_irq_enable();
#endif

	if (out_count && np.dev) {
		WARN_ON_RT(irqs_disabled());
		netpoll_send_udp(&np, out_buf, out_count);
		WARN_ON_RT(irqs_disabled());
		memset(out_buf, 0, sizeof(out_buf));
		out_count = 0;
	}
#ifdef CONFIG_PREEMPT_RT
	local_irq_disable();
#endif
}
Exemple #7
0
static void QS_send(uint8_t const *block, uint16_t nBytes)
{
	if (np.dev && nBytes)
		netpoll_send_udp(&np, block, nBytes);
}