Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d74f5ba4 authored by Ivo van Doorn's avatar Ivo van Doorn Committed by John W. Linville
Browse files

rt2x00: Cleanup symbol exports



With a bit of code moving to rt2x00lib within the
TX and RX paths we can now remove a lot of EXPORT_SYMBOL_GPL()
statements. This cleans up the interface between rt2x00lib
and the drivers and has the additional benefit that rt2x00pci
and rt2x00usb are trimmed down in size as well since they
have less to do.

Signed-off-by: default avatarIvo van Doorn <IvDoorn@gmail.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent c4da0048
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -1154,7 +1154,7 @@ static void rt2400pci_txdone(struct rt2x00_dev *rt2x00dev,
		}
		}
		txdesc.retry = rt2x00_get_field32(word, TXD_W0_RETRY_COUNT);
		txdesc.retry = rt2x00_get_field32(word, TXD_W0_RETRY_COUNT);


		rt2x00pci_txdone(rt2x00dev, entry, &txdesc);
		rt2x00lib_txdone(entry, &txdesc);
	}
	}
}
}


+1 −1
Original line number Original line Diff line number Diff line
@@ -1312,7 +1312,7 @@ static void rt2500pci_txdone(struct rt2x00_dev *rt2x00dev,
		}
		}
		txdesc.retry = rt2x00_get_field32(word, TXD_W0_RETRY_COUNT);
		txdesc.retry = rt2x00_get_field32(word, TXD_W0_RETRY_COUNT);


		rt2x00pci_txdone(rt2x00dev, entry, &txdesc);
		rt2x00lib_txdone(entry, &txdesc);
	}
	}
}
}


+0 −34
Original line number Original line Diff line number Diff line
@@ -899,14 +899,6 @@ static inline u16 get_duration_res(const unsigned int size, const u8 rate)
	return ((size * 8 * 10) % rate);
	return ((size * 8 * 10) % rate);
}
}


/**
 * rt2x00queue_alloc_rxskb - allocate a skb for RX purposes.
 * @rt2x00dev: Pointer to &struct rt2x00_dev.
 * @queue: The queue for which the skb will be applicable.
 */
struct sk_buff *rt2x00queue_alloc_rxskb(struct rt2x00_dev *rt2x00dev,
					struct queue_entry *entry);

/**
/**
 * rt2x00queue_map_txskb - Map a skb into DMA for TX purposes.
 * rt2x00queue_map_txskb - Map a skb into DMA for TX purposes.
 * @rt2x00dev: Pointer to &struct rt2x00_dev.
 * @rt2x00dev: Pointer to &struct rt2x00_dev.
@@ -914,20 +906,6 @@ struct sk_buff *rt2x00queue_alloc_rxskb(struct rt2x00_dev *rt2x00dev,
 */
 */
void rt2x00queue_map_txskb(struct rt2x00_dev *rt2x00dev, struct sk_buff *skb);
void rt2x00queue_map_txskb(struct rt2x00_dev *rt2x00dev, struct sk_buff *skb);


/**
 * rt2x00queue_unmap_skb - Unmap a skb from DMA.
 * @rt2x00dev: Pointer to &struct rt2x00_dev.
 * @skb: The skb to unmap.
 */
void rt2x00queue_unmap_skb(struct rt2x00_dev *rt2x00dev, struct sk_buff *skb);

/**
 * rt2x00queue_free_skb - free a skb
 * @rt2x00dev: Pointer to &struct rt2x00_dev.
 * @skb: The skb to free.
 */
void rt2x00queue_free_skb(struct rt2x00_dev *rt2x00dev, struct sk_buff *skb);

/**
/**
 * rt2x00queue_create_tx_descriptor - Create TX descriptor from mac80211 input
 * rt2x00queue_create_tx_descriptor - Create TX descriptor from mac80211 input
 * @entry: The entry which will be used to transfer the TX frame.
 * @entry: The entry which will be used to transfer the TX frame.
@@ -977,18 +955,6 @@ struct data_queue *rt2x00queue_get_queue(struct rt2x00_dev *rt2x00dev,
struct queue_entry *rt2x00queue_get_entry(struct data_queue *queue,
struct queue_entry *rt2x00queue_get_entry(struct data_queue *queue,
					  enum queue_index index);
					  enum queue_index index);


/**
 * rt2x00queue_index_inc - Index incrementation function
 * @queue: Queue (&struct data_queue) to perform the action on.
 * @index: Index type (&enum queue_index) to perform the action on.
 *
 * This function will increase the requested index on the queue,
 * it will grab the appropriate locks and handle queue overflow events by
 * resetting the index to the start of the queue.
 */
void rt2x00queue_index_inc(struct data_queue *queue, enum queue_index index);


/*
/*
 * Interrupt context handlers.
 * Interrupt context handlers.
 */
 */
