linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* "ressource temporarily unavailable" on 2.4 GHz, not on 5GHz
@ 2010-06-16 14:05 Dennis Borgmann
  2010-06-16 14:21 ` John W. Linville
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Dennis Borgmann @ 2010-06-16 14:05 UTC (permalink / raw)
  To: linux-wireless, hostap

[-- Attachment #1: Type: text/plain, Size: 717 bytes --]

Hello wireless-list!
Hello hostapd-list!

I am using ath5k with hostapd-0.6.9 on a debian running kernel 2.6.34
and I am observing a "ressource temporarily unavailable" - error code 11
if I pump out multicast-packets quite fast. I wrote a small
test-program, that handles this test and as soon as I go down to a
8ms-pause or below in betweens the packets, the error is thrown quite
soon after starting the program. Funny thing is, that this error only
occurs in g-band (2.4 GHz), not in a-band (5GHz).

What could be the problem? Is this due to backoff-times in 2.4 GHz, that
don't occur on 5 GHz? Or could this be a bug?

Find attached my small piece of code to test and reproduce this effect.

Kind regards,
Dennis

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: connection_test_multicast.c --]
[-- Type: text/x-csrc; name="connection_test_multicast.c", Size: 2300 bytes --]

#include <sys/types.h>          /* See NOTES */
#include <sys/socket.h>
#include <stdio.h>
#include <netinet/in.h>
#include <arpa/inet.h>     
#include <errno.h>
#include <linux/ip.h>
#include <string.h>
#include <stdlib.h>
#define MULTICAST_IP			"224.0.0.1"
#define PORT				12345
    
struct sockaddr_in server_address;
int fd_socket;

int init_connection_client( void ) {
	int sock, opt;

	errno = 0;
	//create a socket
	sock = socket( PF_INET, SOCK_DGRAM, 0 );
	if( sock == -1 ) {
		printf("%s:%u socket() error (%s), error-code: %d\n", __FILE__, __LINE__, strerror(errno), sock);
		exit(EXIT_FAILURE);
	}
	server_address.sin_family = PF_INET;
	server_address.sin_addr.s_addr = inet_addr( MULTICAST_IP );
	server_address.sin_port = htons( PORT );

	if( bind( sock, (struct sockaddr*)&server_address, sizeof(struct sockaddr)) == -1 ) {
		printf("%s:%u bind error (%s), error-code: %d\n", __FILE__, __LINE__, strerror(errno), errno);
		exit(EXIT_FAILURE);
	}
	//set socket options
	//IPTOS = type of service and precedence
	//IPTOS_LOWDELAY = minimize delay
	//IPTOS_PREC_PRIORITY = 
	opt = IPTOS_PREC_PRIORITY | IPTOS_LOWDELAY;
	if( setsockopt( sock, IPPROTO_IP, IP_TOS, &opt, sizeof(opt)) == -1 ) {
		printf("%s:%u setsockopt(IP_TOS) error (%s), error-code: %d\n", __FILE__, __LINE__, strerror(errno), errno);
		exit(EXIT_FAILURE);
	}
	//give these packets the maximum priority
	//SOL_SOCKET = manipulate at socket level
	opt = 7;
	if( setsockopt( sock, SOL_SOCKET, SO_PRIORITY, &opt, sizeof(opt)) == -1 ) {
		printf("%s:%u setsockopt(SO_PRIORITY) error (%s), error-code: %d\n", __FILE__, __LINE__, strerror(errno), errno);
		exit(EXIT_FAILURE);
	}

	return sock;
}
int send_data( unsigned char *network_data, size_t len ) {
	if( sendto( fd_socket, network_data, len, MSG_DONTWAIT, \
		(struct sockaddr*)&server_address, sizeof(struct sockaddr_in) ) == -1 ) {
			printf("%s:%u sendto() error (%s), error-code: %d\n", __FILE__, __LINE__, strerror(errno), errno);
			return errno;
	}

	return 0;
}

int main(int argc, char **argv) {
  unsigned char *data_for_transmission;
  int sleeper=atoi(argv[1]);
  printf("%d\n",sleeper);
  data_for_transmission = malloc( 1068 );
  fd_socket=init_connection_client();
  while(1) {
	send_data( data_for_transmission, 1068 ); 
	usleep(sleeper);
  }
 return 0;
}

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2010-06-17 14:38 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-06-16 14:05 "ressource temporarily unavailable" on 2.4 GHz, not on 5GHz Dennis Borgmann
2010-06-16 14:21 ` John W. Linville
2010-06-16 14:23 ` John W. Linville
2010-06-16 14:38 ` Bob Copeland
2010-06-17 12:13   ` Dennis Borgmann
2010-06-17 14:38     ` Dennis Borgmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).