Another FIX for gethostbyname if CONFIG_NETDB_DNSCLIENT is not defined
This commit is contained in:
parent
05a2c82409
commit
8b9cafe70a
|
@ -245,11 +245,11 @@
|
|||
#define ETH_MACMIIAR_MW (1 << 1) /* Bit 1: MII write */
|
||||
#define ETH_MACMIIAR_CR_SHIFT (2) /* Bits 2-4: Clock range */
|
||||
#define ETH_MACMIIAR_CR_MASK (7 << ETH_MACMIIAR_CR_SHIFT)
|
||||
# define ETH_MACMIIAR_CR_60_100 (0 << ETH_MACMIIAR_CR_SHIFT) /* 000 60-100 MHz HCLK/42 */
|
||||
# define ETH_MACMIIAR_CR_100_150 (1 << ETH_MACMIIAR_CR_SHIFT) /* 001 100-150 MHz HCLK/62 */
|
||||
# define ETH_MACMIIAR_CR_20_35 (2 << ETH_MACMIIAR_CR_SHIFT) /* 010 20-35 MHz HCLK/16 */
|
||||
# define ETH_MACMIIAR_CR_35_60 (3 << ETH_MACMIIAR_CR_SHIFT) /* 011 35-60 MHz HCLK/26 */
|
||||
# define ETH_MACMIIAR_CR_150_180 (4 << ETH_MACMIIAR_CR_SHIFT) /* 100 150-180 MHz HCLK/102 */
|
||||
# define ETH_MACMIIAR_CR_DIV42 (0 << ETH_MACMIIAR_CR_SHIFT) /* 60-100 MHz HCLK/42 */
|
||||
# define ETH_MACMIIAR_CR_DIV62 (1 << ETH_MACMIIAR_CR_SHIFT) /* 100-150 MHz HCLK/62 */
|
||||
# define ETH_MACMIIAR_CR_DIV16 (2 << ETH_MACMIIAR_CR_SHIFT) /* 20-35 MHz HCLK/16 */
|
||||
# define ETH_MACMIIAR_CR_DIV26 (3 << ETH_MACMIIAR_CR_SHIFT) /* 35-60 MHz HCLK/26 */
|
||||
# define ETH_MACMIIAR_CR_DIV102 (4 << ETH_MACMIIAR_CR_SHIFT) /* 150-216 MHz HCLK/102 */
|
||||
#define ETH_MACMIIAR_MR_SHIFT (6) /* Bits 6-10: MII register */
|
||||
#define ETH_MACMIIAR_MR_MASK (31 << ETH_MACMIIAR_MR_SHIFT)
|
||||
# define ETH_MACMIIAR_MR(n) ((uint32_t)(n) << ETH_MACMIIAR_MR_SHIFT)
|
||||
|
|
|
@ -235,17 +235,15 @@
|
|||
/* Set MACMIIAR CR bits depending on HCLK setting */
|
||||
|
||||
#if STM32_HCLK_FREQUENCY >= 20000000 && STM32_HCLK_FREQUENCY < 35000000
|
||||
# define ETH_MACMIIAR_CR ETH_MACMIIAR_CR_20_35
|
||||
# define ETH_MACMIIAR_CR ETH_MACMIIAR_CR_DIV16
|
||||
#elif STM32_HCLK_FREQUENCY >= 35000000 && STM32_HCLK_FREQUENCY < 60000000
|
||||
# define ETH_MACMIIAR_CR ETH_MACMIIAR_CR_35_60
|
||||
# define ETH_MACMIIAR_CR ETH_MACMIIAR_CR_DIV26
|
||||
#elif STM32_HCLK_FREQUENCY >= 60000000 && STM32_HCLK_FREQUENCY < 100000000
|
||||
# define ETH_MACMIIAR_CR ETH_MACMIIAR_CR_60_100
|
||||
# define ETH_MACMIIAR_CR ETH_MACMIIAR_CR_DIV42
|
||||
#elif STM32_HCLK_FREQUENCY >= 100000000 && STM32_HCLK_FREQUENCY < 150000000
|
||||
# define ETH_MACMIIAR_CR ETH_MACMIIAR_CR_100_150
|
||||
#elif STM32_HCLK_FREQUENCY >= 150000000 && STM32_HCLK_FREQUENCY <= 180000000
|
||||
# define ETH_MACMIIAR_CR ETH_MACMIIAR_CR_150_180
|
||||
#else
|
||||
# error "STM32_HCLK_FREQUENCY not supportable"
|
||||
# define ETH_MACMIIAR_CR ETH_MACMIIAR_CR_DIV62
|
||||
#else /* if STM32_HCLK_FREQUENCY >= 150000000 && STM32_HCLK_FREQUENCY <= 216000000 */
|
||||
# define ETH_MACMIIAR_CR ETH_MACMIIAR_CR_DIV102
|
||||
#endif
|
||||
|
||||
/* Timing *******************************************************************/
|
||||
|
|
|
@ -327,6 +327,7 @@ static int lib_find_answer(FAR const char *name, FAR struct hostent *host,
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_NETDB_DNSCLIENT
|
||||
static int lib_dns_query(FAR const char *hostname,
|
||||
FAR struct sockaddr *addr, socklen_t *addrlen)
|
||||
{
|
||||
|
@ -350,6 +351,7 @@ static int lib_dns_query(FAR const char *hostname,
|
|||
close(sd);
|
||||
return ret;
|
||||
}
|
||||
#endif /* CONFIG_NETDB_DNSCLIENT */
|
||||
|
||||
/****************************************************************************
|
||||
* Name: lib_dns_lookup
|
||||
|
|
Loading…
Reference in New Issue