+29 −0
Original line number Original line Diff line number Diff line
@@ -504,6 +504,12 @@ void rt2x00lib_txdone(struct queue_entry *entry,
{
{
	struct rt2x00_dev *rt2x00dev = entry->queue->rt2x00dev;
	struct rt2x00_dev *rt2x00dev = entry->queue->rt2x00dev;
	struct ieee80211_tx_info *tx_info = IEEE80211_SKB_CB(entry->skb);
	struct ieee80211_tx_info *tx_info = IEEE80211_SKB_CB(entry->skb);
	enum data_queue_qid qid = skb_get_queue_mapping(entry->skb);

	/*
	 * Unmap the skb.
	 */
	rt2x00queue_unmap_skb(rt2x00dev, entry->skb);


	/*
	/*
	 * Send frame to debugfs immediately, after this call is completed
	 * Send frame to debugfs immediately, after this call is completed
@@ -552,7 +558,25 @@ void rt2x00lib_txdone(struct queue_entry *entry,
		ieee80211_tx_status_irqsafe(rt2x00dev->hw, entry->skb);
		ieee80211_tx_status_irqsafe(rt2x00dev->hw, entry->skb);
	else
	else
		dev_kfree_skb_irq(entry->skb);
		dev_kfree_skb_irq(entry->skb);

	/*
	 * Make this entry available for reuse.
	 */
	entry->skb = NULL;
	entry->skb = NULL;
	entry->flags = 0;

	rt2x00dev->ops->lib->init_txentry(rt2x00dev, entry);

	__clear_bit(ENTRY_OWNER_DEVICE_DATA, &entry->flags);
	rt2x00queue_index_inc(entry->queue, Q_INDEX_DONE);

	/*
	 * If the data queue was below the threshold before the txdone
	 * handler we must make sure the packet queue in the mac80211 stack
	 * is reenabled when the txdone handler has finished.
	 */
	if (!rt2x00queue_threshold(entry->queue))
		ieee80211_wake_queue(rt2x00dev->hw, qid);
}
}
EXPORT_SYMBOL_GPL(rt2x00lib_txdone);
EXPORT_SYMBOL_GPL(rt2x00lib_txdone);


@@ -657,6 +681,11 @@ void rt2x00lib_rxdone(struct rt2x00_dev *rt2x00dev,
	 * Replace the skb with the freshly allocated one.
	 * Replace the skb with the freshly allocated one.
	 */
	 */
	entry->skb = skb;
	entry->skb = skb;
	entry->flags = 0;

	rt2x00dev->ops->lib->init_rxentry(rt2x00dev, entry);

	rt2x00queue_index_inc(entry->queue, Q_INDEX);
}
}
EXPORT_SYMBOL_GPL(rt2x00lib_rxdone);
EXPORT_SYMBOL_GPL(rt2x00lib_rxdone);


+49 −2
Original line number Original line Diff line number Diff line
@@ -98,10 +98,57 @@ void rt2x00lib_config_antenna(struct rt2x00_dev *rt2x00dev,
void rt2x00lib_config(struct rt2x00_dev *rt2x00dev,
void rt2x00lib_config(struct rt2x00_dev *rt2x00dev,
		      struct ieee80211_conf *conf, const int force_config);
		      struct ieee80211_conf *conf, const int force_config);


/*
/**
 * Queue handlers.
 * DOC: Queue handlers
 */

/**
 * rt2x00queue_alloc_rxskb - allocate a skb for RX purposes.
 * @rt2x00dev: Pointer to &struct rt2x00_dev.
 * @queue: The queue for which the skb will be applicable.
 */
struct sk_buff *rt2x00queue_alloc_rxskb(struct rt2x00_dev *rt2x00dev,
					struct queue_entry *entry);

/**
 * rt2x00queue_unmap_skb - Unmap a skb from DMA.
 * @rt2x00dev: Pointer to &struct rt2x00_dev.
 * @skb: The skb to unmap.
 */
void rt2x00queue_unmap_skb(struct rt2x00_dev *rt2x00dev, struct sk_buff *skb);

/**
 * rt2x00queue_free_skb - free a skb
 * @rt2x00dev: Pointer to &struct rt2x00_dev.
 * @skb: The skb to free.
 */
void rt2x00queue_free_skb(struct rt2x00_dev *rt2x00dev, struct sk_buff *skb);

/**
 * rt2x00queue_free_skb - free a skb
 * @rt2x00dev: Pointer to &struct rt2x00_dev.
 * @skb: The skb to free.
 */
void rt2x00queue_free_skb(struct rt2x00_dev *rt2x00dev, struct sk_buff *skb);

/**
 * rt2x00queue_write_tx_frame - Write TX frame to hardware
 * @queue: Queue over which the frame should be send
 * @skb: The skb to send
 */
 */
int rt2x00queue_write_tx_frame(struct data_queue *queue, struct sk_buff *skb);
int rt2x00queue_write_tx_frame(struct data_queue *queue, struct sk_buff *skb);

/**
 * rt2x00queue_index_inc - Index incrementation function
 * @queue: Queue (&struct data_queue) to perform the action on.
 * @index: Index type (&enum queue_index) to perform the action on.
 *
 * This function will increase the requested index on the queue,
 * it will grab the appropriate locks and handle queue overflow events by
 * resetting the index to the start of the queue.
 */
void rt2x00queue_index_inc(struct data_queue *queue, enum queue_index index);

void rt2x00queue_init_rx(struct rt2x00_dev *rt2x00dev);
void rt2x00queue_init_rx(struct rt2x00_dev *rt2x00dev);
void rt2x00queue_init_tx(struct rt2x00_dev *rt2x00dev);
void rt2x00queue_init_tx(struct rt2x00_dev *rt2x00dev);
int rt2x00queue_initialize(struct rt2x00_dev *rt2x00dev);
int rt2x00queue_initialize(struct rt2x00_dev *rt2x00dev);
Loading